netdev
[Top] [All Lists]

Re: unneeded checks/code in some device probes

To: Arnaldo Carvalho de Melo <acme@xxxxxxxxxxxxxxxx>
Subject: Re: unneeded checks/code in some device probes
From: Jeff Garzik <jgarzik@xxxxxxxxxxxxxxxx>
Date: Fri, 11 Aug 2000 03:04:24 -0400
Cc: netdev@xxxxxxxxxxx
Organization: MandrakeSoft
References: <20000809011732.B3477@xxxxxxxxxxxxxxxx>
Sender: owner-netdev@xxxxxxxxxxx
Arnaldo Carvalho de Melo wrote:
> Here is the excerpt:
> 
>         /* We should have a "dev" from Space.c or the static module table. */
>         if (dev == NULL) {
>                 printk("ac3200.c: Passed a NULL device.\n");
>                 dev = init_etherdev(0, 0);
> 
>                 if (!dev)
>                         return -ENOMEM;
>         }
> 
> there are other drivers with this kind of code, being paranoid? I think that 
> we
> may well do this:
> 
>                 if (dev == NULL)
>                                 panic();

Agreed.  It looks like that is debugging code that wound up being
propagated to a few drivers.  For the modular case, the driver includes
its own net_device(s), which are passed to the probe/init routine.  For
the non-modular case, one of the entries in the Space.c device table are
passed to the probe/init routine.

The older net drivers initialization could be made a lot smarter, and
smaller, actually...

        Jeff



-- 
Jeff Garzik              |
Building 1024            | Andre the Giant has a posse.
MandrakeSoft, Inc.       |

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