mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] watchdog: armada_37xx_wdt: remove struct resource
@ 2024-10-03 21:45 Rosen Penev
  2024-10-04  7:34 ` Marek Behún
  2024-10-12 15:49 ` Guenter Roeck
  0 siblings, 2 replies; 3+ messages in thread
From: Rosen Penev @ 2024-10-03 21:45 UTC (permalink / raw)
  To: linux-watchdog
  Cc: Marek Behún, Wim Van Sebroeck, Guenter Roeck, open list

No need for it with devm_platform_ioremap_resource. Simplifies probe
slightly.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
 drivers/watchdog/armada_37xx_wdt.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/drivers/watchdog/armada_37xx_wdt.c b/drivers/watchdog/armada_37xx_wdt.c
index 8133a5d05647..a17a7911771a 100644
--- a/drivers/watchdog/armada_37xx_wdt.c
+++ b/drivers/watchdog/armada_37xx_wdt.c
@@ -248,7 +248,6 @@ static const struct watchdog_ops armada_37xx_wdt_ops = {
 static int armada_37xx_wdt_probe(struct platform_device *pdev)
 {
 	struct armada_37xx_watchdog *dev;
-	struct resource *res;
 	struct regmap *regmap;
 	int ret;
 
@@ -266,12 +265,9 @@ static int armada_37xx_wdt_probe(struct platform_device *pdev)
 		return PTR_ERR(regmap);
 	dev->cpu_misc = regmap;
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	if (!res)
-		return -ENODEV;
-	dev->reg = devm_ioremap(&pdev->dev, res->start, resource_size(res));
-	if (!dev->reg)
-		return -ENOMEM;
+	dev->reg = devm_platform_ioremap_resource(pdev, 0);
+	if (IS_ERR(dev->reg))
+		return PTR_ERR(dev->reg);
 
 	/* init clock */
 	dev->clk = devm_clk_get_enabled(&pdev->dev, NULL);
-- 
2.46.2


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-10-12 15:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-10-03 21:45 [PATCH] watchdog: armada_37xx_wdt: remove struct resource Rosen Penev
2024-10-04  7:34 ` Marek Behún
2024-10-12 15:49 ` Guenter Roeck

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®