8
8
* Copyright (C) 2001 by various other people who didn't put their name here.
9
9
*/
10
10
11
+ #define pr_fmt (fmt ) "uml-vector: " fmt
12
+
11
13
#include <linux/memblock.h>
12
14
#include <linux/etherdevice.h>
13
15
#include <linux/ethtool.h>
@@ -1551,41 +1553,33 @@ static void vector_setup_etheraddr(struct net_device *dev, char *str)
1551
1553
addr [i ] = simple_strtoul (str , & end , 16 );
1552
1554
if ((end == str ) ||
1553
1555
((* end != ':' ) && (* end != ',' ) && (* end != '\0' ))) {
1554
- printk (KERN_ERR
1555
- "setup_etheraddr: failed to parse '%s' "
1556
- "as an ethernet address\n" , str );
1556
+ netdev_err (dev ,
1557
+ "Failed to parse '%s' as an ethernet address\n" , str );
1557
1558
goto random ;
1558
1559
}
1559
1560
str = end + 1 ;
1560
1561
}
1561
1562
if (is_multicast_ether_addr (addr )) {
1562
- printk (KERN_ERR
1563
- "Attempt to assign a multicast ethernet address to a "
1564
- "device disallowed\n" );
1563
+ netdev_err (dev ,
1564
+ "Attempt to assign a multicast ethernet address to a device disallowed\n" );
1565
1565
goto random ;
1566
1566
}
1567
1567
if (!is_valid_ether_addr (addr )) {
1568
- printk (KERN_ERR
1569
- "Attempt to assign an invalid ethernet address to a "
1570
- "device disallowed\n" );
1568
+ netdev_err (dev ,
1569
+ "Attempt to assign an invalid ethernet address to a device disallowed\n" );
1571
1570
goto random ;
1572
1571
}
1573
1572
if (!is_local_ether_addr (addr )) {
1574
- printk (KERN_WARNING
1575
- "Warning: Assigning a globally valid ethernet "
1576
- "address to a device\n" );
1577
- printk (KERN_WARNING "You should set the 2nd rightmost bit in "
1578
- "the first byte of the MAC,\n" );
1579
- printk (KERN_WARNING "i.e. %02x:%02x:%02x:%02x:%02x:%02x\n" ,
1580
- addr [0 ] | 0x02 , addr [1 ], addr [2 ], addr [3 ], addr [4 ],
1581
- addr [5 ]);
1573
+ netdev_warn (dev , "Warning: Assigning a globally valid ethernet address to a device\n" );
1574
+ netdev_warn (dev , "You should set the 2nd rightmost bit in the first byte of the MAC,\n" );
1575
+ netdev_warn (dev , "i.e. %02x:%02x:%02x:%02x:%02x:%02x\n" ,
1576
+ addr [0 ] | 0x02 , addr [1 ], addr [2 ], addr [3 ], addr [4 ], addr [5 ]);
1582
1577
}
1583
1578
eth_hw_addr_set (dev , addr );
1584
1579
return ;
1585
1580
1586
1581
random :
1587
- printk (KERN_INFO
1588
- "Choosing a random ethernet address for device %s\n" , dev -> name );
1582
+ netdev_info (dev , "Choosing a random ethernet address\n" );
1589
1583
eth_hw_addr_random (dev );
1590
1584
}
1591
1585
@@ -1601,14 +1595,12 @@ static void vector_eth_configure(
1601
1595
1602
1596
device = kzalloc (sizeof (* device ), GFP_KERNEL );
1603
1597
if (device == NULL ) {
1604
- printk (KERN_ERR "eth_configure failed to allocate struct "
1605
- "vector_device\n" );
1598
+ pr_err ("Failed to allocate struct vector_device for vec%d\n" , n );
1606
1599
return ;
1607
1600
}
1608
1601
dev = alloc_etherdev (sizeof (struct vector_private ));
1609
1602
if (dev == NULL ) {
1610
- printk (KERN_ERR "eth_configure: failed to allocate struct "
1611
- "net_device for vec%d\n" , n );
1603
+ pr_err ("Failed to allocate struct net_device for vec%d\n" , n );
1612
1604
goto out_free_device ;
1613
1605
}
1614
1606
@@ -1738,8 +1730,7 @@ static int __init vector_setup(char *str)
1738
1730
1739
1731
err = vector_parse (str , & n , & str , & error );
1740
1732
if (err ) {
1741
- printk (KERN_ERR "vector_setup - Couldn't parse '%s' : %s\n" ,
1742
- str , error );
1733
+ pr_err ("Couldn't parse '%s': %s\n" , str , error );
1743
1734
return 1 ;
1744
1735
}
1745
1736
new = memblock_alloc_or_panic (sizeof (* new ), SMP_CACHE_BYTES );
0 commit comments