Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

net: ethernet: ti: am65-cpsw: Discard pm_runtime_put() return value

Printing error messages on pm_runtime_put() returning negative values
is not particularly useful.

Returning an error code from pm_runtime_put() merely means that it has
not queued up a work item to check whether or not the device can be
suspended and there are many perfectly valid situations in which that
can happen, like after writing "on" to the devices' runtime PM "control"
attribute in sysfs for one example.

Accordingly, update am65_cpsw_ethtool_op_begin() and cpsw_ethtool_op_begin()
to simply discard the return value of pm_runtime_put().

This will facilitate a planned change of the pm_runtime_put() return
type to void in the future.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Link: https://patch.msgid.link/5042490.GXAFRqVoOG@rafael.j.wysocki
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Rafael J. Wysocki and committed by
Jakub Kicinski
6961aa43 fd1de45a

+2 -8
+1 -4
drivers/net/ethernet/ti/am65-cpsw-ethtool.c
··· 391 391 static void am65_cpsw_ethtool_op_complete(struct net_device *ndev) 392 392 { 393 393 struct am65_cpsw_common *common = am65_ndev_to_common(ndev); 394 - int ret; 395 394 396 - ret = pm_runtime_put(common->dev); 397 - if (ret < 0 && ret != -EBUSY) 398 - dev_err(common->dev, "ethtool complete failed %d\n", ret); 395 + pm_runtime_put(common->dev); 399 396 } 400 397 401 398 static void am65_cpsw_get_drvinfo(struct net_device *ndev,
+1 -4
drivers/net/ethernet/ti/cpsw_ethtool.c
··· 374 374 void cpsw_ethtool_op_complete(struct net_device *ndev) 375 375 { 376 376 struct cpsw_priv *priv = netdev_priv(ndev); 377 - int ret; 378 377 379 - ret = pm_runtime_put(priv->cpsw->dev); 380 - if (ret < 0) 381 - cpsw_err(priv, drv, "ethtool complete failed %d\n", ret); 378 + pm_runtime_put(priv->cpsw->dev); 382 379 } 383 380 384 381 void cpsw_get_channels(struct net_device *ndev, struct ethtool_channels *ch)