[PATCH 2/3] OMAP2+ devices add mac address allocation register api

Andy Green andy.green at linaro.org
Fri Jun 29 05:03:20 EDT 2012


On 06/29/12 16:51, the mail apparently from Arnd Bergmann included:
> On Friday 29 June 2012, Andy Green wrote:
>> +static int omap_panda_netdev_event(struct notifier_block *this,
>> +                                               unsigned long event, void *ptr)
>> +{
>> +       struct net_device *dev = ptr;
>> +       struct sockaddr sa;
>> +       int n;
>> +
>> +       if (event != NETDEV_REGISTER)
>> +               return NOTIFY_DONE;
>> +
>> +       n = omap_device_path_need_mac(dev->dev.parent);
>> +       if (n < 0)
>> +               return NOTIFY_DONE;
>> +
>> +       sa.sa_family = dev->type;
>> +       omap2_die_id_to_ethernet_mac(sa.sa_data, n);
>> +       dev->netdev_ops->ndo_set_mac_address(dev, &sa);
>> +
>> +       return NOTIFY_DONE;
>> +}
>> +
>> +static struct notifier_block omap_panda_netdev_notifier = {
>> +       .notifier_call = omap_panda_netdev_event,
>> +       .priority = 1,
>> +};
>> +
>> +int omap_register_mac_device_fixup_paths(const char * const *paths, int count)
>> +{
>> +       mac_device_fixup_paths = paths;
>> +       count_mac_device_fixup_paths = count;
>> +
>> +       return register_netdevice_notifier(&omap_panda_netdev_notifier);
>> +}
>
> The omap_panda_netdev_event and omap_panda_netdev_notifier symbols should probably
> lose the "panda_" part of their names, because they are now located in a common
> file and are not panda specific any more.

Good point thanks, I'll sort it out after waiting for any more comments.

-Andy

-- 
Andy Green | TI Landing Team Leader
Linaro.org │ Open source software for ARM SoCs | Follow Linaro
http://facebook.com/pages/Linaro/155974581091106  - 
http://twitter.com/#!/linaroorg - http://linaro.org/linaro-blog





More information about the linux-arm-kernel mailing list