[PATCH v1 20/43] net: cirrus: add DT support for Cirrus EP93xx

andy.shevchenko at gmail.com andy.shevchenko at gmail.com
Sat Jun 3 13:30:27 PDT 2023


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





More information about the linux-arm-kernel mailing list