From patchwork Mon Jul 12 06:05:35 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 475814 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 09BC9C11F76 for ; Mon, 12 Jul 2021 07:09:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E41B261152 for ; Mon, 12 Jul 2021 07:09:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242053AbhGLHM2 (ORCPT ); Mon, 12 Jul 2021 03:12:28 -0400 Received: from mail.kernel.org ([198.145.29.99]:43002 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242804AbhGLHHc (ORCPT ); Mon, 12 Jul 2021 03:07:32 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 847876108B; Mon, 12 Jul 2021 07:04:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626073474; bh=Pm43KLEJ9eqBgNsDtKpe91gbsGOS/dk4S1pFa3w48nM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=N/sPZdVMtNcuTLAZSjVgMBcyoPMGRYRYPe5XlAUWFFCsWpcHpPHiK880Aix6vWvP8 wCxk/O0sx0Bm+BCen4zyV+a4zCzo9fXdPMqQrqjiQS9WvQOek59YJVBBpOofTzE03n Tr6XH+s61H1SzjaQiRPtG5zl49RFP+QIoMEaU2lw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jonathan Cameron , Sakari Ailus , Mauro Carvalho Chehab , Sasha Levin Subject: [PATCH 5.12 252/700] media: i2c: ccs-core: return the right error code at suspend Date: Mon, 12 Jul 2021 08:05:35 +0200 Message-Id: <20210712061002.657287214@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210712060924.797321836@linuxfoundation.org> References: <20210712060924.797321836@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Mauro Carvalho Chehab [ 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 Acked-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Sasha Levin --- 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 4505594996bd..fde0c51f0406 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)