[PATCH 2/3] net: Use dev_name directly
Sascha Hauer
s.hauer at pengutronix.de
Thu Jun 28 06:48:46 EDT 2012
eth_get_byname uses a selfmade dev_name, use dev_name directly instead.
Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
net/eth.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/net/eth.c b/net/eth.c
index 2b492ad..e023d65 100644
--- a/net/eth.c
+++ b/net/eth.c
@@ -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;
--
1.7.10
More information about the barebox
mailing list