Re: [PATCH v1 20/43] net: cirrus: add DT support for Cirrus EP93xx
From: <hidden>
Date: 2023-06-03 20:30:34
Also in:
linux-arm-kernel, lkml
From: <hidden>
Date: 2023-06-03 20:30:34
Also in:
linux-arm-kernel, lkml
Thu, Jun 01, 2023 at 08:45:25AM +0300, Nikita Shubin kirjoitti:
- find register range from the device tree - get "copy_addr" from the device tree - get phy_id from the device tree
...
-#include <linux/platform_data/eth-ep93xx.h> #include <linux/reboot.h> +#include <linux/platform_data/eth-ep93xx.h>
Stray change. ...
mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
irq = platform_get_irq(pdev, 0);
if (!mem || irq < 0)
return -ENXIO;
- dev = ep93xx_dev_alloc(data);
+ base_addr = ioremap(mem->start, resource_size(mem));
+ if (!base_addr) {
+ dev_err(&pdev->dev, "Failed to ioremap ethernet registers\n");
+ return -EIO;
+ }Why not switching to devm_platform_ioremap_resource()? ...
+ if (of_property_read_u32(np, "reg", &phy_id)) {
+ dev_err(&pdev->dev, "Failed to locate \"phy_id\"\n");
+ return -ENOENT;return dev_err_probe(...); ?
+ }
-- With Best Regards, Andy Shevchenko