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: wan: framer: Discard pm_runtime_put() return values

The framer driver defines framer_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.

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/3027916.e9J7NaK4W3@rafael.j.wysocki
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Rafael J. Wysocki and committed by
Jakub Kicinski
36775f3d 46786f66

+5 -6
+3 -3
drivers/net/wan/framer/framer-core.c
··· 60 60 } 61 61 EXPORT_SYMBOL_GPL(framer_pm_runtime_get_sync); 62 62 63 - int framer_pm_runtime_put(struct framer *framer) 63 + void framer_pm_runtime_put(struct framer *framer) 64 64 { 65 65 if (!pm_runtime_enabled(&framer->dev)) 66 - return -EOPNOTSUPP; 66 + return; 67 67 68 - return pm_runtime_put(&framer->dev); 68 + pm_runtime_put(&framer->dev); 69 69 } 70 70 EXPORT_SYMBOL_GPL(framer_pm_runtime_put); 71 71
+2 -3
include/linux/framer/framer.h
··· 96 96 #if IS_ENABLED(CONFIG_GENERIC_FRAMER) 97 97 int framer_pm_runtime_get(struct framer *framer); 98 98 int framer_pm_runtime_get_sync(struct framer *framer); 99 - int framer_pm_runtime_put(struct framer *framer); 99 + void framer_pm_runtime_put(struct framer *framer); 100 100 int framer_pm_runtime_put_sync(struct framer *framer); 101 101 int framer_init(struct framer *framer); 102 102 int framer_exit(struct framer *framer); ··· 124 124 return -ENOSYS; 125 125 } 126 126 127 - static inline int framer_pm_runtime_put(struct framer *framer) 127 + static inline void framer_pm_runtime_put(struct framer *framer) 128 128 { 129 - return -ENOSYS; 130 129 } 131 130 132 131 static inline int framer_pm_runtime_put_sync(struct framer *framer)