netdev
[Top] [All Lists]

Re: PATCH 2.4.3.6: fix netdevice initialization

To: Andrew Morton <andrewm@xxxxxxxxxx>
Subject: Re: PATCH 2.4.3.6: fix netdevice initialization
From: Jeff Garzik <jgarzik@xxxxxxxxxxxxxxxx>
Date: Wed, 21 Mar 2001 10:41:00 -0500
Cc: Linux Kernel Mailing List <linux-kernel@xxxxxxxxxxxxxxx>, netdev@xxxxxxxxxxx, Linus Torvalds <torvalds@xxxxxxxxxxxxx>, "David S. Miller" <davem@xxxxxxxxxx>
Organization: MandrakeSoft
References: <3AB8BA16.A25C0929@xxxxxxxxxxxxxxxx> <3AB8C6EE.5EF6BA90@xxxxxxxxxx>
Sender: owner-netdev@xxxxxxxxxxx
Andrew Morton wrote:
> We should propagate dev_alloc_name's return value:
> And register_netdevice's, so

ok


> More significantly, the driver probe functions now become:
> 
> xxx_probe()
> {
>         dev = alloc_etherdev(sizeof(xxx_private));
>         ...
>         printk(KERN_INFO "%s: stuff\n", dev->name);
>         ...
>         ret = register_netdev(dev);
>         if (ret < 0)
>                 kfree(ret);
>         return ret;
> }
> 
> yes?

correct.


> And the printk() will say "eth%d: stuff", so we'll need to
> change the messages:
> 
> -       printk(KERN_INFO "%s: stuff\n", dev->name);
> +       printk(KERN_INFO "xxx: stuff\n");
> 
> Correct?

correct.  For PCI drivers, change to something like

  printk(KERN_INFO "tulip(%s): stuff\n", pci_dev->slot_name);

> My quibble with this is things like wait_for_completion(),
> which are called from both the probe() function and
> the mainline driver code.  These also print dev->name,
> and there's no obvious fix for that.

hrm.  I'm not sure it's necessary to pass driver_name to alloc_etherdev
(to set dev->name), just to be able to reference solely from the driver
during the probe phase.  Further there is a dev->name size limit you
will run into with "myverylongdrivernameskimbosh."

Just pass 'name' arg to wait_for_completion ;-)

-- 
Jeff Garzik       | May you have warm words on a cold evening,
Building 1024     | a full mooon on a dark night,
MandrakeSoft      | and a smooth road all the way to your door.

<Prev in Thread] Current Thread [Next in Thread>