9
0
Fork 0

net eth: make edev->init optional

edev->init is called at eth_register time unconditionally and is supposed
to initialize the ethernet hardware. Since it's called unconditionally
this could be done by the driver without having an additional hook.
Some drivers need their initialization done earlier since they also register
a mdiobus which does hardware accesses on registration time.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
Sascha Hauer 2012-10-30 16:45:26 +01:00
parent 3a17af33c0
commit 8796301447
1 changed files with 2 additions and 1 deletions

View File

@ -269,7 +269,8 @@ int eth_register(struct eth_device *edev)
dev_add_param(dev, "netmask", eth_set_ipaddr, NULL, 0);
dev_add_param(dev, "serverip", eth_set_ipaddr, NULL, 0);
edev->init(edev);
if (edev->init)
edev->init(edev);
list_add_tail(&edev->list, &netdev_list);