From 8abe6fb51ebd1d16c93d4435a808e056113f3510 Mon Sep 17 00:00:00 2001 From: Danny Kukawka Date: Thu, 23 Feb 2012 17:11:39 -0500 Subject: Staging: et131x: unify return value of .ndo_set_mac_address if address is invalid Unify return value of .ndo_set_mac_address if the given address isn't valid. Return -EADDRNOTAVAIL as eth_mac_addr() already does if is_valid_ether_addr() fails. Signed-off-by: Danny Kukawka Signed-off-by: David S. Miller --- drivers/staging/et131x/et131x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/staging') diff --git a/drivers/staging/et131x/et131x.c b/drivers/staging/et131x/et131x.c index 2c4069fcd981..b055731f8d88 100644 --- a/drivers/staging/et131x/et131x.c +++ b/drivers/staging/et131x/et131x.c @@ -5177,7 +5177,7 @@ static int et131x_set_mac_addr(struct net_device *netdev, void *new_mac) /* Make sure the requested MAC is valid */ if (!is_valid_ether_addr(address->sa_data)) - return -EINVAL; + return -EADDRNOTAVAIL; et131x_disable_txrx(netdev); et131x_handle_send_interrupt(adapter); -- cgit v1.2.3 From 3274ce71fede837176e59b1579ac9679dc990117 Mon Sep 17 00:00:00 2001 From: Danny Kukawka Date: Fri, 24 Feb 2012 14:46:01 +0100 Subject: Staging: ft1000-pcmcia: print MAC via printk format specifier Print MAC/dev_addr via printk extended format specifier %pM instead of custom code. Signed-off-by: Danny Kukawka --- drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'drivers/staging') diff --git a/drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c b/drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c index 917bbb082a6e..7569aa0f24d1 100644 --- a/drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c +++ b/drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c @@ -2211,11 +2211,8 @@ struct net_device *init_ft1000_card(struct pcmcia_device *link, ft1000InitProc(dev); ft1000_card_present = 1; SET_ETHTOOL_OPS(dev, &ops); - printk(KERN_INFO - "ft1000: %s: addr 0x%04lx irq %d, MAC addr %02x:%02x:%02x:%02x:%02x:%02x\n", - dev->name, dev->base_addr, dev->irq, dev->dev_addr[0], - dev->dev_addr[1], dev->dev_addr[2], dev->dev_addr[3], - dev->dev_addr[4], dev->dev_addr[5]); + printk(KERN_INFO "ft1000: %s: addr 0x%04lx irq %d, MAC addr %pM\n", + dev->name, dev->base_addr, dev->irq, dev->dev_addr); return dev; err_unreg: -- cgit v1.2.3 From 5d74f1757001f5b9a7739c2a9053435e16ce516b Mon Sep 17 00:00:00 2001 From: Danny Kukawka Date: Fri, 24 Feb 2012 14:46:02 +0100 Subject: Staging: wlags49_h2: print MAC via printk format specifier Print MAC/dev_addr via printk extended format specifier %pM instead of custom code. Signed-off-by: Danny Kukawka --- drivers/staging/wlags49_h2/wl_cs.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'drivers/staging') diff --git a/drivers/staging/wlags49_h2/wl_cs.c b/drivers/staging/wlags49_h2/wl_cs.c index 2faee2dd4bb1..a2cbb29c3f59 100644 --- a/drivers/staging/wlags49_h2/wl_cs.c +++ b/drivers/staging/wlags49_h2/wl_cs.c @@ -229,7 +229,6 @@ static int wl_adapter_resume(struct pcmcia_device *link) void wl_adapter_insert(struct pcmcia_device *link) { struct net_device *dev; - int i; int ret; /*--------------------------------------------------------------------*/ @@ -266,10 +265,8 @@ void wl_adapter_insert(struct pcmcia_device *link) register_wlags_sysfs(dev); - printk(KERN_INFO "%s: Wireless, io_addr %#03lx, irq %d, ""mac_address ", - dev->name, dev->base_addr, dev->irq); - for (i = 0; i < ETH_ALEN; i++) - printk("%02X%c", dev->dev_addr[i], ((i < (ETH_ALEN-1)) ? ':' : '\n')); + printk(KERN_INFO "%s: Wireless, io_addr %#03lx, irq %d, mac_address" + " %pM\n", dev->name, dev->base_addr, dev->irq, dev->dev_addr); DBG_LEAVE(DbgInfo); return; -- cgit v1.2.3