History

phy: core: Discard pm_runtime_put() return values

The PHY core defines phy_pm_runtime_put() to return an int, but that return value is never used. It also passes the return value of pm_runtime_put() to the caller which is not very 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. Modify phy_pm_runtime_put() to discard the pm_runtime_put() return value and change its return type to void. Also drop the redundant pm_runtime_enabled() call from there. No intentional functional impact. This will facilitate a planned change of the pm_runtime_put() return type to void in the future.

Rafael J. Wysocki committed 10 months ago

Commit caad07a1 parent 455bf7d2 files · +5 −11Browse files

Showing the changes to include/linux/phy (1 of 2 files). Show all

Unified · Split

include/linux/phy/phy.h+2−5
@@ -243,7 +243,7 @@ static inline void *phy_get_drvdata(struct phy *phy) · 242 unmodified lines
243#if IS_ENABLED(CONFIG_GENERIC_PHY)243#if IS_ENABLED(CONFIG_GENERIC_PHY)
244int phy_pm_runtime_get(struct phy *phy);244int phy_pm_runtime_get(struct phy *phy);
245int phy_pm_runtime_get_sync(struct phy *phy);245int phy_pm_runtime_get_sync(struct phy *phy);
246int phy_pm_runtime_put(struct phy *phy);246void phy_pm_runtime_put(struct phy *phy);
247int phy_pm_runtime_put_sync(struct phy *phy);247int phy_pm_runtime_put_sync(struct phy *phy);
248int phy_init(struct phy *phy);248int phy_init(struct phy *phy);
249int phy_exit(struct phy *phy);249int phy_exit(struct phy *phy);
@@ -324,11 +324,8 @@ static inline int phy_pm_runtime_get_sync(struct phy *phy) · 74 unmodified lines
324 return -ENOSYS;324 return -ENOSYS;
325}325}
326 326
327static inline int phy_pm_runtime_put(struct phy *phy)327static inline void phy_pm_runtime_put(struct phy *phy)
328{328{
329 if (!phy)
330 return 0;
331 return -ENOSYS;
332}329}
333 330
334static inline int phy_pm_runtime_put_sync(struct phy *phy)331static inline int phy_pm_runtime_put_sync(struct phy *phy)