Subject: Re: [PATCH v2] net: Add eth_platform_get_mac_address() helper.

From: Bjørn Mork <[email-masked]>
Date: Thu, 07 Jan 2016 00:26:37 +0100

Joe Perches <[email-masked]> writes:
> On Wed, 2016-01-06 at 16:33 -0500, David Miller wrote:
>> A repeating pattern in drivers has become to use OF node information
>> and, if not found, platform specific host information to extract the
>> ethernet address for a given device.
> []
>> diff --git a/include/linux/etherdevice.h b/include/linux/etherdevice.h
> []
>> @@ -485,3 +487,32 @@ static int __init eth_offload_init(void)
>>  }
>>  
>>  fs_initcall(eth_offload_init);
>> +
>> +unsigned char * __weak arch_get_platform_mac_address(void)
>> +{
>> +       return NULL;
>
> WARN_ON_ONCE ?

That would prevent a driver from using this with additional fallback
methods.  For what reason?

I don't have a specific usecase, but I can imagine drivers falling back
to e.g a random address without wanting to be noisy about it.

Bjørn