Commit daca6afc authored by Jakub Kicinski's avatar Jakub Kicinski

Merge branch 'net-vertexcom-mse102x-minor-clean-ups'

Stefan Wahren says:

====================
net: vertexcom: mse102x: Minor clean-ups

This series provides some minor clean-ups for the Vertexcom MSE102x
driver.
====================

Link: https://patch.msgid.link/20240827191000.3244-1-wahrenst@gmx.netSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parents 0a8b08c5 bc682b80
...@@ -377,8 +377,8 @@ static int mse102x_tx_pkt_spi(struct mse102x_net *mse, struct sk_buff *txb, ...@@ -377,8 +377,8 @@ static int mse102x_tx_pkt_spi(struct mse102x_net *mse, struct sk_buff *txb,
int ret; int ret;
bool first = true; bool first = true;
if (txb->len < 60) if (txb->len < ETH_ZLEN)
pad = 60 - txb->len; pad = ETH_ZLEN - txb->len;
while (1) { while (1) {
mse102x_tx_cmd_spi(mse, CMD_RTS | (txb->len + pad)); mse102x_tx_cmd_spi(mse, CMD_RTS | (txb->len + pad));
...@@ -451,7 +451,7 @@ static void mse102x_tx_work(struct work_struct *work) ...@@ -451,7 +451,7 @@ static void mse102x_tx_work(struct work_struct *work)
if (ret == -ETIMEDOUT) { if (ret == -ETIMEDOUT) {
if (netif_msg_timer(mse)) if (netif_msg_timer(mse))
netdev_err(mse->ndev, "tx work timeout\n"); netdev_err_once(mse->ndev, "tx work timeout\n");
mse->stats.tx_timeout++; mse->stats.tx_timeout++;
} }
...@@ -485,8 +485,8 @@ static void mse102x_init_mac(struct mse102x_net *mse, struct device_node *np) ...@@ -485,8 +485,8 @@ static void mse102x_init_mac(struct mse102x_net *mse, struct device_node *np)
if (ret) { if (ret) {
eth_hw_addr_random(ndev); eth_hw_addr_random(ndev);
netdev_err(ndev, "Using random MAC address: %pM\n", dev_warn(ndev->dev.parent, "Using random MAC address: %pM\n",
ndev->dev_addr); ndev->dev_addr);
} }
} }
...@@ -622,8 +622,6 @@ static const struct ethtool_ops mse102x_ethtool_ops = { ...@@ -622,8 +622,6 @@ static const struct ethtool_ops mse102x_ethtool_ops = {
/* driver bus management functions */ /* driver bus management functions */
#ifdef CONFIG_PM_SLEEP
static int mse102x_suspend(struct device *dev) static int mse102x_suspend(struct device *dev)
{ {
struct mse102x_net *mse = dev_get_drvdata(dev); struct mse102x_net *mse = dev_get_drvdata(dev);
...@@ -649,9 +647,8 @@ static int mse102x_resume(struct device *dev) ...@@ -649,9 +647,8 @@ static int mse102x_resume(struct device *dev)
return 0; return 0;
} }
#endif
static SIMPLE_DEV_PM_OPS(mse102x_pm_ops, mse102x_suspend, mse102x_resume); static DEFINE_SIMPLE_DEV_PM_OPS(mse102x_pm_ops, mse102x_suspend, mse102x_resume);
static int mse102x_probe_spi(struct spi_device *spi) static int mse102x_probe_spi(struct spi_device *spi)
{ {
...@@ -736,9 +733,6 @@ static void mse102x_remove_spi(struct spi_device *spi) ...@@ -736,9 +733,6 @@ static void mse102x_remove_spi(struct spi_device *spi)
struct mse102x_net *mse = dev_get_drvdata(&spi->dev); struct mse102x_net *mse = dev_get_drvdata(&spi->dev);
struct mse102x_net_spi *mses = to_mse102x_spi(mse); struct mse102x_net_spi *mses = to_mse102x_spi(mse);
if (netif_msg_drv(mse))
dev_info(&spi->dev, "remove\n");
mse102x_remove_device_debugfs(mses); mse102x_remove_device_debugfs(mses);
unregister_netdev(mse->ndev); unregister_netdev(mse->ndev);
} }
...@@ -761,7 +755,7 @@ static struct spi_driver mse102x_driver = { ...@@ -761,7 +755,7 @@ static struct spi_driver mse102x_driver = {
.driver = { .driver = {
.name = DRV_NAME, .name = DRV_NAME,
.of_match_table = mse102x_match_table, .of_match_table = mse102x_match_table,
.pm = &mse102x_pm_ops, .pm = pm_sleep_ptr(&mse102x_pm_ops),
}, },
.probe = mse102x_probe_spi, .probe = mse102x_probe_spi,
.remove = mse102x_remove_spi, .remove = mse102x_remove_spi,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment