[PATCH v1 18/23] platform/chrome: cros_hps_i2c: Discard pm_runtime_put() return value

Rafael J. Wysocki posted 1 patch 1 month, 2 weeks ago
drivers/platform/chrome/cros_hps_i2c.c |    4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
[PATCH v1 18/23] platform/chrome: cros_hps_i2c: Discard pm_runtime_put() return value
Posted by Rafael J. Wysocki 1 month, 2 weeks ago
From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

Passing pm_runtime_put() return value to the callers is not particularly
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.  It also happens when the kernel is
configured with CONFIG_PM unset.

Accordingly, update hps_release() to simply discard the return value of
pm_runtime_put() and always return success to the caller.

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>
---

This patch is part of a series, but it doesn't depend on anything else
in that series.  The last patch in the series depends on it.

It can be applied by itself and if you decide to do so, please let me
know.

Otherwise, an ACK or equivalent will be appreciated, but also the lack
of specific criticism will be eventually regarded as consent.

---
 drivers/platform/chrome/cros_hps_i2c.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

--- a/drivers/platform/chrome/cros_hps_i2c.c
+++ b/drivers/platform/chrome/cros_hps_i2c.c
@@ -46,7 +46,9 @@ static int hps_release(struct inode *ino
 					       struct hps_drvdata, misc_device);
 	struct device *dev = &hps->client->dev;
 
-	return pm_runtime_put(dev);
+	pm_runtime_put(dev);
+
+	return 0;
 }
 
 static const struct file_operations hps_fops = {
Re: [PATCH v1 18/23] platform/chrome: cros_hps_i2c: Discard pm_runtime_put() return value
Posted by Tzung-Bi Shih 1 month, 2 weeks ago
On Mon, Dec 22, 2025 at 09:27:44PM +0100, Rafael J. Wysocki wrote:
> From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> 
> Passing pm_runtime_put() return value to the callers is not particularly
> 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.  It also happens when the kernel is
> configured with CONFIG_PM unset.
> 
> Accordingly, update hps_release() to simply discard the return value of
> pm_runtime_put() and always return success to the caller.
> 
> 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>

Acked-by: Tzung-Bi Shih <tzungbi@kernel.org>