Message ID | 8c9d978dfc49ea2de6a1b6cf5b3a9d647e6b1cbf.1619518193.git.mchehab+huawei@kernel.org (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <SRS0=97xB=JY=lists.infradead.org=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@kernel.org> 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.2 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,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 DA64FC433B4 for <linux-arm-kernel@archiver.kernel.org>; Tue, 27 Apr 2021 10:22:33 +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 6F73B611ED for <linux-arm-kernel@archiver.kernel.org>; Tue, 27 Apr 2021 10:22:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6F73B611ED 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=NwuvZd28guh4FpuDkWUsLNNRYC6NoXcINwhq0Wabdhc=; b=k6EmvsejIT3ry9CaBaCYO4SJb bNrI8zw8I7iHWSX4VWU9PGvGahTYug7WlsfxWa89psD7ssfvTnjUqp7X8WFkLZonhdMshdqbW1BbW dm1iskVz+GsXBLjhc08ezqCC7c1Mh2l8xVNVvG+A8VTVsSVSfP1Nj0D2BKRXRCc5VTqIvtYahfSh+ j95e3BVNKEQjzCzkoFtCMjmPJx85+trhKrKFAk0dvl7sm8byum39P23jYokp8phuUv85haS+9VXJD Hp5PLz8mbsuVzQUauhJ6oJzJ9XpHe9cmYA2toAiLFxPSwSdC6ybjR2P32kvS8WGkZbXNZ0PRZ4C1X Dctk2+iDA==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lbKos-001LCC-NJ; Tue, 27 Apr 2021 10:19:55 +0000 Received: from mail.kernel.org ([198.145.29.99]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lbKjF-001JBu-5r for linux-arm-kernel@lists.infradead.org; Tue, 27 Apr 2021 10:14:14 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id EF8AD613DB; Tue, 27 Apr 2021 10:13:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1619518434; bh=Q1WsziPcbnwAb2cpqQFZbO8zttZnZQq1oIpn6yJZI+I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eOxoBc6fX8LQ3nxyOd0t2RIx/rdGgjYfc5pU2Uogwl6kdtZa9v7rIkXdJ8X2UMoUR 9xe3yaHftnVjn2wEnD7orANu+Te1STBrC6bv+8Cri6rd2+yG0ELK1JCNedgn8KmRl/ F6UNsw4VGQWvXFr75BgLHPB8fxn5YaGoLwOE1Ta0gsE6V9AqQoK0M9AUkI/u0DHXI5 2LS85OiasiI5qkpnIKKnPiEpWc0LR/AiQCSw9kdGTI1Ss5uPanq6LQx+G58VlLgL1U PNq8KwYSg7mrpWYTzWyazSwmh+bfQIV2VqDmKo1wXajK+FzJ1eH0fFxJnjhyaInjhj dPoD7fly50gVQ== Received: by mail.kernel.org with local (Exim 4.94) (envelope-from <mchehab@kernel.org>) id 1lbKj2-000j8D-5T; Tue, 27 Apr 2021 12:13:52 +0200 From: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> To: Cc: linuxarm@huawei.com, mauro.chehab@huawei.com, Mauro Carvalho Chehab <mchehab+huawei@kernel.org>, Chen-Yu Tsai <wens@csie.org>, Jernej Skrabec <jernej.skrabec@siol.net>, Mauro Carvalho Chehab <mchehab@kernel.org>, Maxime Ripard <mripard@kernel.org>, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org Subject: [PATCH v2 75/79] media: sunxi: use pm_runtime_resume_and_get() Date: Tue, 27 Apr 2021 12:13:42 +0200 Message-Id: <8c9d978dfc49ea2de6a1b6cf5b3a9d647e6b1cbf.1619518193.git.mchehab+huawei@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <cover.1619518193.git.mchehab+huawei@kernel.org> References: <cover.1619518193.git.mchehab+huawei@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210427_111408_779476_08F4C92B X-CRM114-Status: GOOD ( 10.94 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: <linux-arm-kernel.lists.infradead.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/linux-arm-kernel/> List-Post: <mailto:linux-arm-kernel@lists.infradead.org> List-Help: <mailto:linux-arm-kernel-request@lists.infradead.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org> Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org |
Series |
None
|
expand
|
diff --git a/drivers/media/platform/sunxi/sun4i-csi/sun4i_v4l2.c b/drivers/media/platform/sunxi/sun4i-csi/sun4i_v4l2.c index 4785faddf630..54b909987caa 100644 --- a/drivers/media/platform/sunxi/sun4i-csi/sun4i_v4l2.c +++ b/drivers/media/platform/sunxi/sun4i-csi/sun4i_v4l2.c @@ -206,9 +206,9 @@ static int sun4i_csi_open(struct file *file) if (ret) return ret; - ret = pm_runtime_get_sync(csi->dev); + ret = pm_runtime_resume_and_get(csi->dev); if (ret < 0) - goto err_pm_put; + goto err_unlock; ret = v4l2_pipeline_pm_get(&csi->vdev.entity); if (ret) @@ -227,6 +227,8 @@ static int sun4i_csi_open(struct file *file) err_pm_put: pm_runtime_put(csi->dev); + +err_unlock: mutex_unlock(&csi->lock); return ret;
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 <mchehab+huawei@kernel.org> --- drivers/media/platform/sunxi/sun4i-csi/sun4i_v4l2.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)