From nobody Sat May 10 06:00:25 2025 Delivered-To: importer2@patchew.org Received-SPF: pass (zohomail.com: domain of vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; envelope-from=linux-kernel-owner@vger.kernel.org; helo=vger.kernel.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass(p=none dis=none) header.from=kernel.org ARC-Seal: i=1; a=rsa-sha256; t=1619247151; cv=none; d=zohomail.com; s=zohoarc; b=XXtoSJNNUv9hshQc0Mca2bsFhZwumsGC9OKI2xHl4YjhdmDd5nrT96Bp40DEbBZyPEKAoFes/5Rid/jsAMjijLhIXuvSrbgSsDJa0NYjTfhweNiajmHrWUnYCKCntbZdP9DOiIHNHHvnp1Te8ituufJmapeMSGVd3FM68H9UeVU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1619247151; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:MIME-Version:Message-ID:References:Sender:Subject:To; bh=moe1/9thFZyZMmcEGO7VQ1OgwUo3HaCb7+A5D0hpp+M=; b=aY/aztVReKSpL4wgR4SeoaJWbM4Yi1bTN8cAm+hzEN3gtXFAJo0ropAatb7RF+T+ayASvf/PQYLlOfpCLDDJXmjFvqhimZVRP+dYkAeLUOLgUBhPQC6H/7mw4Ii11CiY+vk50YWWktx1k+86NoPVSrykB9A0BY97zD12N0gY5D0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mx.zohomail.com with SMTP id 1619247151390527.4564318689285; Fri, 23 Apr 2021 23:52:31 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237395AbhDXGw7 (ORCPT ); Sat, 24 Apr 2021 02:52:59 -0400 Received: from mail.kernel.org ([198.145.29.99]:35796 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233271AbhDXGqd (ORCPT ); Sat, 24 Apr 2021 02:46:33 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id C56B56193A; Sat, 24 Apr 2021 06:45:33 +0000 (UTC) Received: by mail.kernel.org with local (Exim 4.94) (envelope-from ) id 1laC2n-004Ji2-EV; Sat, 24 Apr 2021 08:45:33 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1619246734; bh=IASdiN+9/AmiaDBWxGxldIhDXuTHq+MikfucyZPKlwo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QGVXq0zEfEkZQuXyLnQNSlYiPuhq9yLF2nh/YSKCwzW17oE6HLAGe321i0gSkurNY +32Ae6lvlNPsCyMDg9bkXmFigFu+mytnPNfTpraZiKpB2fFpzGkpOTNvnp9CNGNdL4 cZyyU/Z+WWKgxmmFXOoafLtxOf6PqkqatrgYcmb1oh+axYc5AGW5WHV3NTCWobgiWY B/Xnx8gEkLknLgmmWJXtrhTkKWcLPVGvtUGxMvccVUVGRsheHeum4a8hyoTxYfRtMK htz7EuxlQWiIVLN2f8QU0V8jFkDjpum5M36HqMLz3JcdjSMO5/0YiwK+W13DsuImFG uBLtwOY2pqeVQ== From: Mauro Carvalho Chehab Cc: linuxarm@huawei.com, mauro.chehab@huawei.com, Mauro Carvalho Chehab , Chen-Yu Tsai , Jernej Skrabec , Mauro Carvalho Chehab , Maxime Ripard , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org Subject: [PATCH 76/78] media: sun4i_v4l2: use pm_runtime_resume_and_get() Date: Sat, 24 Apr 2021 08:45:26 +0200 Message-Id: <19ff6114784154d1ce289b01bd22230a37b77a98.1619191723.git.mchehab+huawei@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: Mauro Carvalho Chehab To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Commit dd8088d5a896 ("PM: runtime: Add pm_runtime_resume_and_get to deal wi= th 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 --- drivers/media/platform/sunxi/sun4i-csi/sun4i_v4l2.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/sunxi/sun4i-csi/sun4i_v4l2.c b/drivers/= media/platform/sunxi/sun4i-csi/sun4i_v4l2.c index 4785faddf630..ed6ec41b9c2d 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; =20 - ret =3D pm_runtime_get_sync(csi->dev); + ret =3D pm_runtime_resume_and_get(csi->dev); if (ret < 0) - goto err_pm_put; + goto err_unlock; =20 ret =3D v4l2_pipeline_pm_get(&csi->vdev.entity); if (ret) @@ -225,8 +225,7 @@ static int sun4i_csi_open(struct file *file) err_pipeline_pm_put: v4l2_pipeline_pm_put(&csi->vdev.entity); =20 -err_pm_put: - pm_runtime_put(csi->dev); +err_unlock: mutex_unlock(&csi->lock); =20 return ret; --=20 2.30.2