From mboxrd@z Thu Jan 1 00:00:00 1970 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=-16.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable 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 B46D0C433ED for ; Sat, 24 Apr 2021 06:47:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 975FF6120D for ; Sat, 24 Apr 2021 06:47:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244158AbhDXGrq (ORCPT ); Sat, 24 Apr 2021 02:47:46 -0400 Received: from mail.kernel.org ([198.145.29.99]:35724 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232629AbhDXGqN (ORCPT ); Sat, 24 Apr 2021 02:46:13 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 2EDC2615FF; Sat, 24 Apr 2021 06:45:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1619246733; bh=ZOYDC8nizVOemN97ng0w67F2uxMXkIsqLhOdGgCw1ys=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sTEjoHB3r/sXo/uR7szBpdIiq8ULorEh9R69vi7fLX3rhi4KotL2r47F2klki9S4U D418OSL/Yf7DEj2+vNrwYDRnDDt98IUSu5H/+AMLf7Pa86jiJGS9S4jhV2RhATOJif eaHK08sBwQjvKYtmcdr/l97QmAnnGDqadhdmbZuRzQxaN6WGMmnBu4zw3U2kT2k7fe CTfyoYnnTkqwaCWtgNLmlAQdOM3aJWHH8aNlEqkaRfVU0VoHMmoIFcvhgX5PCtQ+vD JG4sjZPTOTBaPdYhjhmFbihDQuoedpJoSxfZrnUKvb5Nab+LsQghU0MI/opYI+c3LW lVN6csL/o+BfQ== Received: by mail.kernel.org with local (Exim 4.94) (envelope-from ) id 1laC2l-004JeI-79; Sat, 24 Apr 2021 08:45:31 +0200 From: Mauro Carvalho Chehab Cc: linuxarm@huawei.com, mauro.chehab@huawei.com, Mauro Carvalho Chehab , Greg Kroah-Hartman , Mauro Carvalho Chehab , Sakari Ailus , devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org Subject: [PATCH 12/78] staging: media: atomisp_fops: use pm_runtime_resume_and_get() Date: Sat, 24 Apr 2021 08:44:22 +0200 Message-Id: <7685b0dbded30b1243e0e708955b1a55c7830306.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/staging/media/atomisp/pci/atomisp_fops.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/media/atomisp/pci/atomisp_fops.c b/drivers/staging/media/atomisp/pci/atomisp_fops.c index f1e6b2597853..26d05474a035 100644 --- a/drivers/staging/media/atomisp/pci/atomisp_fops.c +++ b/drivers/staging/media/atomisp/pci/atomisp_fops.c @@ -837,7 +837,7 @@ static int atomisp_open(struct file *file) } /* runtime power management, turn on ISP */ - ret = pm_runtime_get_sync(vdev->v4l2_dev->dev); + ret = pm_runtime_resume_and_get(vdev->v4l2_dev->dev); if (ret < 0) { dev_err(isp->dev, "Failed to power on device\n"); goto error; @@ -881,9 +881,9 @@ static int atomisp_open(struct file *file) css_error: atomisp_css_uninit(isp); -error: - hmm_pool_unregister(HMM_POOL_TYPE_DYNAMIC); pm_runtime_put(vdev->v4l2_dev->dev); +error: + hmm_pool_unregister(HMM_POOL_TYPE_DYNAMIC); rt_mutex_unlock(&isp->mutex); return ret; } -- 2.30.2 From mboxrd@z Thu Jan 1 00:00:00 1970 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=-16.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,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 6FFEEC433B4 for ; Sat, 24 Apr 2021 06:46:34 +0000 (UTC) Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (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 2B6FF6120D for ; Sat, 24 Apr 2021 06:46:34 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2B6FF6120D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=driverdev-devel-bounces@linuxdriverproject.org Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 0249940132; Sat, 24 Apr 2021 06:46:34 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id JmVZZptSeDwO; Sat, 24 Apr 2021 06:46:33 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp2.osuosl.org (Postfix) with ESMTP id 0915B40133; Sat, 24 Apr 2021 06:46:32 +0000 (UTC) Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 2BC941BF39E for ; Sat, 24 Apr 2021 06:45:38 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 8EE4F4184E for ; Sat, 24 Apr 2021 06:45:35 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Authentication-Results: smtp4.osuosl.org (amavisd-new); dkim=pass (2048-bit key) header.d=kernel.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id kJMuW5497own for ; Sat, 24 Apr 2021 06:45:34 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp4.osuosl.org (Postfix) with ESMTPS id D9F5041852 for ; Sat, 24 Apr 2021 06:45:34 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id 2EDC2615FF; Sat, 24 Apr 2021 06:45:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1619246733; bh=ZOYDC8nizVOemN97ng0w67F2uxMXkIsqLhOdGgCw1ys=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sTEjoHB3r/sXo/uR7szBpdIiq8ULorEh9R69vi7fLX3rhi4KotL2r47F2klki9S4U D418OSL/Yf7DEj2+vNrwYDRnDDt98IUSu5H/+AMLf7Pa86jiJGS9S4jhV2RhATOJif eaHK08sBwQjvKYtmcdr/l97QmAnnGDqadhdmbZuRzQxaN6WGMmnBu4zw3U2kT2k7fe CTfyoYnnTkqwaCWtgNLmlAQdOM3aJWHH8aNlEqkaRfVU0VoHMmoIFcvhgX5PCtQ+vD JG4sjZPTOTBaPdYhjhmFbihDQuoedpJoSxfZrnUKvb5Nab+LsQghU0MI/opYI+c3LW lVN6csL/o+BfQ== Received: by mail.kernel.org with local (Exim 4.94) (envelope-from ) id 1laC2l-004JeI-79; Sat, 24 Apr 2021 08:45:31 +0200 From: Mauro Carvalho Chehab To: Subject: [PATCH 12/78] staging: media: atomisp_fops: use pm_runtime_resume_and_get() Date: Sat, 24 Apr 2021 08:44:22 +0200 Message-Id: <7685b0dbded30b1243e0e708955b1a55c7830306.1619191723.git.mchehab+huawei@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: References: MIME-Version: 1.0 X-BeenThere: driverdev-devel@linuxdriverproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux Driver Project Developer List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devel@driverdev.osuosl.org, Mauro Carvalho Chehab , Greg Kroah-Hartman , linuxarm@huawei.com, linux-kernel@vger.kernel.org, Sakari Ailus , mauro.chehab@huawei.com, Mauro Carvalho Chehab , linux-media@vger.kernel.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: driverdev-devel-bounces@linuxdriverproject.org Sender: "devel" 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/staging/media/atomisp/pci/atomisp_fops.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/media/atomisp/pci/atomisp_fops.c b/drivers/staging/media/atomisp/pci/atomisp_fops.c index f1e6b2597853..26d05474a035 100644 --- a/drivers/staging/media/atomisp/pci/atomisp_fops.c +++ b/drivers/staging/media/atomisp/pci/atomisp_fops.c @@ -837,7 +837,7 @@ static int atomisp_open(struct file *file) } /* runtime power management, turn on ISP */ - ret = pm_runtime_get_sync(vdev->v4l2_dev->dev); + ret = pm_runtime_resume_and_get(vdev->v4l2_dev->dev); if (ret < 0) { dev_err(isp->dev, "Failed to power on device\n"); goto error; @@ -881,9 +881,9 @@ static int atomisp_open(struct file *file) css_error: atomisp_css_uninit(isp); -error: - hmm_pool_unregister(HMM_POOL_TYPE_DYNAMIC); pm_runtime_put(vdev->v4l2_dev->dev); +error: + hmm_pool_unregister(HMM_POOL_TYPE_DYNAMIC); rt_mutex_unlock(&isp->mutex); return ret; } -- 2.30.2 _______________________________________________ devel mailing list devel@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel