Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp1946119pxy; Fri, 23 Apr 2021 23:57:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwqn271DVLiDnOIwIIGl8yftoDnWjtR9mmI81G+LUvxneNhUrn0QI2L5mBddkM/ujMHC5jK X-Received: by 2002:a05:6402:35d3:: with SMTP id z19mr8702599edc.143.1619247459503; Fri, 23 Apr 2021 23:57:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619247459; cv=none; d=google.com; s=arc-20160816; b=m8qFI8HKYtL7w2dkpxNhcVr59kHA9PR1AIz/tS4T7nI+DbbPYrjdQBdw81LthsoOCE OlWH/6CYBF1l+ViMwNfZK6tlrHUj9xonjkl88Q5aBywApTe9u+WVGMmmG7s/6MALal2L dJF3Uqq5agkEH93xjWzv+Py4p74ddB4lMTHlVDF//2EWy1lDSJoJUoa+d8/onU0MXj0c als7fWYCScAj2DZl/bZJmnJmduYi0cpbVZWglbtoADlf4QWW+iptjaY5U3xo4WTGp3B1 hefY9XvzN6V+OIi9t3o2OSShpOyhyYXyg87vxMFxIwFe9JusLmEyRCYZePJy1k696cqO f0nA== 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=KkORK53gtpg5nHI4GD7CeMZAQMpKY7HMfjApxsjIT+g=; b=A6str8y7uQEv/XwvKbS/Zz6YJWWg4R/2u1y8JCS23jhGpEynosN+RlA/8MXP5MrT4/ V2kWhHVlN3ctL5J2CPI2rh5rT1GKRcjFYCUr2BUTywuAevd+k55kQutqqeH7S935rn17 Fcn4YrNjvz8euZJMXXc2jk0zik/saWf31iDwTkMYf7WwUPwcQoHL7AOHfI0sea/bGvbl F3iRTb7AFg08eWUlMYtvpQ3FXRo3isj3CFijFLNFKHG/DTfmUBsSusEggAmwBlGWiMXX t6vVE0mneoOFKReS5eiq2QKgRP7t5dmWGw7nr3BQ9LpDy1A/E+PoXzUfrWa50DOE+Cui d8jg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@kernel.org header.s=k20201202 header.b="a1/QrOgP"; 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 d18si7449349edu.290.2021.04.23.23.57.15; Fri, 23 Apr 2021 23:57:39 -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="a1/QrOgP"; 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 S244699AbhDXGyh (ORCPT + 99 others); Sat, 24 Apr 2021 02:54:37 -0400 Received: from mail.kernel.org ([198.145.29.99]:36098 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237175AbhDXGqk (ORCPT ); Sat, 24 Apr 2021 02:46:40 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 205F86197F; 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=9V28x/0yZtyv8nyV8uH7fSioPt4mARji1tVhL7JUs2c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=a1/QrOgPF/5qFxtxLBIQCeeYsPbkHuJdY7rzJW2c2TR3reH1rDA7DqdG0C4nAw59M Kv5f6Yn4i4BUh5hct34L/ifwZaPT1RwYi3O2jhpTZg/P6pkzk48ON32+Ep7ooW8hKN y7Odv8BZWOq6kj7Z64LY1+q9mvoHZJ8i5Cm8QsOF884Pkex4iNySofy09sXqSlDLmz Ir66AJWL1aL/FITDaYzV9gdoeau9nzXPYHde3v+WOmMHH+tgRsCtYy7Og8EvQ6djVD O0GZif8Xv0LMtVgLf95dFfP4qg0evKRQlFgBE4990pWR93sve6LHX1+DnVKOGydAnC 0Ir42A9cYhAdg== Received: by mail.kernel.org with local (Exim 4.94) (envelope-from ) id 1laC2m-004Jg2-8w; 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 , Shunqian Zheng , linux-kernel@vger.kernel.org, linux-media@vger.kernel.org Subject: [PATCH 48/78] media: i2c: ov5695: use pm_runtime_resume_and_get() Date: Sat, 24 Apr 2021 08:44:58 +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/ov5695.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/i2c/ov5695.c b/drivers/media/i2c/ov5695.c index 09bee57a241d..469d941813c6 100644 --- a/drivers/media/i2c/ov5695.c +++ b/drivers/media/i2c/ov5695.c @@ -946,11 +946,9 @@ static int ov5695_s_stream(struct v4l2_subdev *sd, int on) goto unlock_and_return; if (on) { - 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 = __ov5695_start_stream(ov5695); if (ret) { -- 2.30.2