Received: by 2002:a05:6a10:a852:0:0:0:0 with SMTP id d18csp2727955pxy; Mon, 3 May 2021 06:47:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxlK9mj8PjyK/1k/ODp8oFeXu1GSFgpW8m6TWnGjBddAgsSvwOp97UCmSym5LBZRQl3AyX3 X-Received: by 2002:a17:906:685:: with SMTP id u5mr16844474ejb.449.1620049679271; Mon, 03 May 2021 06:47:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620049679; cv=none; d=google.com; s=arc-20160816; b=ubbrTjKpbLp7PkWAW3y5Q4T9vYGSauxhGVPNzUmCxPRxHBLanBZZLOqh23zX3YsYI6 P6z6ztRizFWO64h2X53An8AZPNUzvW2YUh23C1uif5teZ0D13lWk1Gf7A1nCnSnQOsWI vIiiCMFaEajoRi1NR1xZCGZNrKrCzjNEy83K+7UD25nYx977DBRO9sq3I8NCAWTKIQBa jxCk8vqWoqV7hD+74HEMO+bZXTCuThqxNhT+VB9DSugncGP+ln4YPfACidk0sEy9BHrp 43ZY8eTplBBSI4bIr+NnoR1NPab/7B1Z20VXHLRHKZWzYaOz5aeE38uP9PexUEdLQT77 HQlA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=an6evm4pvxilSxn0BHsmQe9q8Xi69XxZyMDxgmRiPNQ=; b=uDVMWy8AkcywHwK3TsTEhxTiNpfGe/lbj7cakJfgMT/HYxz0IQ5dftFahh0F+1LuVw LBGU0Jp1MH92vDOOcqOVB+7nSbNJ0ELnIsq72er8omXyNfL8OXMl0JSP9DYK5Z8YYgt4 dzvwkl/uW4ldeqmG6+fY1GqpGV1lY24LaGCRUfpPaby2uMTFO2HVlajSITRUNDMUlpJm AsqCmyo+i0AqMNAFdagXKCMPrKflf7FlswZ4jst+zZuqgjeCTu0btkdBYUzBKESS+tnn 9I9CmstBIkpUHmQxnXe7soBFzyNHG5pTL2dm2GZfmPqncFPEDP3neB31Y26CCjfIYfHb 3gBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Vf5CyRui; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m1si12178173ejj.214.2021.05.03.06.47.32; Mon, 03 May 2021 06:47:59 -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=@gmail.com header.s=20161025 header.b=Vf5CyRui; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233633AbhECMbZ (ORCPT + 99 others); Mon, 3 May 2021 08:31:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51072 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229907AbhECMbX (ORCPT ); Mon, 3 May 2021 08:31:23 -0400 Received: from mail-yb1-xb2e.google.com (mail-yb1-xb2e.google.com [IPv6:2607:f8b0:4864:20::b2e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9AC9BC06174A; Mon, 3 May 2021 05:30:29 -0700 (PDT) Received: by mail-yb1-xb2e.google.com with SMTP id r8so7245434ybb.9; Mon, 03 May 2021 05:30:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=an6evm4pvxilSxn0BHsmQe9q8Xi69XxZyMDxgmRiPNQ=; b=Vf5CyRuiYCL3/Igc9K9MqyA7/cXFENaM3Rqr9kSplUPS+TPEUzXHXZxAlxS+uYXgQb UEFpo3NKvHlyeZCINHjEvCLTmBIYUk9NgXTvbpTUjZZpUeZwgsabxK3IXi9hUPqnBo4g llkBKUpoYUXFm3RPT3uRkce1XbGAANdjAYbor7hIHeaPlNT2xiCoRt4U1fUuiuBUl8V1 qe7N7qeVcUS5C1cfoB7ay+uecZtCYqM0KrTmEcMsgmECZjEfDbadcDbX440gM2q28y5r MD7OzSOGx8FzaB5Edh1npSzK/KE//tTU0KTsCbUTVLHH1BzMgLL07MqJc0FOH/4JhhdY gGYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=an6evm4pvxilSxn0BHsmQe9q8Xi69XxZyMDxgmRiPNQ=; b=ZeRT7JRU7jozCoo6ebvABxXzhZZpdJyNLn1vAEGuqNzbuWhHpm1BrAhcPdaQg0HtAl NlFtlI/l74G1taL1luXpFUp1Q3YVKfw+4F41qw8ltzgz3Jr5qn33t7grz7D0aMG8Fonp RS//vD5yvGzfbX546ui2IAXqRGvMvycq/0yLVIiy6vxF3/sJsXoQNKKtYq3+Yfp8Cd5T eYXsEGELwRllO3SklWFS4YW+9+K+npRuUNjhiBb2bziuZrL6lwLo35sfb7B0YrhEkMjF PUUAQV/84IQ9FWt8ShROs0zIdyLXqRO9E6tdz3pY1gv5b2iFqH8sewSCz+DlKaYzWi01 hu2Q== X-Gm-Message-State: AOAM533726zy/7aFF8ovIxdD/UCBEb17eHRRevZ8t4V7QZvmaBvKiIuJ +zhFMbIzaJJ8At/l28dEwKJL+3fM+P9gIHPppX4= X-Received: by 2002:a25:2702:: with SMTP id n2mr26635261ybn.179.1620045028921; Mon, 03 May 2021 05:30:28 -0700 (PDT) MIME-Version: 1.0 References: <05a26c6f0f7798e9bc7a04845b3e3f32d9fcb659.1619621413.git.mchehab+huawei@kernel.org> In-Reply-To: <05a26c6f0f7798e9bc7a04845b3e3f32d9fcb659.1619621413.git.mchehab+huawei@kernel.org> From: "Lad, Prabhakar" Date: Mon, 3 May 2021 13:30:02 +0100 Message-ID: Subject: Re: [PATCH v4 43/79] media: i2c: ov2659: use pm_runtime_resume_and_get() To: Mauro Carvalho Chehab Cc: linuxarm@huawei.com, mauro.chehab@huawei.com, Mauro Carvalho Chehab , LKML , linux-media Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Mauro, Thank you for the patch. On Wed, Apr 28, 2021 at 3:52 PM 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/i2c/ov2659.c | 6 ++---- > 1 file changed, 2 insertions(+), 4 deletions(-) > Acked-by: Lad Prabhakar Cheers, Prabhakar > diff --git a/drivers/media/i2c/ov2659.c b/drivers/media/i2c/ov2659.c > index 42f64175a6df..a3c8eae68486 100644 > --- a/drivers/media/i2c/ov2659.c > +++ b/drivers/media/i2c/ov2659.c > @@ -1186,11 +1186,9 @@ static int ov2659_s_stream(struct v4l2_subdev *sd, int on) > goto unlock; > } > > - ret = pm_runtime_get_sync(&client->dev); > - if (ret < 0) { > - pm_runtime_put_noidle(&client->dev); > + ret = pm_runtime_resume_and_get(&client->dev); > + if (ret < 0) > goto unlock; > - } > > ret = ov2659_init(sd, 0); > if (!ret) > -- > 2.30.2 >