[05/25] media: i2c: ccs-core: return the right error code at suspend
diff mbox series

Message ID 92cb0f741d16d9eaa9f99f336d826f30ac7a2671.1620207353.git.mchehab+huawei@kernel.org
State New, archived
Headers show
Series
  • Fix some PM runtime issues at the media subsystem
Related show

Commit Message

Mauro Carvalho Chehab May 5, 2021, 9:41 a.m. UTC
If pm_runtime resume logic fails, return the error code
provided by it, instead of -EAGAIN, as, depending on what
caused it to fail, it may not be something that would be
recovered.

Fixes: cbba45d43631 ("[media] smiapp: Use runtime PM")
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
---
 drivers/media/i2c/ccs/ccs-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jonathan Cameron May 5, 2021, 12:24 p.m. UTC | #1
On Wed, 5 May 2021 11:41:55 +0200
Mauro Carvalho Chehab <mchehab+huawei@kernel.org> wrote:

> If pm_runtime resume logic fails, return the error code
> provided by it, instead of -EAGAIN, as, depending on what
> caused it to fail, it may not be something that would be
> recovered.
> 
> Fixes: cbba45d43631 ("[media] smiapp: Use runtime PM")
> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

> ---
>  drivers/media/i2c/ccs/ccs-core.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/media/i2c/ccs/ccs-core.c b/drivers/media/i2c/ccs/ccs-core.c
> index 9dc3f45da3dc..b05f409014b2 100644
> --- a/drivers/media/i2c/ccs/ccs-core.c
> +++ b/drivers/media/i2c/ccs/ccs-core.c
> @@ -3093,7 +3093,7 @@ static int __maybe_unused ccs_suspend(struct device *dev)
>  	if (rval < 0) {
>  		pm_runtime_put_noidle(dev);
>  
> -		return -EAGAIN;
> +		return rval;
>  	}
>  
>  	if (sensor->streaming)
Sakari Ailus May 5, 2021, 12:51 p.m. UTC | #2
On Wed, May 05, 2021 at 11:41:55AM +0200, Mauro Carvalho Chehab wrote:
> If pm_runtime resume logic fails, return the error code
> provided by it, instead of -EAGAIN, as, depending on what
> caused it to fail, it may not be something that would be
> recovered.
> 
> Fixes: cbba45d43631 ("[media] smiapp: Use runtime PM")
> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>

Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>

Patch
diff mbox series

diff --git a/drivers/media/i2c/ccs/ccs-core.c b/drivers/media/i2c/ccs/ccs-core.c
index 9dc3f45da3dc..b05f409014b2 100644
--- a/drivers/media/i2c/ccs/ccs-core.c
+++ b/drivers/media/i2c/ccs/ccs-core.c
@@ -3093,7 +3093,7 @@  static int __maybe_unused ccs_suspend(struct device *dev)
 	if (rval < 0) {
 		pm_runtime_put_noidle(dev);
 
-		return -EAGAIN;
+		return rval;
 	}
 
 	if (sensor->streaming)