Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp1944610pxy; Fri, 23 Apr 2021 23:53:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxAj3SiKUYiaREShoxuu5zHO5V+DCVSy5kk3dzP8lwC47Lm/LmUm91r1FJlwECPMgp7KU9o X-Received: by 2002:a17:906:7842:: with SMTP id p2mr8251374ejm.87.1619247232319; Fri, 23 Apr 2021 23:53:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619247232; cv=none; d=google.com; s=arc-20160816; b=FdWeW0Evb0xvR1AQavB5PLgbPXUZO1+fXCpzJE7YAUIkIT+KrBN5+hX4VEWCXUgM/7 xb59YZE0W+aFJ3IgYDELBNIUpBNlSNTOcBGrud2+aRCeIQVGttKZ1RJOvJeEkZnKgSTX m6ubPwQKNu3HQv09bgAcgweAOaTQoHf7sVCv1OdBdi2xCFfcnCfHJJHps6HMsqA7vD0c pn50RjKc+p5TPtUqhX7ABxoRr4IdG/fo/xIVheOtSBiTR6bbDY/yGAE0ba92w2ca1UWc 8bZ7YJi9qAXgffUyK7iy1MJ2actKl3frDfsmVadOBpTW6h4yCoAFaEHzbXDq6qe03RA4 EXxA== 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=szm6sompZrjCpwbeOlZtl/9mSfqmAekiG380Qcz6trCGfR1l19BNJMk69LhdC5Pwly 6n8EBtrnbNbuef3wVPbNG3c2gP4vJNMbOVwmza+JUbcseHcojhj6y9WF9hnAftmqblQv 3bqX8iTF+EZpAe4rT6fGL6bWzZvT4JwRpWgKaWTKM0UhYAwelGFKP7YtuxNXz13Z/mez RRxRIZCKPL28FGOOLEo3p2kTU72Dyw2DurWDtG0fWJ5uHs7R0buyul7vvNeJId8T2Owo xGeQgvD3YfDHIQ1gy5oHOcfJWDvmmG4dikgP9uapdVH5EWt+LKR7TgemN7j13Gn6CbmC s60w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@kernel.org header.s=k20201202 header.b=n3vh4XOg; 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 he17si6954694ejc.99.2021.04.23.23.53.28; Fri, 23 Apr 2021 23:53:52 -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=n3vh4XOg; 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 S237089AbhDXGxQ (ORCPT + 99 others); Sat, 24 Apr 2021 02:53:16 -0400 Received: from mail.kernel.org ([198.145.29.99]:35972 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236878AbhDXGqe (ORCPT ); Sat, 24 Apr 2021 02:46:34 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 0C5566196A; 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=1619246734; bh=k96A/wu5csXQdkebmEvDXUWzQhtBwXxGUFyh7/8ot0s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=n3vh4XOgYA9/FT+HzWCpjNDHsyfGRv0q/MiJzFJwbWkOec3/LKr8JGRqvhZn2g9z6 BL0GDvAU0qZfds2lv+bfxaxIgxYz+BOHHoKKjx9PtyZH+4UKlDVByQ51ztNSEwXGit nsUKDWW36Fy/flsbHdRk49vIKdFpmQtybXt502UYwrnIxY33GvsEuz0IVK9jTl3QOL hrHTE9PwjVf2Bn9GHdBSZkyQ2e69joIGvqPjsokYMpvDkRaDwLgvy6Y8DuOtQ07ZxC 6wwatWnpgnHilBl5/30n0tbUdo+2HRYvYCvDbHsA3XqEqnM++WEKNSh8IAmDN33Xc5 HUKZhrIR/OSGA== Received: by mail.kernel.org with local (Exim 4.94) (envelope-from ) id 1laC2m-004Jfw-77; Sat, 24 Apr 2021 08:45:32 +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 46/78] media: i2c: ov5670: use pm_runtime_resume_and_get() Date: Sat, 24 Apr 2021 08:44:56 +0200 Message-Id: <6c8a7094e85bb0b93ccd6b9afead783fff6cb12c.1619191723.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