Skip to contentSkip to conversation

iio: mlx90632: Minor fixes

PATCH In review Jonathan Cameron 2 participants 6 messages Nov 5, 2022 – Nov 12, 2022

Subsystems (2)
lore
Share & tools
lore

Jonathan Cameron

author maintainer
#0 lore raw

cover iio: mlx90632: Minor fixes

From: Jonathan Cameron <[email protected]>

A couple of minor fixes. The devm_ error handling was a coverity report. Static was a warning I'd missed originally but saw in build whilst testing the above.

Crt, could you give these a quick look (+tag ideally) then I'll get them on the tree so the issue is fixed in Linux next before I send Greg a pull request.

Jonathan Cameron (2):
iio: temperature: mlx90632: Add error handling for
devm_pm_runtime_enable()
iio: temperature: mlx90632: Add missing static marking on devm_pm_ops

 drivers/iio/temperature/mlx90632.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
Signature · 1 line
2.38.1
author maintainer
#1 lore raw

PATCH 1/2 iio: temperature: mlx90632: Add error handling for devm_pm_runtime_enable()

From: Jonathan Cameron <[email protected]>

This call can fail so handling is necessary even if it is very unlikely.

Addresses-Coverity-ID: 1527134 ("Error handling issues")

Fixes c83d3e5ca97f ("iio: temperature: mlx90632 Add runtime powermanagement modes")
---
 drivers/iio/temperature/mlx90632.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/iio/temperature/mlx90632.c +4 -1
index a17fe5f4967a..7572ae3f8432 100644
@@ -1267,7 +1267,10 @@ static int mlx90632_probe(struct i2c_client *client,
 	pm_runtime_get_noresume(&client->dev);
 	pm_runtime_set_active(&client->dev);
 
-	devm_pm_runtime_enable(&client->dev);
+	ret = devm_pm_runtime_enable(&client->dev);
+	if (ret)
+		return ret;
+
 	pm_runtime_set_autosuspend_delay(&client->dev, MLX90632_SLEEP_DELAY_MS);
 	pm_runtime_use_autosuspend(&client->dev);
 	pm_runtime_put_autosuspend(&client->dev);
Signature · 1 line
2.38.1
maintainer
#2 lore raw

Re: [PATCH 1/2] iio: temperature: mlx90632: Add error handling for devm_pm_runtime_enable()

Quoted 32 lines · Jonathan Cameron

From: Jonathan Cameron <[email protected]>

This call can fail so handling is necessary even if it is very unlikely.

Addresses-Coverity-ID: 1527134 ("Error handling issues")

Fixes c83d3e5ca97f ("iio: temperature: mlx90632 Add runtime powermanagement modes")
---
 drivers/iio/temperature/mlx90632.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/iio/temperature/mlx90632.c +4 -2
index a17fe5f4967a..7572ae3f8432 100644
@@ -1267,7 +1267,10 @@ static int mlx90632_probe(struct i2c_client *client,
        pm_runtime_get_noresume(&client->dev);
        pm_runtime_set_active(&client->dev);
 
-       devm_pm_runtime_enable(&client->dev);
+       ret = devm_pm_runtime_enable(&client->dev);
+       if (ret)
+               return ret;
+
        pm_runtime_set_autosuspend_delay(&client->dev, MLX90632_SLEEP_DELAY_MS);
        pm_runtime_use_autosuspend(&client->dev);
        pm_runtime_put_autosuspend(&client->dev);
--

2.38.1

author maintainer
#3 lore raw

PATCH 2/2 iio: temperature: mlx90632: Add missing static marking on devm_pm_ops

In reply to Jonathan Cameron

From: Jonathan Cameron <[email protected]>

Only used within this file, so should be marked static.

Fixes c83d3e5ca97f ("iio: temperature: mlx90632 Add runtime powermanagement modes")
---
 drivers/iio/temperature/mlx90632.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/temperature/mlx90632.c +1 -1
index 7572ae3f8432..f1f5ebc145b1 100644
@@ -1326,7 +1326,7 @@ static int mlx90632_pm_runtime_suspend(struct device *dev)
 	return mlx90632_pwr_set_sleep_step(data->regmap);
 }
 
-const struct dev_pm_ops mlx90632_pm_ops = {
+static const struct dev_pm_ops mlx90632_pm_ops = {
 	SYSTEM_SLEEP_PM_OPS(mlx90632_pm_suspend, mlx90632_pm_resume)
 	RUNTIME_PM_OPS(mlx90632_pm_runtime_suspend, NULL, NULL)
 };
Signature · 1 line
2.38.1
maintainer
#4 lore raw

Re: [PATCH 2/2] iio: temperature: mlx90632: Add missing static marking on devm_pm_ops

Quoted 27 lines · Jonathan Cameron

From: Jonathan Cameron <[email protected]>

Only used within this file, so should be marked static.

Fixes c83d3e5ca97f ("iio: temperature: mlx90632 Add runtime powermanagement modes")
---
 drivers/iio/temperature/mlx90632.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/temperature/mlx90632.c +1 -2
index 7572ae3f8432..f1f5ebc145b1 100644
@@ -1326,7 +1326,7 @@ static int mlx90632_pm_runtime_suspend(struct device *dev)
        return mlx90632_pwr_set_sleep_step(data->regmap);
 }
 
-const struct dev_pm_ops mlx90632_pm_ops = {
+static const struct dev_pm_ops mlx90632_pm_ops = {
        SYSTEM_SLEEP_PM_OPS(mlx90632_pm_suspend, mlx90632_pm_resume)
        RUNTIME_PM_OPS(mlx90632_pm_runtime_suspend, NULL, NULL)
 };
--

2.38.1

author maintainer
#5 lore raw
In reply to Jonathan Cameron
Quoted 9 lines · On Sat, 5 Nov 2022 12:51:06 +0000 Jonathan Cameron <[email protected]> wrote:

From: Jonathan Cameron <[email protected]>

A couple of minor fixes. The devm_ error handling was a coverity report. Static was a warning I'd missed originally but saw in build whilst testing the above.

Crt, could you give these a quick look (+tag ideally) then I'll get them on the tree so the issue is fixed in Linux next before I send Greg a pull request.

Series applied.

Thanks,

Jonathan

Quoted 9 lines

Jonathan Cameron (2):
iio: temperature: mlx90632: Add error handling for
devm_pm_runtime_enable()
iio: temperature: mlx90632: Add missing static marking on devm_pm_ops

 drivers/iio/temperature/mlx90632.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)