Messages in this thread | | | Date | Sun, 8 Feb 2004 20:06:47 +0100 (MET) | From | Geert Uytterhoeven <> | Subject | Re: [PATCH 405] Amiga Hydra Ethernet new driver model |
| |
On Sun, 8 Feb 2004, Adrian Bunk wrote: > On Sun, Feb 08, 2004 at 04:28:29PM +0100, Geert Uytterhoeven wrote: > > Hydra Ethernet: Convert to the new driver model > > > > --- linux-2.6.3-rc1/drivers/net/hydra.c 2004-02-08 10:19:34.000000000 +0100 > > +++ linux-m68k-2.6.3-rc1/drivers/net/hydra.c 2004-02-08 11:47:55.000000000 +0100 > >... > > -static int __init hydra_init(unsigned long board); > > +static int __devinit hydra_init_one(struct zorro_dev *z, > > + const struct zorro_device_id *ent); > > +static int __init hydra_init(struct zorro_dev *z); > >... > > +static int __devinit hydra_init_one(struct zorro_dev *z, > > + const struct zorro_device_id *ent) > > +{ > > + int err; > > > > - return err; > > + if (!request_mem_region(z->resource.start, 0x10000, "Hydra")) > > + return -EBUSY; > > + if ((err = hydra_init(z))) { > > + release_mem_region(z->resource.start, 0x10000); > > + return -EBUSY; > > + } > > + return 0; > > } > >... > > __init hydra_init called from __devinit hydra_init_one ? > > This will break when compiling the driver statically into a kernel with > CONFIG_HOTPLUG=y .
Thanks, you're right!
I checked the other drivers, and zorro8390.c has the same problem with zorro8390_init(). I'll fix them and will resend after 2.6.3.
BTW, while verifying the rules w.r.t. the various __*it markers, I stumbled across this in Documentation/pci.txt (while it's not really PCI-related):
| Tips: | The module_init()/module_exit() functions (and all initialization | functions called only from these) should be marked __init/exit. | The struct pci_driver shouldn't be marked with any of these tags. | The ID table array should be marked __devinitdata. | The probe() and remove() functions (and all initialization | functions called only from these) should be marked __devinit/exit. | If you are sure the driver is not a hotplug driver then use only | __init/exit __initdata/exitdata. | | Pointers to functions marked as __devexit must be created using | __devexit_p(function_name). That will generate the function | name or NULL if the __devexit function will be discarded.
But a quick look shows that very few drivers seem to mark their ID table array __devinitdata...
Gr{oetje,eeting}s,
Geert
-- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds - 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/
| |