]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 14 Jul 2021 14:59:30 +0000 (16:59 +0200)
[ Upstream commit 6005a8e955e4e451e4bf6000affaab566d4cab5e ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/media/i2c/ccs/ccs-core.c

index 4505594996bd8ee8e92a524a8d01e1125f36c266..fde0c51f040697ad11988c52236c93d5705cbc62 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)