Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp1944504pxy; Fri, 23 Apr 2021 23:53:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxiKxHdjEW0ZLnWFNFfMK4l0vEAYG6UyEetrQcwy04oShgYRosaW1cQ7sb6hP3n9akJHYqA X-Received: by 2002:a17:906:11ce:: with SMTP id o14mr7819651eja.113.1619247214543; Fri, 23 Apr 2021 23:53:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619247214; cv=none; d=google.com; s=arc-20160816; b=Fnj7jqy0svRjqHV7X+y9nEtTMM/gXY3XUjpQZsXqo5BvdUUY8Yx8uhjFAuia/zTPWC YfkUXbhfbBErkMB7bpooA0vWlKOcSuKwJuUlNb/RHDB/abU9KERU0oH85DUrfBtPw1uQ xkIKQFO8fTXs1XGS2ZRFmtsYzoGoL6gIPtG8xtxz7s0pmz5OI5jWlJhrtD22woMQ+0yt Tf/2Esmlxf2iK2dBvu2dTtF1UfpUKnZ9wDxE+rS4rgjCWB+YcTuyJ2c8CAYRzo4tUHTn 5bqPXR4GshHLGcaoLsuIUTA0fvrmgczvCMBY66iVJqfnMW0C0CZ/jv56xV3V/pprzCRG /vxw== 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=YpAiC3VoZrOyX8YKDbWUeTgNv6/dnRzOTrP9Km56pVI=; b=ndTrmnlelDxRxCR04Te3jFifKXOOZwf3IExBFg/urAU/ZW25Fzba6SM4b++tnM5Xqa UP7CrCgpuCZUWAEsAkK61bSq0DIx9v+j2Yo+rXLoL/dZPz90A1OLkzXz9bKmD5EsE2js 0rTAipEtfzAB/KX9/Rcrt4aBVJzuGPxCbozuM/G0qeOgiwy320CtaSbYIC5Unnr5BhuG lePZblct4QzhtnZJlf62arV0JRKWIUZwOV+aTC8nHgJSQAOiezMp900UGVQDrzErYfJF tNaw9Iv3ZkfyMvXkVdeF3FPE7MHqmSgxllxexo4pAoRZgjc/BHeWX6xcwCDEckDEkkXf Og3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@kernel.org header.s=k20201202 header.b="u/m+jloo"; 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 z2si362361eju.563.2021.04.23.23.53.10; Fri, 23 Apr 2021 23:53:34 -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="u/m+jloo"; 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 S233620AbhDXGvZ (ORCPT + 99 others); Sat, 24 Apr 2021 02:51:25 -0400 Received: from mail.kernel.org ([198.145.29.99]:36102 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233650AbhDXGqU (ORCPT ); Sat, 24 Apr 2021 02:46:20 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id C2A3461935; 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=1619246733; bh=M+G2FGvpxz8oVs70Hd7XJ+D2QZDVSmESzfk8hhosPRM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=u/m+jloocRIKaKXTIgPc9naK2wgNlylQii+wt63IJvs2m41jbRSr1vBQ159paMdyi 3f19mvyEKypML0z13ve4HnLa26SkAEMDsbbehr7x7r2FgKVM6nodaY/PnkqzFdsIGQ UcQj85r5nrN6G2zM/5VNRd2yEWXD3ctWfcDK/8nCRHCQF+T9DHglRp/RhGOTeuR9LB KRHT1tuviUoKxzfQCCQY2SKlH9GjH6T4NXsS+DUExfK0i3XOwWVEUFVtbut5mCD1wE SX4eWOe4M9pgdHFuczEnqtXwb/xvVqECND+d+w4RQg/3gpzBR3WJhWKf51vLdpxQEp 15jHegZcsIlZA== Received: by mail.kernel.org with local (Exim 4.94) (envelope-from ) id 1laC2l-004JfV-Uo; Sat, 24 Apr 2021 08:45:31 +0200 From: Mauro Carvalho Chehab Cc: linuxarm@huawei.com, mauro.chehab@huawei.com, Mauro Carvalho Chehab , Mauro Carvalho Chehab , Tianshu Qiu , linux-kernel@vger.kernel.org, linux-media@vger.kernel.org Subject: [PATCH 37/78] media: i2c: imx355: use pm_runtime_resume_and_get() Date: Sat, 24 Apr 2021 08:44:47 +0200 Message-Id: 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/i2c/imx355.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/i2c/imx355.c b/drivers/media/i2c/imx355.c index ccedcd4c520a..93f13a04439a 100644 --- a/drivers/media/i2c/imx355.c +++ b/drivers/media/i2c/imx355.c @@ -1442,11 +1442,9 @@ static int imx355_set_stream(struct v4l2_subdev *sd, int enable) } if (enable) { - 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 err_unlock; - } /* * Apply default & customized values -- 2.30.2