media: i2c: ccs-core: return the right error code at suspend
authorMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Tue, 27 Apr 2021 06:36:00 +0000 (08:36 +0200)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Mon, 10 May 2021 09:36:33 +0000 (11:36 +0200)
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")
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/media/i2c/ccs/ccs-core.c

index 9dc3f45da3dcd269b964745527dad4c383eacc8a..b05f409014b2f8ac2581071fbdf0b8a75f3bb6a6 100644 (file)
@@ -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)