mbox series

[v4,0/2] of_net: Implement of_get_nvmem_mac_address helper

Message ID 1522301389-11034-1-git-send-email-mike.looijmans@topic.nl
Headers show
Series of_net: Implement of_get_nvmem_mac_address helper | expand

Message

Mike Looijmans March 29, 2018, 5:29 a.m. UTC
Posted this as a small set now, with an (optional) second patch that shows
how the changes work and what I've used to test the code on a Topic Miami board.
I've taken the liberty to add appropriate "Acked" and "Review" tags.

v4: Replaced "6" with ETH_ALEN

v3: Add patch that implements mac in nvmem for the Cadence MACB controller
    Remove the integrated of_get_mac_address call

v2: Use of_nvmem_cell_get to avoid needing the assiciated device
    Use void* instead of char*
    Add devicetree binding doc


Mike Looijmans (2):
  of_net: Implement of_get_nvmem_mac_address helper
  net: macb: Try to retrieve MAC addess from nvmem provider

 Documentation/devicetree/bindings/net/ethernet.txt |  2 ++
 drivers/net/ethernet/cadence/macb_main.c           | 12 +++++--
 drivers/of/of_net.c                                | 40 ++++++++++++++++++++++
 include/linux/of_net.h                             |  6 ++++
 4 files changed, 57 insertions(+), 3 deletions(-)

Comments

David Miller March 30, 2018, 2:40 p.m. UTC | #1
From: Mike Looijmans <mike.looijmans@topic.nl>
Date: Thu, 29 Mar 2018 07:29:47 +0200

> Posted this as a small set now, with an (optional) second patch that shows
> how the changes work and what I've used to test the code on a Topic Miami board.
> I've taken the liberty to add appropriate "Acked" and "Review" tags.
> 
> v4: Replaced "6" with ETH_ALEN
> 
> v3: Add patch that implements mac in nvmem for the Cadence MACB controller
>     Remove the integrated of_get_mac_address call
> 
> v2: Use of_nvmem_cell_get to avoid needing the assiciated device
>     Use void* instead of char*
>     Add devicetree binding doc

Series applied to net-next, thank you.
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Mike Looijmans March 31, 2018, 5:20 p.m. UTC | #2
On 30-03-18 16:40, David Miller wrote:
> From: Mike Looijmans <mike.looijmans@topic.nl>
> Date: Thu, 29 Mar 2018 07:29:47 +0200
> 
>> Posted this as a small set now, with an (optional) second patch that shows
>> how the changes work and what I've used to test the code on a Topic Miami board.
>> I've taken the liberty to add appropriate "Acked" and "Review" tags.
>>
>> v4: Replaced "6" with ETH_ALEN
>>
>> v3: Add patch that implements mac in nvmem for the Cadence MACB controller
>>      Remove the integrated of_get_mac_address call
>>
>> v2: Use of_nvmem_cell_get to avoid needing the assiciated device
>>      Use void* instead of char*
>>      Add devicetree binding doc
> 
> Series applied to net-next, thank you.
> 

Got a kbuild bot error message in the e-mail, with errors like: 
"undefined reference to `of_nvmem_cell_get'"

Should I add an "#if CONFIG_NVMEM" guard around the new code and make a 
v5 patch?
Andrew Lunn March 31, 2018, 5:27 p.m. UTC | #3
On Sat, Mar 31, 2018 at 07:20:30PM +0200, Mike Looijmans wrote:
> On 30-03-18 16:40, David Miller wrote:
> >From: Mike Looijmans <mike.looijmans@topic.nl>
> >Date: Thu, 29 Mar 2018 07:29:47 +0200
> >
> >>Posted this as a small set now, with an (optional) second patch that shows
> >>how the changes work and what I've used to test the code on a Topic Miami board.
> >>I've taken the liberty to add appropriate "Acked" and "Review" tags.
> >>
> >>v4: Replaced "6" with ETH_ALEN
> >>
> >>v3: Add patch that implements mac in nvmem for the Cadence MACB controller
> >>     Remove the integrated of_get_mac_address call
> >>
> >>v2: Use of_nvmem_cell_get to avoid needing the assiciated device
> >>     Use void* instead of char*
> >>     Add devicetree binding doc
> >
> >Series applied to net-next, thank you.
> >
> 
> Got a kbuild bot error message in the e-mail, with errors like: "undefined
> reference to `of_nvmem_cell_get'"
> 
> Should I add an "#if CONFIG_NVMEM" guard around the new code and make a v5
> patch?

Hi Mike

You need to understand what is actually causing the problem. If it no
NVMEM, or no OF? The kernel config was part of the email, so you
should be able to reproduce the failure.

We don't normally add #ifdef in code. Instead we implement stub
functions in the header file, which would in this case return
something like -ENODEV.

Dave has already take this patch. So you need to do an incremental
fix.

	  Andrew
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html