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.
Showing the changes to include/linux/phy (1 of 2 files). Show all
Unified · Split
| @@ -243,7 +243,7 @@ static inline void *phy_get_drvdata(struct phy *phy) · 242 unmodified lines | ||
| 243 | 243 | #if IS_ENABLED(CONFIG_GENERIC_PHY) |
| 244 | 244 | int phy_pm_runtime_get(struct phy *phy); |
| 245 | 245 | int phy_pm_runtime_get_sync(struct phy *phy); |
| 246 | −int phy_pm_runtime_put(struct phy *phy); | |
| 246 | +void phy_pm_runtime_put(struct phy *phy); | |
| 247 | 247 | int phy_pm_runtime_put_sync(struct phy *phy); |
| 248 | 248 | int phy_init(struct phy *phy); |
| 249 | 249 | int phy_exit(struct phy *phy); |
| @@ -324,11 +324,8 @@ static inline int phy_pm_runtime_get_sync(struct phy *phy) · 74 unmodified lines | ||
| 324 | 324 | return -ENOSYS; |
| 325 | 325 | } |
| 326 | 326 | |
| 327 | −static inline int phy_pm_runtime_put(struct phy *phy) | |
| 327 | +static inline void phy_pm_runtime_put(struct phy *phy) | |
| 328 | 328 | { |
| 329 | − if (!phy) | |
| 330 | − return 0; | |
| 331 | − return -ENOSYS; | |
| 332 | 329 | } |
| 333 | 330 | |
| 334 | 331 | static inline int phy_pm_runtime_put_sync(struct phy *phy) |