Re: [PATCH] of_net: Implement of_get_nvmem_mac_address helper

2018-03-29 Thread Mike Looijmans
On 25-03-18 10:17, Mike Looijmans wrote: On 24-03-18 19:53, Andrew Lunn wrote: A quick survey for the of_get_mac_address users learns that most of them do a memcpy (or similar) right after it, so for these drivers the "of_get_nvmem_mac_address" style signature that performs the memcpy (or bette

Re: [PATCH] of_net: Implement of_get_nvmem_mac_address helper

2018-03-25 Thread Andrew Lunn
> I have no experience with Coccinelle though. Hi Mike I've very little either. But all the interactions i've had with Coccinelle people have been very friendly and helpful. It could be, if you can describe in words what you need help with, they can write the script to do it. Andrew

Re: [PATCH] of_net: Implement of_get_nvmem_mac_address helper

2018-03-25 Thread Mike Looijmans
On 24-03-18 19:53, Andrew Lunn wrote: A quick survey for the of_get_mac_address users learns that most of them do a memcpy (or similar) right after it, so for these drivers the "of_get_nvmem_mac_address" style signature that performs the memcpy (or better, ether_addr_copy) is a better fit, e.g.:

Re: [PATCH] of_net: Implement of_get_nvmem_mac_address helper

2018-03-24 Thread Andrew Lunn
> A quick survey for the of_get_mac_address users learns that most of them do > a memcpy (or similar) right after it, so for these drivers the > "of_get_nvmem_mac_address" style signature that performs the memcpy (or > better, ether_addr_copy) is a better fit, e.g.: > > int of_get_mac_address(stru

Re: [PATCH] of_net: Implement of_get_nvmem_mac_address helper

2018-03-24 Thread Mike Looijmans
On 23-03-18 20:33, Florian Fainelli wrote: On 03/23/2018 12:20 PM, Mike Looijmans wrote: On 23-3-2018 16:11, Andrew Lunn wrote: On Fri, Mar 23, 2018 at 03:24:34PM +0100, Mike Looijmans wrote: It's common practice to store MAC addresses for network interfaces into nvmem devices. However the cod

Re: [PATCH] of_net: Implement of_get_nvmem_mac_address helper

2018-03-24 Thread Mike Looijmans
On 23-03-18 20:42, Andrew Lunn wrote: Indeed. I'll add my settings as an example. Where should I put this documentation, in the commit comment or somewhere in Documents/devicetree/bindings? Documention/devicetree/bindings/net/ethernet.txt Ok It's what I intended to do, but there were two pr

Re: [PATCH] of_net: Implement of_get_nvmem_mac_address helper

2018-03-23 Thread Andrew Lunn
> Indeed. I'll add my settings as an example. Where should I put this > documentation, in the commit comment or somewhere in > Documents/devicetree/bindings? Documention/devicetree/bindings/net/ethernet.txt > It's what I intended to do, but there were two problems with that: > - of_get_mac_addres

Re: [PATCH] of_net: Implement of_get_nvmem_mac_address helper

2018-03-23 Thread Florian Fainelli
On 03/23/2018 12:20 PM, Mike Looijmans wrote: > On 23-3-2018 16:11, Andrew Lunn wrote: >> On Fri, Mar 23, 2018 at 03:24:34PM +0100, Mike Looijmans wrote: >>> It's common practice to store MAC addresses for network interfaces into >>> nvmem devices. However the code to actually do this in the kernel

Re: [PATCH] of_net: Implement of_get_nvmem_mac_address helper

2018-03-23 Thread Mike Looijmans
On 23-3-2018 16:11, Andrew Lunn wrote: On Fri, Mar 23, 2018 at 03:24:34PM +0100, Mike Looijmans wrote: It's common practice to store MAC addresses for network interfaces into nvmem devices. However the code to actually do this in the kernel lacks, so this patch adds of_get_nvmem_mac_address() fo

Re: [PATCH] of_net: Implement of_get_nvmem_mac_address helper

2018-03-23 Thread Andrew Lunn
On Fri, Mar 23, 2018 at 03:24:34PM +0100, Mike Looijmans wrote: > It's common practice to store MAC addresses for network interfaces into > nvmem devices. However the code to actually do this in the kernel lacks, > so this patch adds of_get_nvmem_mac_address() for drivers to obtain the > address fr

[PATCH] of_net: Implement of_get_nvmem_mac_address helper

2018-03-23 Thread Mike Looijmans
It's common practice to store MAC addresses for network interfaces into nvmem devices. However the code to actually do this in the kernel lacks, so this patch adds of_get_nvmem_mac_address() for drivers to obtain the address from an nvmem cell provider. This is particulary useful on devices where