All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rosen Penev <rosenp@gmail.com>
To: netdev@vger.kernel.org
Cc: Andrew Lunn <andrew@lunn.ch>,
	ansuelsmth@gmail.com, Heiner Kallweit <hkallweit1@gmail.com>,
	Russell King <linux@armlinux.org.uk>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	linux-kernel@vger.kernel.org (open list)
Subject: [PATCH net-next 1/2] net: mdio-ipq8064: use platform_get_resource
Date: Sun, 17 Nov 2024 13:31:30 -0800	[thread overview]
Message-ID: <20241117213131.14200-2-rosenp@gmail.com> (raw)
In-Reply-To: <20241117213131.14200-1-rosenp@gmail.com>

There's no need to get the of_node explicitly. platform_get_resource
already does this.

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

diff --git a/drivers/net/mdio/mdio-ipq8064.c b/drivers/net/mdio/mdio-ipq8064.c
index 6253a9ab8b69..e3d311ce3810 100644
--- a/drivers/net/mdio/mdio-ipq8064.c
+++ b/drivers/net/mdio/mdio-ipq8064.c
@@ -111,15 +111,16 @@ ipq8064_mdio_probe(struct platform_device *pdev)
 {
 	struct device_node *np = pdev->dev.of_node;
 	struct ipq8064_mdio *priv;
-	struct resource res;
+	struct resource *res;
 	struct mii_bus *bus;
 	void __iomem *base;
 	int ret;
 
-	if (of_address_to_resource(np, 0, &res))
+	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+	if (!res)
 		return -ENOMEM;
 
-	base = devm_ioremap(&pdev->dev, res.start, resource_size(&res));
+	base = devm_ioremap(&pdev->dev, res->start, resource_size(res));
 	if (!base)
 		return -ENOMEM;
 
-- 
2.47.0


  reply	other threads:[~2024-11-17 21:31 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-17 21:31 [PATCH net-next 0/2] net: mdio-ipq8064: simplify with devm Rosen Penev
2024-11-17 21:31 ` Rosen Penev [this message]
2024-11-17 21:31 ` [PATCH net-next 2/2] net: mdio-ipq8064: remove _remove function Rosen Penev
  -- strict thread matches above, loose matches on Subject: below --
2024-12-03 22:16 [PATCHv2 net-next 0/2] simplify with devm Rosen Penev
2024-12-03 22:16 ` [PATCH net-next 1/2] net: mdio-ipq8064: use platform_get_resource Rosen Penev
2024-12-03 22:27   ` Heiner Kallweit
2024-12-03 22:32     ` Rosen Penev

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241117213131.14200-2-rosenp@gmail.com \
    --to=rosenp@gmail.com \
    --cc=andrew@lunn.ch \
    --cc=ansuelsmth@gmail.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=hkallweit1@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.