Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp3061832pxy; Sun, 25 Apr 2021 12:37:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyOFC6Xoj57LdJNpz7RwnAI8k/ZpnUe5ZSFe/PABiWwrwpFBZGgIA/mZH2uoCjT5+TJIFG/ X-Received: by 2002:a63:df56:: with SMTP id h22mr13934876pgj.84.1619379456743; Sun, 25 Apr 2021 12:37:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619379456; cv=none; d=google.com; s=arc-20160816; b=wfPrqHEitM7D7rzwvVbTnwCNmAm/f/JMweB4c27ti0mNL3zhOun2Mvw88P0b/iTT5d VYW99lIjRERow3bhMZYE+ghjJ6uDHbgWWjov1TFOrmezKzbq7pfM5Objg2Zta69THvaC /uiQdtvqeFJ3VYmfTLu992+MdToTGZFYX4j/BXK8lgXuiMEdad0fMfBSyDNCWA1N7zMi fkPokom7foeedXoS7iibVRExyTCRJ9hFvowwkqR14CclsF4jQ0GgDLFXYOa2XYBvTRnu P2+kGF1cuY4H9tjApE2OFy6fJldeC5yWSAblEgEpe/epvkE6W0GMbQynruWE6pYrta4q Uqcw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=keUeofMVMpdbqkndtdo2MM5fFkfvLZ9iB4iuwudE2gc=; b=QKqUkOfuVeeV1vGHtupfml0twTSYmpvSDH6iZMAE7MdG/VhGKSUTOFTdtje93d/0+M G4YJhnaPB2JJUB/CpTQoHZz/CfgM/P4o+0II4PhtNmwVQxaAxFQs6STddyBYLsO3ARFX JiVlSKr4KVqOmdJkAJqYXTW7zoHCm4r/I+g7KbhDSlqZ5x5jxje5BxfaNxMo3oE0WQa+ iZwyPuR9JNZuJrxzI1toixz7QYApwgy5ngEyK/ytEQSE9JAx+cDrd2fFQq28QfmsghDy K+Ar6a2znfwRunOaB3UvwJ1p91qFPKmimUeMlNI/BU2GJtl0ZcbbC4AGpIC6O9vzM/lT n6NA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="K/TPQ+pu"; 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 f7si19016105pgk.522.2021.04.25.12.37.24; Sun, 25 Apr 2021 12:37:36 -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=pass header.i=@kernel.org header.s=k20201202 header.b="K/TPQ+pu"; 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 S231241AbhDYTha (ORCPT + 99 others); Sun, 25 Apr 2021 15:37:30 -0400 Received: from mail.kernel.org ([198.145.29.99]:57652 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230494AbhDYTh3 (ORCPT ); Sun, 25 Apr 2021 15:37:29 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 6DE6D6115C; Sun, 25 Apr 2021 19:36:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1619379408; bh=ZTvkB5rpoSHuROmi1/t8X2IfN8+PT9jVHAjIgyd+yvc=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=K/TPQ+pu5oKIiPLhY7i0PgolmO+F20176UyTTTpuMtYIAqV6UnK+uhasctEMkbFA2 hIW/g0s7Fp0q24TldhlylRL0Q79OpNwbkm1ZlmslLQ8bG+EEUAFieGuMWIOWJQ5ufq AXBUX4AUxOK1+anKCXnh1jZLYQdNHJknVNR58pvQktWd4Mt+U19D009mZjh+k2C9da GwjiF+fgOp7OtIzqJW/wBYzdpXVWd8bv0BotUTjcF2AoTdBOVdn5ssYZklaMWTMOLN 2vqNW26Fc0URvqCUqqwIAPu+RWcvg50LMLg+U+gn44WvDAhDwZZiBpSt50XIVDhRZJ N/MUkYQ17brcw== Subject: Re: [PATCH 72/78] media: s3c-camif: use pm_runtime_resume_and_get() To: Mauro Carvalho Chehab Cc: linuxarm@huawei.com, mauro.chehab@huawei.com, Mauro Carvalho Chehab , linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-samsung-soc@vger.kernel.org References: <3cfe70dad65dc078a656458cb55087a5269e9cc3.1619191723.git.mchehab+huawei@kernel.org> From: Sylwester Nawrocki Message-ID: Date: Sun, 25 Apr 2021 21:36:45 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 In-Reply-To: <3cfe70dad65dc078a656458cb55087a5269e9cc3.1619191723.git.mchehab+huawei@kernel.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Mauro, On 24.04.2021 08:45, Mauro Carvalho Chehab wrote: > 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/s3c-camif/camif-capture.c | 5 ++--- > drivers/media/platform/s3c-camif/camif-core.c | 5 +++-- > 2 files changed, 5 insertions(+), 5 deletions(-) > > diff --git a/drivers/media/platform/s3c-camif/camif-capture.c b/drivers/media/platform/s3c-camif/camif-capture.c > index 9ca49af29542..01fa08065ebc 100644 > --- a/drivers/media/platform/s3c-camif/camif-capture.c > +++ b/drivers/media/platform/s3c-camif/camif-capture.c > @@ -547,16 +547,15 @@ static int s3c_camif_open(struct file *file) > if (ret < 0) > goto unlock; > > - ret = pm_runtime_get_sync(camif->dev); > + ret = pm_runtime_resume_and_get(camif->dev); > if (ret < 0) > - goto err_pm; > + goto unlock; I think we don't need that label change, fh still needs to be released in case of an error. > ret = sensor_set_power(camif, 1); > if (!ret) > goto unlock; > > pm_runtime_put(camif->dev); > -err_pm: > v4l2_fh_release(file); > unlock: > mutex_unlock(&camif->lock); -- Regards, Sylwester