lkml.org 
[lkml]   [2018]   [Jul]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v2 2/3] net: add support for nvmem to eth_platform_get_mac_address()
2018-07-19 11:09 GMT+02:00 Dan Carpenter <dan.carpenter@oracle.com>:
>
> Maybe it would be simpler as three separate functions:
>
> int of_eth_get_mac_address() <- rename existing function to this
> int nvmem_eth_get_mac_address() <- patch 2
> int mtd_eth_nvmem_get_mac_address() patch 3
>
> int ret;
>
> ret = of_eth_get_mac_address(dev, mac_addr);
> if (!ret)
> return 0;
> ret = nvmem_eth_get_mac_address(dev, mac_addr);
> if (ret == -EPROBEDEFER)
> return ret;
> if (!ret)
> return 0;
> ret = mtd_eth_nvmem_get_mac_address(dev, mac_addr);
> if (!ret)
> return 0;
>
> return -ENODEV;
>
> regards,
> dan carpenter

It looks simpler as long as you don't add all the new routines
resulting from this approach. I've just tried to quickly implement
this solution and it resulted in much bigger and duplicated code
(checking the validity of mac_addr, copying it etc.). I would prefer
the current approach and would like to read someone else's opinion on
that.

Thanks,
Bart
>

\
 
 \ /
  Last update: 2018-07-19 12:07    [W:0.067 / U:2.152 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site