Re: [PATCH 2/2] of: net: fix of_get_mac_addr_nvmem() for PCI and DSA nodes

2021-04-06 Thread Rob Herring
On Mon, Apr 5, 2021 at 11:47 AM Michael Walle wrote: > > of_get_mac_address() already supports fetching the MAC address by an > nvmem provider. But until now, it was just working for platform devices. > Esp. it was not working for DSA ports and PCI devices. It gets more > common that PCI devices h

Re: [PATCH 2/2] of: net: fix of_get_mac_addr_nvmem() for PCI and DSA nodes

2021-04-06 Thread Andrew Lunn
> But then pdev will be NULL and nvmem_get_mac_address() won't be called > at all, no? Forget it, it can be added later if there is a real use case. Andrew

Re: [PATCH 2/2] of: net: fix of_get_mac_addr_nvmem() for PCI and DSA nodes

2021-04-06 Thread Michael Walle
Am 2021-04-06 00:13, schrieb Andrew Lunn: On Mon, Apr 05, 2021 at 11:46:04PM +0200, Michael Walle wrote: Hi Andrew, Am 2021-04-05 23:34, schrieb Andrew Lunn: > > -static int of_get_mac_addr_nvmem(struct device_node *np, u8 addr) > > +static int of_get_mac_addr_nvmem(struct device_node *np, u8 *

Re: [PATCH 2/2] of: net: fix of_get_mac_addr_nvmem() for PCI and DSA nodes

2021-04-05 Thread Andrew Lunn
On Mon, Apr 05, 2021 at 11:46:04PM +0200, Michael Walle wrote: > Hi Andrew, > > Am 2021-04-05 23:34, schrieb Andrew Lunn: > > > -static int of_get_mac_addr_nvmem(struct device_node *np, u8 addr) > > > +static int of_get_mac_addr_nvmem(struct device_node *np, u8 *addr) > > > { > > > struct platf

Re: [PATCH 2/2] of: net: fix of_get_mac_addr_nvmem() for PCI and DSA nodes

2021-04-05 Thread Michael Walle
Hi Andrew, Am 2021-04-05 23:34, schrieb Andrew Lunn: -static int of_get_mac_addr_nvmem(struct device_node *np, u8 addr) +static int of_get_mac_addr_nvmem(struct device_node *np, u8 *addr) { struct platform_device *pdev = of_find_device_by_node(np); + struct nvmem_cell *cell; +

Re: [PATCH 2/2] of: net: fix of_get_mac_addr_nvmem() for PCI and DSA nodes

2021-04-05 Thread Andrew Lunn
Hi Michael > -static int of_get_mac_addr_nvmem(struct device_node *np, u8 addr) > +static int of_get_mac_addr_nvmem(struct device_node *np, u8 *addr) > { > struct platform_device *pdev = of_find_device_by_node(np); > + struct nvmem_cell *cell; > + const void *mac; > + size_t len

[PATCH 2/2] of: net: fix of_get_mac_addr_nvmem() for PCI and DSA nodes

2021-04-05 Thread Michael Walle
of_get_mac_address() already supports fetching the MAC address by an nvmem provider. But until now, it was just working for platform devices. Esp. it was not working for DSA ports and PCI devices. It gets more common that PCI devices have a device tree binding since SoCs contain integrated root com