[Top] [All Lists]

Re: [PATCH] skfddi - convert to new pci model.

To: Stephen Hemminger <shemminger@xxxxxxxx>
Subject: Re: [PATCH] skfddi - convert to new pci model.
From: Alexander Viro <aviro@xxxxxxxxxx>
Date: Thu, 4 Dec 2003 19:59:16 -0500
Cc: Jeff Garzik <jgarzik@xxxxxxxxx>, netdev@xxxxxxxxxxx, Alexander Viro <aviro@xxxxxxxxxx>
In-reply-to: <20031204163928.0f34d5d1.shemminger@xxxxxxxx>
References: <20031204163928.0f34d5d1.shemminger@xxxxxxxx>
Sender: netdev-bounce@xxxxxxxxxxx
User-agent: Mutt/1.4.1i
On Thu, Dec 04, 2003 at 04:39:28PM -0800, Stephen Hemminger wrote:
> +     dev->irq = pdev->irq;
>       dev->get_stats = &skfp_ctl_get_stats;
>       dev->open = &skfp_open;
>       dev->stop = &skfp_close;
> +     dev->init = &skfp_driver_init;

Ehh...  Don't do that, please.  net_device ->init() means trouble,
since getting failure from register_netdev() gives you no clue
whether it had failed before, during or after ->init().  Makes
for an interesting cleanup...

You can do that if required cleanup can be deduced from the state
of *dev after register_netdev() failure (e.g. if no cleanup is
ever needed), but generally it's less PITA to just call the
damn function directly before register_netdev() and leave ->init NULL.

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