[PATCHv6 net-next 3/7] net: ibm: emac: use devm_platform_ioremap_resource

Rosen Penev posted 7 patches 1 month, 2 weeks ago
There is a newer version of this series
[PATCHv6 net-next 3/7] net: ibm: emac: use devm_platform_ioremap_resource
Posted by Rosen Penev 1 month, 2 weeks ago
No need to have a struct resource. Gets rid of the TODO.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
 drivers/net/ethernet/ibm/emac/core.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ethernet/ibm/emac/core.c b/drivers/net/ethernet/ibm/emac/core.c
index 644abd37cfb4..438b08e8e956 100644
--- a/drivers/net/ethernet/ibm/emac/core.c
+++ b/drivers/net/ethernet/ibm/emac/core.c
@@ -3050,12 +3050,10 @@ static int emac_probe(struct platform_device *ofdev)
 
 	ndev->irq = dev->emac_irq;
 
-	/* Map EMAC regs */
-	// TODO : platform_get_resource() and devm_ioremap_resource()
-	dev->emacp = devm_of_iomap(&ofdev->dev, np, 0, NULL);
-	if (!dev->emacp) {
+	dev->emacp = devm_platform_ioremap_resource(ofdev, 0);
+	if (IS_ERR(dev->emacp)) {
 		dev_err(&ofdev->dev, "can't map device registers");
-		err = -ENOMEM;
+		err = PTR_ERR(dev->emacp);
 		goto err_gone;
 	}
 
-- 
2.47.0
Re: [PATCHv6 net-next 3/7] net: ibm: emac: use devm_platform_ioremap_resource
Posted by Simon Horman 1 month, 2 weeks ago
On Fri, Oct 11, 2024 at 12:56:18PM -0700, Rosen Penev wrote:
> No need to have a struct resource. Gets rid of the TODO.
> 
> Signed-off-by: Rosen Penev <rosenp@gmail.com>

Reviewed-by: Simon Horman <horms@kernel.org>