Re: [PATCH v6 18/40] net: cirrus: add DT support for Cirrus EP93xx

From: Andy Shevchenko
Date: Wed Dec 13 2023 - 13:40:11 EST


On Tue, Dec 12, 2023 at 11:20:35AM +0300, Nikita Shubin wrote:
> - add OF ID match table
> - get phy_id from the device tree, as part of mdio
> - copy_addr is now always used, as there is no SoC/board that aren't
> - dropped platform header

...

> mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> irq = platform_get_irq(pdev, 0);
> if (!mem || irq < 0)
> return -ENXIO;

Strictly speaking these should be separated and different codes being retuned as
platform_get_irq() might return something different in some cases.

irq = platform_get_irq(pdev, 0);
if (irq < 0)
return irq;

> + base_addr = ioremap(mem->start, resource_size(mem));
> + if (!base_addr)
> + return dev_err_probe(&pdev->dev, -EIO, "Failed to ioremap ethernet registers\n");

Hmm... Why not devm_platform_ioremap_resource()?

--
With Best Regards,
Andy Shevchenko