From patchwork Fri Jun 10 09:29:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 12877235 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 81C03C433EF for ; Fri, 10 Jun 2022 09:31:42 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 59C2712B227; Fri, 10 Jun 2022 09:31:34 +0000 (UTC) Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) by gabe.freedesktop.org (Postfix) with ESMTPS id 56E7312B0A2 for ; Fri, 10 Jun 2022 09:31:20 +0000 (UTC) Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id AFB9A5C00F2; Fri, 10 Jun 2022 05:31:19 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Fri, 10 Jun 2022 05:31:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cerno.tech; h=cc :cc:content-transfer-encoding:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm1; t=1654853479; x=1654939879; bh=Uf rNm1aT2NCEXjU1j37GI22AueNWGOVjpc+X750FpoQ=; b=TF9NZSGa2qO3uYtyIa q7HznHHxDVVQyFtGwqs0h8xbYolQdxFCU32bxkEHE4NpeOSAkVBReZng9aT1/02R nmZIedfKddddp9BXJKuba2iRc5PxOoO9YARydZmFrp2wlFTz3RljQgeelegcHdY5 5cNjLi0ABTyFw6glcgoz6N2jrnl1FqGaCE2cP7O4X/8avggGPON3TgoOzTwKAmbn LWxEJohkj7eXBPB0lPBPX7rotlBeMlUzF1OgLu5nCU9KQlZJoZu0lB1m8r/k+UXK hACjWWr/kD9JnhR/kgAr3nMj7o7gVf4iVd5egYTVPzoKWsrPrDchps8uHvT4yZkw rwcA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; t=1654853479; x=1654939879; bh=UfrNm1aT2NCEX jU1j37GI22AueNWGOVjpc+X750FpoQ=; b=gn1gxexVn83RtsTpDjJmX+UDdoaAz jU4sOpUhmsRWVkupCnsLChspUT3V+RV7y3+Iy4KFjItuoZdsGgLjVGk+RyP6TI4T YEaBF2yJTLUChVfpqV8DA1daC7l3MZn52xDNpop0xEVsMpsqFxcr2ghxnFOj0q9d UVKEULPm+IhPMvsHAXPVsWN3d29dGrwdpNj/lM5K3ei4ElYnMynlQehRhF2dVG3w i2nkmw5X+ZE1d+yANdhDpDtECtTeqGOtAX6NChvL7wSDC0TG5vH0qFBkQ9RAZ8Jj vK5CLzCj4NPhUI8UpSWbyshyKS5ZdZV91o8jY4tcnqaImfxhRvL9Pw8yw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrudduuddgudeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvvefufffkofgjfhgggfestdekredtredttdenucfhrhhomhepofgrgihi mhgvucftihhprghrugcuoehmrgigihhmvgestggvrhhnohdrthgvtghhqeenucggtffrrg htthgvrhhnpeelkeefteduhfekjeeihfetudfguedvveekkeetteekhfekhfdtlefgfedu vdejhfenucevlhhushhtvghrufhiiigvpedutdenucfrrghrrghmpehmrghilhhfrhhomh epmhgrgihimhgvsegtvghrnhhordhtvggthh X-ME-Proxy: Feedback-ID: i8771445c:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 10 Jun 2022 05:31:19 -0400 (EDT) From: Maxime Ripard To: Daniel Vetter , David Airlie , Maarten Lankhorst , Thomas Zimmermann , Maxime Ripard Subject: [PATCH 64/64] drm/vc4: v3d: Switch to devm_pm_runtime_enable Date: Fri, 10 Jun 2022 11:29:24 +0200 Message-Id: <20220610092924.754942-65-maxime@cerno.tech> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220610092924.754942-1-maxime@cerno.tech> References: <20220610092924.754942-1-maxime@cerno.tech> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" devm_pm_runtime_enable() simplifies the driver a bit since it will call pm_runtime_disable() automatically through a device-managed action. Signed-off-by: Maxime Ripard --- drivers/gpu/drm/vc4/vc4_v3d.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_v3d.c b/drivers/gpu/drm/vc4/vc4_v3d.c index a3fcabf5e6ab..2d63124e2ac0 100644 --- a/drivers/gpu/drm/vc4/vc4_v3d.c +++ b/drivers/gpu/drm/vc4/vc4_v3d.c @@ -453,11 +453,13 @@ static int vc4_v3d_bind(struct device *dev, struct device *master, void *data) return ret; vc4->irq = ret; - pm_runtime_enable(dev); + ret = devm_pm_runtime_enable(dev); + if (ret) + return ret; ret = pm_runtime_resume_and_get(dev); if (ret) - goto err_disable_runtime_pm; + return ret; if (V3D_READ(V3D_IDENT0) != V3D_EXPECTED_IDENT0) { DRM_ERROR("V3D_IDENT0 read 0x%08x instead of 0x%08x\n", @@ -486,9 +488,6 @@ static int vc4_v3d_bind(struct device *dev, struct device *master, void *data) err_put_runtime_pm: pm_runtime_put(dev); -err_disable_runtime_pm: - pm_runtime_disable(dev); - return ret; } @@ -498,8 +497,6 @@ static void vc4_v3d_unbind(struct device *dev, struct device *master, struct drm_device *drm = dev_get_drvdata(master); struct vc4_dev *vc4 = to_vc4_dev(drm); - pm_runtime_disable(dev); - vc4_irq_uninstall(drm); /* Disable the binner's overflow memory address, so the next