Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp1945472pxy; Fri, 23 Apr 2021 23:56:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxRpxP6BDpuH3y5ptdeyEVl/zzZpUrirwDsLscO9BNNYgEjfajF0Rkcnml7aWxPQlQG00TM X-Received: by 2002:a17:906:6bc8:: with SMTP id t8mr8133861ejs.115.1619247366651; Fri, 23 Apr 2021 23:56:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619247366; cv=none; d=google.com; s=arc-20160816; b=wl6e8THP+qhaCwTOWDuUeoEtMIIw/HkM9kOCbBjswi0yMTPvHLU2/YpRXwkqZZjpXa mmPRbViPFd3T8VcyjVLq3pe6ZEkmshPp/nCfhglSgWutg2h1h2VQIatmq5SYRiflLcVr GxKTI2Q51impBSxHXeouWfw1sf6LC8wcpeyPRrjSaM/Z9dQRzYDq2Rogo+8q5R/wgVaf 3150tFML3qRJKkwQLUnv04/PlOHjQRKH+MC/X3j13RqghoT2NMFfIsNIVraBBBIOJlmW P1fP5tv4aWspw4MJAWJ3uLEdQhngUDoYj63tgY2sqBTaHQ9njq3yKW8qZEJO4pBZZrrC 5frw== 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=VrBkMHrOHV6/U+KNS9H6P4u2+sZPUywOOKGtmrIUulk=; b=qo7gI62myvufmz58rX5ayRgl/GW7yIySYElaKTdr0xgOUSFp9Om+Tkp9xB7f78baOU gvDa50hHGIum89nbtVEKETqgyTL4yjBENZvXKyoQ3bWUsmPxmXQh39GYElPpUUNKKINL 4DFTOeSwNhBOHOP4xMCLEJTq0saLyvth4DI4gwGc9D2JwM4jBauC8Wbl0iCRMivRPlE/ 1l9KjO3ox8q8y0miIJRMJSladyv1pwmTDJ0en1xqo866nWgxhSXeYU+RYCFvZBQePjNE tKPW0buWd57tEVEBqPdzhL7zOsBsAo6rcGgGVd0A213simPO/j94Nltw1MFNzKLrzx38 F9RA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@kernel.org header.s=k20201202 header.b=O5lG2fTr; 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 8si8790580ejx.637.2021.04.23.23.55.42; Fri, 23 Apr 2021 23:56:06 -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=O5lG2fTr; 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 S237294AbhDXGv2 (ORCPT + 99 others); Sat, 24 Apr 2021 02:51:28 -0400 Received: from mail.kernel.org ([198.145.29.99]:36096 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233677AbhDXGqU (ORCPT ); Sat, 24 Apr 2021 02:46:20 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 710AC6162F; 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=1619246733; bh=caAPk+MCL8dn2GoVy6dPupvi3+StYvHdRWjGpSc7psI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=O5lG2fTrSUv+Klvp/Y/ju1Ap7wYlUlfzX426Y10b3zlY+91Yl/C/1Gh4RpdvJDHxp gOscYp9c5RCFxGJdYI+Bg25WLO+s7QT+V/ncbyGqzCPoep2Dy7vpG7I4veqsrBW/y9 058m/SwQt+gcuQyossGkAWLZCH1Exi9JGMlI0ScjPdqK66C8xJfqgZ/unqjbTq/7A3 g+B/q8c9RLGWMXpQ5F4mHt2+fKYWhVFfwWEj1xE3H3waPI9TO9HetyAKClMkJH4Ft8 giroIscp+nBeEUHWDaJ7uyAkvrhivWr62h0na6wY/HPgRGiL1wVKWf2fjko4l74uT5 Zo23ozxOFtgig== Received: by mail.kernel.org with local (Exim 4.94) (envelope-from ) id 1laC2m-004Jgf-LY; Sat, 24 Apr 2021 08:45:32 +0200 From: Mauro Carvalho Chehab Cc: linuxarm@huawei.com, mauro.chehab@huawei.com, Mauro Carvalho Chehab , Andy Gross , Bjorn Andersson , Mauro Carvalho Chehab , Robert Foss , Todor Tomov , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org Subject: [PATCH 61/78] media: camss-csiphy: use pm_runtime_resume_and_get() Date: Sat, 24 Apr 2021 08:45:11 +0200 Message-Id: <134315407c8289ee207f2ffd554d0bd4ee70793d.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/platform/qcom/camss/camss-csiphy.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/qcom/camss/camss-csiphy.c b/drivers/media/platform/qcom/camss/camss-csiphy.c index b3c3bf19e522..8e18b8e668cf 100644 --- a/drivers/media/platform/qcom/camss/camss-csiphy.c +++ b/drivers/media/platform/qcom/camss/camss-csiphy.c @@ -197,11 +197,9 @@ static int csiphy_set_power(struct v4l2_subdev *sd, int on) if (on) { int ret; - ret = pm_runtime_get_sync(dev); - if (ret < 0) { - pm_runtime_put_sync(dev); + ret = pm_runtime_resume_and_get(dev); + if (ret < 0) return ret; - } ret = csiphy_set_clock_rates(csiphy); if (ret < 0) { -- 2.30.2