Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp621390pxy; Wed, 28 Apr 2021 10:38:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyFReer1nSNoO3qFom/YPkHoSW3H7t6kZ0A/uVNGgabu0U6MlfLODB+OUuIWnmxbn0D9lrE X-Received: by 2002:a05:6402:891:: with SMTP id e17mr4109834edy.107.1619631387128; Wed, 28 Apr 2021 10:36:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619631387; cv=none; d=google.com; s=arc-20160816; b=FVqZds6iaILQi6F4i96iIww27k4PkMMP817T+iUgi4GaT6SO6PROrcXX/BRSXLZiiW CJGIv8kkxe7jNWPz7xb/PQnn+TfQOlj32CJWa6ns6OhzD9IC4BwOdkAmgV1HaQOrcZ2J 2O0nypRqW1I312YhS9VqaUsqFbX2sLK60ehyEZFKjayvcKvsATaFZp8r4WE/I/aMZlT+ ESJ0+jBQGkKPYx43FFRoKAj8OZ8LIuznr8ugiEzUZbt9RJpUn9fF3sWG2+Gg6E4x+859 vCOkhsDt8RHBDn15sMOtxBCHnqi3SyU4bpTSOoOrEf1Swuy+5kS8BS2Cj16fZR5Mqkv9 /CSQ== 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=y2oOs6MmQvknIQx2AD2cQVCBb5wEGO20mgwI9foNgCU=; b=d07eq1+KTZyUz2Tf9YxOQIcE8XR+pp5+Id2s/gd+zEIJXd0qHW85SH7Nq4/f3kk3qr BW7K48xI4oJe7WXlYD2PHRjZmRJUhUxvu4G5GXgFi4rLhaHqf9sUS14LbT2pEpqYNbAQ Jm3lxSaGWZbCMs0mMaWufwOUBFdGHGvCZWUkSlKeYbh/YT2FNXgetNe5WkaLT4SNduH9 JeuYDREatjAJBpVVJjLfBkr2X84kH/0W9kvOWJ9yoiXluUbTdZ4gdP2Y/JHpC7Fk/sTS m2IuaYmLR992Kia6SuHENHJ6Eig/TBlQ3zn0X1CoWmcZA8bdkb2fAiZ95qFz/4+N/8dv zCaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@kernel.org header.s=k20201202 header.b=aqyEcOe1; 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 v4si342771edc.411.2021.04.28.10.36.01; Wed, 28 Apr 2021 10:36:27 -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=aqyEcOe1; 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 S239104AbhD1O6Y (ORCPT + 99 others); Wed, 28 Apr 2021 10:58:24 -0400 Received: from mail.kernel.org ([198.145.29.99]:36366 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240461AbhD1OyF (ORCPT ); Wed, 28 Apr 2021 10:54:05 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id EA6A861970; 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=kwIJFx+3BZT7CutnecuzIxhgs2GnXNtjRI6MBhWOcG4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aqyEcOe1373v2IxrEcx0sTniQDH7DHbNKOfgpoGB5RikmQwT0VSiQbq2m7bqa8Jm2 I3k+Py3hiY08ddP2PJMTKLcMR5Yb7EL4bouXoBrwofFsDXlkTIr1cQdfRoeQzfssB4 ZUd6tXRIfupa47lAkccVwgmaCclQwSokT/rvaUdEvGMXblHBjuGsDfdMwTcUHS7w2g yux7o8gKVJz65geUL7eL8UmeIedXSFUHs0ep1778C/cRH//qPPmPKWQOpF15Eg/+Rn Vadtv0RSBYaxJAWsnDj844iSoBnARIySLkLeyBX2qCWKRQNJS/w4fAGmwo1lEkAsxe CFBt76BajDKmg== Received: by mail.kernel.org with local (Exim 4.94) (envelope-from ) id 1lblYQ-001Drx-W4; Wed, 28 Apr 2021 16:52:43 +0200 From: Mauro Carvalho Chehab Cc: linuxarm@huawei.com, mauro.chehab@huawei.com, Mauro Carvalho Chehab , Mauro Carvalho Chehab , Shawn Tu , linux-kernel@vger.kernel.org, linux-media@vger.kernel.org Subject: [PATCH v4 49/79] media: i2c: ov5675: use pm_runtime_resume_and_get() Date: Wed, 28 Apr 2021 16:52:10 +0200 Message-Id: <3deaf3753d5adb417320bfb59a511329a7191c24.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/ov5675.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/media/i2c/ov5675.c b/drivers/media/i2c/ov5675.c index dea32859459a..e7e297a23960 100644 --- a/drivers/media/i2c/ov5675.c +++ b/drivers/media/i2c/ov5675.c @@ -863,9 +863,8 @@ static int ov5675_set_stream(struct v4l2_subdev *sd, int enable) mutex_lock(&ov5675->mutex); if (enable) { - ret = pm_runtime_get_sync(&client->dev); + ret = pm_runtime_resume_and_get(&client->dev); if (ret < 0) { - pm_runtime_put_noidle(&client->dev); mutex_unlock(&ov5675->mutex); return ret; } -- 2.30.2