Received: by 2002:a05:6a10:a852:0:0:0:0 with SMTP id d18csp554908pxy; Fri, 30 Apr 2021 10:54:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw3h1IE0luQr1SWVbCR/zPZAczJwasfw6bt89yG+8gfiS7Twb2sJC2SEalPQYQl8t/JKzS4 X-Received: by 2002:a17:90a:f684:: with SMTP id cl4mr6779417pjb.139.1619805269050; Fri, 30 Apr 2021 10:54:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619805269; cv=none; d=google.com; s=arc-20160816; b=zAIbHkjp6q/GEuGhg0rE1+JKZfuOliX72R9Y4N4kwZMHYlGqePvXFTQAqsbf2lkK4S oai3egD0N+bWB59PoVeDQVK/rJDI6ckdKu0/ArsVa40DounW/seLjqQVilW0eqhHddgW wjKvw6TI0Omrq7xzvQrNHJT4hQ1D89NAgTLhJ2Ztdfvwy6w4NqYlSZm5jfl0ZNSlIeMz qf+z8d0F2ryHScps+ZEg0uEhTCs1kdexP2+f+X9Xqr9m5OrYbQT3IiZLQllRHWlT/xwX y8wajgRrRyNEV/kq8Sj+px9wTcLwXiNDA6fBGOLp8q72m9j9ESkVE858udMqDOqgqWsQ 3ieA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date; bh=miE6pFJxG/ySIYlt3Tvyk0CH2vIS0kcG4eeQ3QCmraQ=; b=QNIWYuuGcrKd+Oy35X2j9+NyhnAPYcMIUvwmK19vfzTnm/V9+/9gUCgo5aSDkjO6EU 9TDWysXMHgMWltbxClMletnDpGrFGrMApRmD23N/pGu+a2c6Qg7GzSLtk9+wxiEycoI8 w7CdYMzeRAVJgkq+YBp7FkMqkfnPDmck/LhSoimzl49muAv/xJwSoFBD7AYi2Tk5ZXqG sxeQvT8a78r9gq5IfOufrBKGRo4lf88QvP29jIMgx4jrrUL9y6ZDTHa1+ZHHjVN/sGub pH3wVi5IInIeR3YJTX0gwgOLDjtiPVFcLmpAdIv4oeJ25C1F60EeN+82T0l3Mo6enmrC m8RQ== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s14si4110899plp.337.2021.04.30.10.54.15; Fri, 30 Apr 2021 10:54:29 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231559AbhD3Rw1 (ORCPT + 99 others); Fri, 30 Apr 2021 13:52:27 -0400 Received: from frasgout.his.huawei.com ([185.176.79.56]:2976 "EHLO frasgout.his.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230229AbhD3Rw0 (ORCPT ); Fri, 30 Apr 2021 13:52:26 -0400 Received: from fraeml715-chm.china.huawei.com (unknown [172.18.147.201]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4FX05f3ND9z6896y; Sat, 1 May 2021 01:40:54 +0800 (CST) Received: from lhreml710-chm.china.huawei.com (10.201.108.61) by fraeml715-chm.china.huawei.com (10.206.15.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Fri, 30 Apr 2021 19:51:36 +0200 Received: from localhost (10.52.125.96) by lhreml710-chm.china.huawei.com (10.201.108.61) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Fri, 30 Apr 2021 18:51:35 +0100 Date: Fri, 30 Apr 2021 18:50:01 +0100 From: Jonathan Cameron To: Mauro Carvalho Chehab CC: , , Ezequiel Garcia , Hans Verkuil , "Krzysztof Kozlowski" , Mauro Carvalho Chehab , Sylwester Nawrocki , , , , Subject: Re: [PATCH v4 63/79] media: exynos-gsc: use pm_runtime_resume_and_get() Message-ID: <20210430185001.00005e76@Huawei.com> In-Reply-To: <31bdadf2f59e86c6a315ec390b44c6c681af6647.1619621413.git.mchehab+huawei@kernel.org> References: <31bdadf2f59e86c6a315ec390b44c6c681af6647.1619621413.git.mchehab+huawei@kernel.org> Organization: Huawei Technologies Research and Development (UK) Ltd. X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; i686-w64-mingw32) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.52.125.96] X-ClientProxiedBy: lhreml721-chm.china.huawei.com (10.201.108.72) To lhreml710-chm.china.huawei.com (10.201.108.61) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 28 Apr 2021 16:52:24 +0200 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. > > Reviewed-by: Sylwester Nawrocki > Signed-off-by: Mauro Carvalho Chehab > --- > drivers/media/platform/exynos-gsc/gsc-m2m.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/media/platform/exynos-gsc/gsc-m2m.c b/drivers/media/platform/exynos-gsc/gsc-m2m.c > index 27a3c92c73bc..09551e96ac15 100644 > --- a/drivers/media/platform/exynos-gsc/gsc-m2m.c > +++ b/drivers/media/platform/exynos-gsc/gsc-m2m.c > @@ -58,7 +58,7 @@ static int gsc_m2m_start_streaming(struct vb2_queue *q, unsigned int count) > struct gsc_ctx *ctx = q->drv_priv; > int ret; > > - ret = pm_runtime_get_sync(&ctx->gsc_dev->pdev->dev); > + ret = pm_runtime_resume_and_get(&ctx->gsc_dev->pdev->dev); > return ret > 0 ? 0 : ret; return pm_runtime_resume_and_get() as static inline int pm_runtime_resume_and_get(struct device *dev) { int ret; ret = __pm_runtime_resume(dev, RPM_GET_PUT); if (ret < 0) { pm_runtime_put_noidle(dev); return ret; } return 0; } Can't return >= 0 > } >