lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250905144427.1840684-2-tommaso.merciai.xr@bp.renesas.com>
Date: Fri,  5 Sep 2025 16:44:17 +0200
From: Tommaso Merciai <tommaso.merciai.xr@...renesas.com>
To: tomm.merciai@...il.com
Cc: linux-renesas-soc@...r.kernel.org,
	biju.das.jz@...renesas.com,
	Tommaso Merciai <tommaso.merciai.xr@...renesas.com>,
	Vinod Koul <vkoul@...nel.org>,
	Geert Uytterhoeven <geert+renesas@...der.be>,
	Fabrizio Castro <fabrizio.castro.jz@...esas.com>,
	Lad Prabhakar <prabhakar.mahadev-lad.rj@...renesas.com>,
	Wolfram Sang <wsa+renesas@...g-engineering.com>,
	Uwe Kleine-König <u.kleine-koenig@...libre.com>,
	dmaengine@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: [PATCH 1/4] dmaengine: sh: rz-dmac: Use devm_pm_runtime_enable()

Use devm_pm_runtime_enable() into rz_dmac_probe() and drop unnecessary
pm_runtime_disable() from rz_dmac_probe() and rz_dmac_remove().

Signed-off-by: Tommaso Merciai <tommaso.merciai.xr@...renesas.com>
---
 drivers/dma/sh/rz-dmac.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/dma/sh/rz-dmac.c b/drivers/dma/sh/rz-dmac.c
index 1f687b08d6b86..0b526cc4d24be 100644
--- a/drivers/dma/sh/rz-dmac.c
+++ b/drivers/dma/sh/rz-dmac.c
@@ -963,12 +963,15 @@ static int rz_dmac_probe(struct platform_device *pdev)
 		return dev_err_probe(&pdev->dev, PTR_ERR(dmac->rstc),
 				     "failed to get resets\n");
 
-	pm_runtime_enable(&pdev->dev);
+	ret = devm_pm_runtime_enable(&pdev->dev);
+	if (ret < 0)
+		return dev_err_probe(&pdev->dev, ret,
+				     "Failed to enable runtime PM\n");
+
 	ret = pm_runtime_resume_and_get(&pdev->dev);
-	if (ret < 0) {
-		dev_err(&pdev->dev, "pm_runtime_resume_and_get failed\n");
-		goto err_pm_disable;
-	}
+	if (ret < 0)
+		return dev_err_probe(&pdev->dev, ret,
+				     "pm_runtime_resume_and_get failed\n");
 
 	ret = reset_control_deassert(dmac->rstc);
 	if (ret)
@@ -1031,8 +1034,6 @@ static int rz_dmac_probe(struct platform_device *pdev)
 	reset_control_assert(dmac->rstc);
 err_pm_runtime_put:
 	pm_runtime_put(&pdev->dev);
-err_pm_disable:
-	pm_runtime_disable(&pdev->dev);
 
 	return ret;
 }
@@ -1054,7 +1055,6 @@ static void rz_dmac_remove(struct platform_device *pdev)
 	}
 	reset_control_assert(dmac->rstc);
 	pm_runtime_put(&pdev->dev);
-	pm_runtime_disable(&pdev->dev);
 
 	platform_device_put(dmac->icu.pdev);
 }
-- 
2.43.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ