hwrng: cctrng - Discard pm_runtime_put_autosuspend() return value
Subsystems (3)
Herbert Xu
maintainerPATCH RESEND 1/1 hwrng: cctrng - Discard pm_runtime_put_autosuspend() return value
From: Brian Norris <[email protected]>
Printing an error message on pm_runtime_put_autosuspend() returning a non-zero value is not particularly useful.
Returning an error code from pm_runtime_put_autosuspend() merely means that it has not queued up a timer or 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 device's runtime PM "control" attribute in sysfs for one example.
Accordingly, update cc_trng_pm_put_suspend() to simply discard the return value of pm_runtime_put_autosuspend().
This will facilitate a planned change of the pm_runtime_put_autosuspend() return type to void in the future, similar to commit 3afd8df02433 ("PM: runtime: Change pm_runtime_put() return type to void").
drivers/char/hw_random/cctrng.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/char/hw_random/cctrng.c +1 -5
@@ -96,11 +96,7 @@ static int cc_trng_pm_get(struct device *dev)static void cc_trng_pm_put_suspend (struct device *dev) { -int rc =0 ; - - rc =pm_runtime_put_autosuspend (dev); -if (rc) -dev_err (dev,"pm_runtime_put_autosuspend returned %x\n" , rc); +pm_runtime_put_autosuspend (dev); }static int cc_trng_pm_init (struct cctrng_drvdata *drvdata)
Signature · 3 lines
Email: Herbert Xu <[email protected]> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
Quoted 31 lines · Herbert Xu
From: Brian Norris <[email protected]>
Printing an error message on
pm_runtime_put_autosuspend()returning a non-zero value is not particularly useful.Returning an error code from
pm_runtime_put_autosuspend()merely means that it has not queued up a timer or 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 device's runtime PM "control" attribute in sysfs for one example.Accordingly, update
cc_trng_pm_put_suspend()to simply discard the return value ofpm_runtime_put_autosuspend().This will facilitate a planned change of the
pm_runtime_put_autosuspend()return type to void in the future, similar to commit3afd8df02433("PM: runtime: Changepm_runtime_put()return type to void").Signed-off-by Brian Norris <[email protected]>drivers/char/hw_random/cctrng.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)drivers/char/hw_random/cctrng.c +0
-0@@ -96,11 +96,7 @@ static int cc_trng_pm_get(struct device *dev)static void cc_trng_pm_put_suspend (struct device *dev)
drivers/char/hw_random/cctrng.c static int cc_trng_pm_get(struct device *dev) · line 102
Quoted 10 lines
drivers/char/hw_random/cctrng.c +1
-5{ -int rc =0 ; - - rc =pm_runtime_put_autosuspend (dev); -if (rc) -dev_err (dev,"pm_runtime_put_autosuspend returned %x\n" , rc); +pm_runtime_put_autosuspend (dev); }static int cc_trng_pm_init (struct cctrng_drvdata *drvdata)