]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.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)
committerStefan Bader <stefan.bader@canonical.com>
Fri, 13 Aug 2021 07:31:47 +0000 (09:31 +0200)
BugLink: https://bugs.launchpad.net/bugs/1938340
[ 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>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
drivers/media/i2c/ccs/ccs-core.c

index 6a02d8852398a0c1ad98a91fca7093d2a74fae4f..f82399e218862875007dd8da6d971a278ec6cf17 100644 (file)
@@ -2871,7 +2871,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)