Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp621255pxy; Wed, 28 Apr 2021 10:38:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzvwMsTwKBY1CN/qAS0irkSNoThR8GQbA/K8JrW2KuUWAmXjq68XNLm0dOx4WR8dgsctoi1 X-Received: by 2002:a17:906:b19a:: with SMTP id w26mr4061010ejy.194.1619631482512; Wed, 28 Apr 2021 10:38:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619631482; cv=none; d=google.com; s=arc-20160816; b=W3dVJvlJVivBybNd+O/NLiHfGFe/hk+hEC5b3rLYyMXL14KoVuTWVr9Wkz+oNt8gt6 R2AVIWxDDLIf8eBtkjd+u5bjed/oiiqSZ1+TvReplmQexUvv74YgsjfVWlOouZCLQVFg ejpho4KoJca8ujbNqj82QF4SM9rLME0RmSI/K7EeW+22okAqtDEwpsFnoU5EHeraVtvJ 10upS2M0plScpHnLzD9MsJln+6eZ2o/8R3Zblyj6jyg/EclTqY6hJKb97BZmH9mtCnNM gwmmyiCYCmsxeh9U4fdV5QdQmlPbg0t/VuXdBV4WbG9ODKmN7Yv+OAiU/N4JIld38tlP ZZug== 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=PD6DG6VZVaotaBLhBWsDt9p4T7qsx5FB+3z2MjCLIls=; b=wqtYJU57VJ6jJM8imwUj04Kj3BHsiBw/Jf6WTknSi4D0Mek9PKy+5+GaMJ+eZx/0Hy bMuDFat+VLYdszKg4HOe6LvSSWQlybLf/tkLv3bVPPleK4yc4n1mbIEDab8kMWlVv4tZ cUU1tiSt5n4rmi2/5ZK0y4j40D9ygB+Th4Lhc2RiC+ks4LYEcT75j9+8jB36EXlKWQ/1 eOAH5C32xVZ+GCAf/9MDlW+lw7TPDHWyH5tmbs2y+qyLRwQDD1Vq5MldQUzpxHXHDVP3 2pqh8MUW52sD/Yz2tbuOnylSBCzDT4t476pp2liVB8mDTygx0lms6MSwh18EltPSW94G 73gg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@kernel.org header.s=k20201202 header.b=ZkIGnpy5; 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 bz20si607444ejc.706.2021.04.28.10.37.37; Wed, 28 Apr 2021 10:38:02 -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=ZkIGnpy5; 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 S239641AbhD1O6I (ORCPT + 99 others); Wed, 28 Apr 2021 10:58:08 -0400 Received: from mail.kernel.org ([198.145.29.99]:36930 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240436AbhD1Ox4 (ORCPT ); Wed, 28 Apr 2021 10:53:56 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id F13896195D; Wed, 28 Apr 2021 14:52:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1619621565; bh=k96A/wu5csXQdkebmEvDXUWzQhtBwXxGUFyh7/8ot0s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZkIGnpy5sAMljMt9rKvtwT7hx2n6ZPobSF7j9e9bBLT5aEbuJ8N0caeC9O4hyIFQG B2aMPlI7bTD94cgLwIZF/KhqvCSBnMcQKZ2n/yyFbAMIOzLB2SJOxigGQvs2igY1Y8 +W5QVG7A8/+JcPsFGmFbhKDV0M2VkBkjuclXmrOajT/+B3dbWNs3qKfsICEhxSStJF ljBlxsm3V2kEXDhQi096u1VdcudEHWLq+C1wZ7ESdTH73dfMXzM8HXooqoUkue3cYt gi1b8d4MwbDjIg0RUhfDe5moQw3DN5s08F6fsOxADpaxBE0rdaZtn0Hf3a1yz3Bpga vXlc+LaR4dPDg== Received: by mail.kernel.org with local (Exim 4.94) (envelope-from ) id 1lblYQ-001Dru-V7; Wed, 28 Apr 2021 16:52:42 +0200 From: Mauro Carvalho Chehab Cc: linuxarm@huawei.com, mauro.chehab@huawei.com, Mauro Carvalho Chehab , Chiranjeevi Rapolu , Hyungwoo Yang , Mauro Carvalho Chehab , linux-kernel@vger.kernel.org, linux-media@vger.kernel.org Subject: [PATCH v4 48/79] media: i2c: ov5670: use pm_runtime_resume_and_get() Date: Wed, 28 Apr 2021 16:52:09 +0200 Message-Id: <50486e1f4ff4daf24d2a43f641791f0900285811.1619621413.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/media/i2c/ov5670.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/i2c/ov5670.c b/drivers/media/i2c/ov5670.c index dee7df8dd100..182f271f118f 100644 --- a/drivers/media/i2c/ov5670.c +++ b/drivers/media/i2c/ov5670.c @@ -2347,11 +2347,9 @@ static int ov5670_set_stream(struct v4l2_subdev *sd, int enable) goto unlock_and_return; 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 unlock_and_return; - } ret = ov5670_start_streaming(ov5670); if (ret) -- 2.30.2