Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp1945715pxy; Fri, 23 Apr 2021 23:56:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx5FHoUp2wQMHgDzor2FQBgEIr/rEDpYNuX7mdNc127v7NDG7pNsuYzmjC6FhgbauKjs7aF X-Received: by 2002:a17:906:d789:: with SMTP id pj9mr8053398ejb.128.1619247401972; Fri, 23 Apr 2021 23:56:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619247401; cv=none; d=google.com; s=arc-20160816; b=lgSt4xj9BDFw7eOIC4k+bo1CI1yKtj4pDo1WQp7HicCxH0LKnRZp6WMZ3x+xOtw2XD wli5pXkU4kIhhJZ7yTxAgz9U08hh0+hjl4V5dcB7yPlYVQRgBtElKYpC4RuH7GbAQALp F6FMI86pS5gUJl+/CAdPsS5ujyXRv099FtCtkdKacXS6TR2RnRO71Ffx2Ar933a5WfdV vBYHdtxxDbX/2s069ZpfSn5u4Fx2qbRz1oRQirvvRPpwE0C64tJ8eINb7EBJs0LvTMwI uY+vTj3PMS+k98WZ9km/wmWslMOITtAZjreh1qBtOWv71FBQ7VNOQLHDHLD0foUQcakM vw6Q== 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=J5ILzeCy5bO7zBYYiJvg14eYohjREDL/gWB0nMD7YDTZJzhKzQD9zrl3MoUWlCPsiy QPjU3vWLaIrrwulcxLaZyQAwTsgkS4EBH9WxTIyt2bMLRMtbNVOIqZLohXy/7oFj29x8 wue7FjVPch/teD9mriOldn5hUYshDbQ8Sd4JQLKMFc1KUBm9fxjc7gcPR+DpFou0nYEK vSr3GzvtsAGK+0+KieK49wRgKgcla/45pmHXc0y/u2Vg+QJi40UAWo9WBfbsOJCzyxZ0 GQPLgVSUh8sWvzopYeleVsbM+H3vn2YbY3Be7rdBikcUMRMG7mo97X9WEh5zg8Vsk9ZB fMkA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@kernel.org header.s=k20201202 header.b=M8zU3oi2; 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 b1si7234360eju.122.2021.04.23.23.56.17; Fri, 23 Apr 2021 23:56:41 -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=M8zU3oi2; 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 S237410AbhDXGxu (ORCPT + 99 others); Sat, 24 Apr 2021 02:53:50 -0400 Received: from mail.kernel.org ([198.145.29.99]:35850 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236986AbhDXGqf (ORCPT ); Sat, 24 Apr 2021 02:46:35 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 15F626196E; Sat, 24 Apr 2021 06:45:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1619246734; bh=kwIJFx+3BZT7CutnecuzIxhgs2GnXNtjRI6MBhWOcG4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=M8zU3oi2ikz/PHMmNsPdwIMatZgjkS0v7ZOQPUD9nbSTAkFDmUrjmY14NZJ+hak06 OkWpss9mCdhacjdIlJD+wMFmGTfGqjTxotYRfueMtLJq5S1FF7c0rdBP66zWV4l/2p CZG489/TmwTrT1yfe1hX27zDoFVjxidsnO7Kih/rcGxCzreaVpX1NZzIjxAs/Onj6p LWhMXlBLQOlfvOQePS7ckgOpNRb46Ad/GGXJup/OFK74secwPlm6VIFkmblt5J7HAj fxpe9hysX20QSgKIh6jMxe4crjF17VenzPBx7prS/+9cEZDhrNxjB/ZYvjBphqBhsR gqoZYbPrnAf4Q== Received: by mail.kernel.org with local (Exim 4.94) (envelope-from ) id 1laC2m-004Jfz-82; Sat, 24 Apr 2021 08:45:32 +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 47/78] media: i2c: ov5675: use pm_runtime_resume_and_get() Date: Sat, 24 Apr 2021 08:44:57 +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/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