Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp1945308pxy; Fri, 23 Apr 2021 23:55:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw5pyFqkKMmgLDng4MsOh31p1d5Vt6g5l+7Yc0vuKvZfa4LPOq6KBybt5cI97ACJx7tXuvN X-Received: by 2002:a17:907:76fc:: with SMTP id kg28mr7901386ejc.396.1619247344269; Fri, 23 Apr 2021 23:55:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619247344; cv=none; d=google.com; s=arc-20160816; b=szcpLhKxngmaZqLoz7+E45YIXZbZesb6EF8PzaB4b+KtXu0cHGUC99YtRJcJpkucjk ZhV9/xnyiyZ9oAEtNJsZ+t2PEMbuOLDBi8WQu0tZVIs8mr9DUfAwmic3J030aBlF5UFB T8T50mSfcomVVywo+WACXq08ZJ1gOneMkiE62uq5vU6oEJMbRo137HndSwII/IULSFbD 63xPdFISINLkpjBn6HRhsB/V8nN+8FQ+ciD80yrd4e9z13KJ06TtVD7fiKInZZd5rb7U o2wflHedpmuEbbUz7Rh+7YF5PBMYTDYP+E4YMvbl4jqsaw9eOPpZItKziFkrbkbEKGLF R+jQ== 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=TnDDcu0/VpIALreZ69WjY+tB1POKhwvc9twQVcOW+RY=; b=a7JRs/2bW6th/WbvLPhCds+tJtmdZoCWBHzFVKWSpj1fKr/IOPE1DMJOFsFpW+S730 n8aI3Gi9ln5nWy2EUo6NY/kfYeaQ+2Ct80WoO12j5GMIteRf9VqvFMyjPfeMssC8syQe lgN8fD5RvM1JCV9IS14EhHxx4iAa1RZsIALKRwNPb54dAepxZR+dMZ5QeMnguObDoiga 2DRhLiQCUsjzHYmAzwMDJfpks9etJqh3qOxVf2zouvA4agXszTX4nNVjG10gepVXbGi6 q11px+M9YIQpS8tg7V1lwMPWBN1MKXmLuUOhUsZhhRHAgqkpoQOcZKIYWA7Vm/e7iHsL YZMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@kernel.org header.s=k20201202 header.b=USUuCZOB; 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 n20si8553389ejz.161.2021.04.23.23.55.19; Fri, 23 Apr 2021 23:55:44 -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=USUuCZOB; 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 S244268AbhDXGvI (ORCPT + 99 others); Sat, 24 Apr 2021 02:51:08 -0400 Received: from mail.kernel.org ([198.145.29.99]:35848 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233643AbhDXGqU (ORCPT ); Sat, 24 Apr 2021 02:46:20 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id AEB556192D; 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=4l0wYnfzYi1h956EsgOdlzJmS/W0qfvo5eSm9fSkn9o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=USUuCZOBa3BJM0Rlnm0VuiglaAPc8nX63S/cp93xtiRUyZS8vKXLAMz1vHGIsPy0m wGP38SWGEHcXyByTd5zK5ff1weM/x3diUraesk9W+V6LgfDtZyqSNquS9qMQShmL97 5ZOlMR7+l0i/X7s7a6YvKZXASNjpN0gCqjwufMGLBxq39ZX8rnD6k3gnPd0cxnWBZy sBMtlDTNd0qPEyWnPRe/VBWo1cz9JAdXLSbhnzqIyIycbIlcWSuThmogcTx23s+Kjf YFCOhMC5wIB5U4/Ua+PpkzChZfdXsqsSnM8d8Agu0Avm9lvNdy0EIVXcTp2GqK4wQy tBgf8lkHkqRXw== Received: by mail.kernel.org with local (Exim 4.94) (envelope-from ) id 1laC2m-004Jh0-SC; Sat, 24 Apr 2021 08:45:32 +0200 From: Mauro Carvalho Chehab Cc: linuxarm@huawei.com, mauro.chehab@huawei.com, Mauro Carvalho Chehab , Laurent Pinchart , Mauro Carvalho Chehab , linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-renesas-soc@vger.kernel.org Subject: [PATCH 68/78] media: rcar-fcp: use pm_runtime_resume_and_get() Date: Sat, 24 Apr 2021 08:45:18 +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/platform/rcar-fcp.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/rcar-fcp.c b/drivers/media/platform/rcar-fcp.c index 5c03318ae07b..de76af58013c 100644 --- a/drivers/media/platform/rcar-fcp.c +++ b/drivers/media/platform/rcar-fcp.c @@ -101,11 +101,9 @@ int rcar_fcp_enable(struct rcar_fcp_device *fcp) if (!fcp) return 0; - ret = pm_runtime_get_sync(fcp->dev); - if (ret < 0) { - pm_runtime_put_noidle(fcp->dev); + ret = pm_runtime_resume_and_get(fcp->dev); + if (ret < 0) return ret; - } return 0; } -- 2.30.2