From: Mauro Carvalho Chehab Date: Tue, 27 Apr 2021 06:36:00 +0000 (+0200) Subject: media: i2c: ccs-core: return the right error code at suspend X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=6005a8e955e4e451e4bf6000affaab566d4cab5e;p=linux.git media: i2c: ccs-core: return the right error code at suspend 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 Acked-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/i2c/ccs/ccs-core.c b/drivers/media/i2c/ccs/ccs-core.c index 9dc3f45da3dcd..b05f409014b2f 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)