iio: mlx90632: Minor fixes
Subsystems (2)
Jonathan Cameron
maintainercover 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
Jonathan Cameron
maintainerPATCH 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")
--- drivers/iio/temperature/mlx90632.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/iio/temperature/mlx90632.c +4 -1
@@ -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
Jonathan Cameron
maintainerPATCH 2/2 iio: temperature: mlx90632: Add missing static marking on devm_pm_ops
In reply to Jonathan CameronFrom: Jonathan Cameron <[email protected]>
Only used within this file, so should be marked static.
--- drivers/iio/temperature/mlx90632.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/temperature/mlx90632.c +1 -1
@@ -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
Crt Mori
maintainerRe: [PATCH 1/2] iio: temperature: mlx90632: Add error handling for devm_pm_runtime_enable()
In reply to Jonathan CameronQuoted 32 lines · Jonathan Cameron
From: Jonathan Cameron <[email protected]>
This call can fail so handling is necessary even if it is very unlikely.
Reported-by coverity-bot <[email protected]>Addresses-Coverity-ID: 1527134 ("Error handling issues")
Fixes c83d3e5ca97f ("iio: temperature: mlx90632 Add runtime powermanagement modes")Signed-off-by Jonathan Cameron <[email protected]>--- drivers/iio/temperature/mlx90632.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)drivers/iio/temperature/mlx90632.c +4
-2@@ -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
Crt Mori
maintainerRe: [PATCH 2/2] iio: temperature: mlx90632: Add missing static marking on devm_pm_ops
In reply to Jonathan CameronQuoted 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")Signed-off-by Jonathan Cameron <[email protected]>--- drivers/iio/temperature/mlx90632.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/iio/temperature/mlx90632.c +1
-2@@ -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
Jonathan Cameron
maintainerQuoted 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 ondevm_pm_opsdrivers/iio/temperature/mlx90632.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)