aboutsummaryrefslogtreecommitdiffstats
path: root/arch/um/drivers/net_kern.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/um/drivers/net_kern.c')
-rw-r--r--arch/um/drivers/net_kern.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/arch/um/drivers/net_kern.c b/arch/um/drivers/net_kern.c
index 3c6c44ca1ffa..1e8f41a99511 100644
--- a/arch/um/drivers/net_kern.c
+++ b/arch/um/drivers/net_kern.c
@@ -318,7 +318,7 @@ static void setup_etheraddr(char *str, unsigned char *addr, char *name)
318 if (str == NULL) 318 if (str == NULL)
319 goto random; 319 goto random;
320 320
321 for (i = 0;i < 6; i++) { 321 for (i = 0; i < 6; i++) {
322 addr[i] = simple_strtoul(str, &end, 16); 322 addr[i] = simple_strtoul(str, &end, 16);
323 if ((end == str) || 323 if ((end == str) ||
324 ((*end != ':') && (*end != ',') && (*end != '\0'))) { 324 ((*end != ':') && (*end != ',') && (*end != '\0'))) {
@@ -343,14 +343,13 @@ static void setup_etheraddr(char *str, unsigned char *addr, char *name)
343 } 343 }
344 if (!is_local_ether_addr(addr)) { 344 if (!is_local_ether_addr(addr)) {
345 printk(KERN_WARNING 345 printk(KERN_WARNING
346 "Warning: attempt to assign a globally valid ethernet " 346 "Warning: Assigning a globally valid ethernet "
347 "address to a device\n"); 347 "address to a device\n");
348 printk(KERN_WARNING "You should better enable the 2nd " 348 printk(KERN_WARNING "You should set the 2nd rightmost bit in "
349 "rightmost bit in the first byte of the MAC,\n"); 349 "the first byte of the MAC,\n");
350 printk(KERN_WARNING "i.e. %02x:%02x:%02x:%02x:%02x:%02x\n", 350 printk(KERN_WARNING "i.e. %02x:%02x:%02x:%02x:%02x:%02x\n",
351 addr[0] | 0x02, addr[1], addr[2], addr[3], addr[4], 351 addr[0] | 0x02, addr[1], addr[2], addr[3], addr[4],
352 addr[5]); 352 addr[5]);
353 goto random;
354 } 353 }
355 return; 354 return;
356 355
@@ -368,7 +367,6 @@ static struct platform_driver uml_net_driver = {
368 .name = DRIVER_NAME, 367 .name = DRIVER_NAME,
369 }, 368 },
370}; 369};
371static int driver_registered;
372 370
373static void net_device_release(struct device *dev) 371static void net_device_release(struct device *dev)
374{ 372{
@@ -383,6 +381,12 @@ static void net_device_release(struct device *dev)
383 free_netdev(netdev); 381 free_netdev(netdev);
384} 382}
385 383
384/*
385 * Ensures that platform_driver_register is called only once by
386 * eth_configure. Will be set in an initcall.
387 */
388static int driver_registered;
389
386static void eth_configure(int n, void *init, char *mac, 390static void eth_configure(int n, void *init, char *mac,
387 struct transport *transport) 391 struct transport *transport)
388{ 392{