Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp1944270pxy; Fri, 23 Apr 2021 23:52:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzi92cqu63AXy9oGbOz9PrW3igsmi/OulnOsebBXdLh8mTFk2Q8dQZre42+iwwImEeRu7BM X-Received: by 2002:a17:90b:344d:: with SMTP id lj13mr9757769pjb.44.1619247176697; Fri, 23 Apr 2021 23:52:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619247176; cv=none; d=google.com; s=arc-20160816; b=yf+uV4/BYAEWgUUBnyba9u5Z+dm9xmFcBTBEAzgILQglafBdSs2LeOP3cvybI9P+wo Q+sllN5zTFY52WEWZ1zuamyoysD3wfLicLH6SGGj1vty8qwqyYViYOALbIFrn9A/Lg+i nQYsuv8l+XeZUMDyO/Ds5lJGSY5u4McDoAf1kDG+twh1xE5on3CbklX637LdI4x62ySX DKSRK63lR3xIkHRNGlJKh8cRwGbBndh4eXDD53bfxLI9RrXMlAgcpaw/5bF5GInjF2MG p4xeN15HI683Osqt758Vd2gxlHy1Itg8ObwqhkVrG4mRedCG6AecoRuY/H5aszxjz6h5 RbDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:from :dkim-signature; bh=moe1/9thFZyZMmcEGO7VQ1OgwUo3HaCb7+A5D0hpp+M=; b=0iJ2N3DW1inwpFAyXeY5XmQP2Ibxy2gLqkiJ46C/d3VkS4W6xMFsx5qSHH7WqnpGve kO71Fk6IDlT1bhqoe1UxmhbA+oyoEh9Dda9JiWWv5USVmtJii5jPI+nobPSK/1OrHt7x y0bYRMuVmGsA0xd6T6DHZOpQ+2sT2x41/gNMgX6uwyzfoyZYRAc7y/tjVN/0tRyCoaMD uhppv8BuaZGlzm0srG45RQhQBia9ZQWNHawBrnoUTzSyoXZg40xkPBcuS+aRiIH9RLtD mYDYJJkmYMwUo5OaxP559GLn04cC0YovSujbtfMgsABT0wIPQHwA0ZHY0oDM32DkuodL dNvQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@kernel.org header.s=k20201202 header.b=QGVXq0zE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i2si1197798plt.306.2021.04.23.23.52.45; Fri, 23 Apr 2021 23:52:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@kernel.org header.s=k20201202 header.b=QGVXq0zE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244270AbhDXGwt (ORCPT + 99 others); Sat, 24 Apr 2021 02:52:49 -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) 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== Received: by mail.kernel.org with local (Exim 4.94) (envelope-from ) id 1laC2n-004Ji2-EV; Sat, 24 Apr 2021 08:45:33 +0200 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: 8bit Sender: Mauro Carvalho Chehab To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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 --- 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; - 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) @@ -225,8 +225,7 @@ static int sun4i_csi_open(struct file *file) err_pipeline_pm_put: v4l2_pipeline_pm_put(&csi->vdev.entity); -err_pm_put: - pm_runtime_put(csi->dev); +err_unlock: mutex_unlock(&csi->lock); return ret; -- 2.30.2