Skip to content

Commit

Permalink
Merge branch 'net-vertexcom-mse102x-minor-clean-ups'
Browse files Browse the repository at this point in the history
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.net
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Jakub Kicinski committed Aug 29, 2024
2 parents 0a8b08c + bc682b8 commit daca6af
Showing 1 changed file with 7 additions and 13 deletions.
20 changes: 7 additions & 13 deletions drivers/net/ethernet/vertexcom/mse102x.c
Original file line number Diff line number Diff line change
Expand Up @@ -377,8 +377,8 @@ static int mse102x_tx_pkt_spi(struct mse102x_net *mse, struct sk_buff *txb,
int ret;
bool first = true;

if (txb->len < 60)
pad = 60 - txb->len;
if (txb->len < ETH_ZLEN)
pad = ETH_ZLEN - txb->len;

while (1) {
mse102x_tx_cmd_spi(mse, CMD_RTS | (txb->len + pad));
Expand Down Expand Up @@ -451,7 +451,7 @@ static void mse102x_tx_work(struct work_struct *work)

if (ret == -ETIMEDOUT) {
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++;
}
Expand Down Expand Up @@ -485,8 +485,8 @@ static void mse102x_init_mac(struct mse102x_net *mse, struct device_node *np)

if (ret) {
eth_hw_addr_random(ndev);
netdev_err(ndev, "Using random MAC address: %pM\n",
ndev->dev_addr);
dev_warn(ndev->dev.parent, "Using random MAC address: %pM\n",
ndev->dev_addr);
}
}

Expand Down Expand Up @@ -622,8 +622,6 @@ static const struct ethtool_ops mse102x_ethtool_ops = {

/* driver bus management functions */

#ifdef CONFIG_PM_SLEEP

static int mse102x_suspend(struct device *dev)
{
struct mse102x_net *mse = dev_get_drvdata(dev);
Expand All @@ -649,9 +647,8 @@ static int mse102x_resume(struct device *dev)

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)
{
Expand Down Expand Up @@ -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_spi *mses = to_mse102x_spi(mse);

if (netif_msg_drv(mse))
dev_info(&spi->dev, "remove\n");

mse102x_remove_device_debugfs(mses);
unregister_netdev(mse->ndev);
}
Expand All @@ -761,7 +755,7 @@ static struct spi_driver mse102x_driver = {
.driver = {
.name = DRV_NAME,
.of_match_table = mse102x_match_table,
.pm = &mse102x_pm_ops,
.pm = pm_sleep_ptr(&mse102x_pm_ops),
},
.probe = mse102x_probe_spi,
.remove = mse102x_remove_spi,
Expand Down

0 comments on commit daca6af

Please sign in to comment.