9
0
Fork 0

net: Use dev_name directly

eth_get_byname uses a selfmade dev_name, use dev_name directly instead.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
Sascha Hauer 2012-06-27 20:44:38 +02:00
parent 01f8ce581b
commit ee3e50f23f
1 changed files with 1 additions and 3 deletions

View File

@ -100,11 +100,9 @@ struct eth_device * eth_get_current(void)
struct eth_device *eth_get_byname(char *ethname)
{
struct eth_device *edev;
char name[MAX_DRIVER_NAME];
list_for_each_entry(edev, &netdev_list, list) {
sprintf(name, "%s%d", edev->dev.name, edev->dev.id);
if (!strcmp(ethname, name))
if (!strcmp(ethname, dev_name(&edev->dev)))
return edev;
}
return NULL;