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.

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.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Link: https://patch.msgid.link/2556645.jE0xQCEvom@rafael.j.wysocki
Signed-off-by: Vinod Koul <vkoul@kernel.org>

authored by

Rafael J. Wysocki and committed by
Vinod Koul
caad07ae 455bf7d9

+5 -11
+3 -6
drivers/phy/phy-core.c
··· 190 190 } 191 191 EXPORT_SYMBOL_GPL(phy_pm_runtime_get_sync); 192 192 193 - int phy_pm_runtime_put(struct phy *phy) 193 + void phy_pm_runtime_put(struct phy *phy) 194 194 { 195 195 if (!phy) 196 - return 0; 196 + return; 197 197 198 - if (!pm_runtime_enabled(&phy->dev)) 199 - return -ENOTSUPP; 200 - 201 - return pm_runtime_put(&phy->dev); 198 + pm_runtime_put(&phy->dev); 202 199 } 203 200 EXPORT_SYMBOL_GPL(phy_pm_runtime_put); 204 201
+2 -5
include/linux/phy/phy.h
··· 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 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)