From patchwork Sat Apr 24 06:44:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 12222461 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=-17.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,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 68E4FC433B4 for ; Sat, 24 Apr 2021 06:55:37 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 36AD66148E for ; Sat, 24 Apr 2021 06:55:37 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 36AD66148E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=D2jPggeaHk7Q6UDYSZ3Vs4PLcNUvkwFvY7f0AGzPgg8=; b=ERy6t7cpzm0wNxl16AfC+YSMr f01Dwwe+IxV+Bqzfrx0IWs0/ghxysncjkfAeLUzsxPz/8OGqdSrspZ1x6CSynjg+VOqB3fp2UbqcR 0VIz5sQ7s6Y/lg6e8UNidJT+SMY9EOBexKcQ3lLQnMbgNsOHZVGVa6DOrCWhD2yhGWI/qWbKS+9e6 Z06s8xFRiHH9dmXBNSM6SLJCO0ArdwCaruT74WiR56kQ5QiK6+AFb9M5vxMo2/7tLRbfsVutl8m80 RWx+Tg1Kj9hf3sB4Ukz6r2/nh+IqnW8+hYynAkUwf+Zookeu4kKm3Qs3OL7yLnDfiLB4GTO5ydjU1 nxOz3YOjQ==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1laCA2-003BXS-35; Sat, 24 Apr 2021 06:53:06 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1laC2t-003B19-0j for linux-arm-kernel@desiato.infradead.org; Sat, 24 Apr 2021 06:46:01 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Sender:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description; bh=Lli/WI1PPfjtNqq1j0LnavbGLzvQibYHe8n3AKvRnfs=; b=Iwj5r3UW5EH9qbV5ufV9N0Fbb7 GG7+fIZhg0f4Sa3F+EwS+Ozcnf8Dfj0i2e+WRpGHybDARYceJr7uZd2D/E6+ctyWTQPiJRwf4wj7v 8JNEX832xE2cvNO/hzrwGdJ5uB5IAolsAnTXUbQTjVDam0aK7sqsDgwwi60XxMa5yT54i6vBBLPms jDOIs9YWQMcby70Zq+DZXUqkz2smDoWR2v+ZD8a029VR4MTmvbIpFh3dN7J9n79euY5ltd4cYal6i JDoAT0nbSRWKRD6JwY1ebmZTBe6UOaX5S58IO45AR+cHk4NrdG8DHasqJSf17ovXhfkjavqM43CBq mnu0zbfg==; Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1laC2o-00EsJj-Rt for linux-arm-kernel@lists.infradead.org; Sat, 24 Apr 2021 06:45:37 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id 1DEEE6157F; Sat, 24 Apr 2021 06:45:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1619246733; bh=Rq+16yz5e8SlR4lBpfokaa5W2Lfu4S58C8WlJJgkO5E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kYIdg4OV1jct1026KcMw/JQaQTKIREfQPahmBEkCnjksQjgwD6leEnmpbV2TsIuEl HwAG2v6KdNW/kvf/B3qmCc1Z46D+UiGos6lRhv98+/mMgBA9N/qTzgnC05HVkFYfgx 4MPKd+XjXEcUNWS7JpOru09dc9t+4PtlPl1JADDDbuNxS1IN6XsyCka7bbL659GGWE XDxuaKQtHV+hjyvkrQc76icj1ij2zHyEtyc4flcA6qfh8WceXwI8wm/3dCMG/86GL1 9Hc+4lLvXQDFR9WWp8mO+m4cf8NVw5IjTGmmXt8nBjonoY2MjqG61s6Tifu747Sihz 9my6arjIfH0SA== Received: by mail.kernel.org with local (Exim 4.94) (envelope-from ) id 1laC2l-004JeO-93; Sat, 24 Apr 2021 08:45:31 +0200 From: Mauro Carvalho Chehab To: Cc: linuxarm@huawei.com, mauro.chehab@huawei.com, Mauro Carvalho Chehab , Fabio Estevam , Greg Kroah-Hartman , Mauro Carvalho Chehab , NXP Linux Team , Pengutronix Kernel Team , Philipp Zabel , Rui Miguel Silva , Sascha Hauer , Shawn Guo , Steve Longerbeam , devel@driverdev.osuosl.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org Subject: [PATCH 14/78] staging: media: imx7-mipi-csis: use pm_runtime_resume_and_get() Date: Sat, 24 Apr 2021 08:44:24 +0200 Message-Id: X-Mailer: git-send-email 2.30.2 In-Reply-To: References: MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210423_234535_048130_E85E63FB X-CRM114-Status: GOOD ( 10.47 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Commit dd8088d5a896 ("PM: runtime: Add pm_runtime_resume_and_get to deal with usage counter") added pm_runtime_resume_and_get() in order to automatically handle dev->power.usage_count decrement on errors. Use the new API, in order to cleanup the error check logic. Signed-off-by: Mauro Carvalho Chehab Acked-by: Rui Miguel Silva --- drivers/staging/media/imx/imx7-mipi-csis.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/staging/media/imx/imx7-mipi-csis.c b/drivers/staging/media/imx/imx7-mipi-csis.c index 025fdc488bd6..1dc680d94a46 100644 --- a/drivers/staging/media/imx/imx7-mipi-csis.c +++ b/drivers/staging/media/imx/imx7-mipi-csis.c @@ -695,11 +695,10 @@ static int mipi_csis_s_stream(struct v4l2_subdev *mipi_sd, int enable) mipi_csis_clear_counters(state); - ret = pm_runtime_get_sync(&state->pdev->dev); - if (ret < 0) { - pm_runtime_put_noidle(&state->pdev->dev); + ret = pm_runtime_resume_and_get(&state->pdev->dev); + if (ret < 0) return ret; - } + ret = v4l2_subdev_call(state->src_sd, core, s_power, 1); if (ret < 0 && ret != -ENOIOCTLCMD) goto done;