lkml.org 
[lkml]   [2001]   [Mar]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: PATCH 2.4.3.6: fix netdevice initialization
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.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:29    [from the cache]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and my Meterkast|Read the blog