Re: [RFC, PATCH] watchdog on gpio
From: Alan Cox
Date: Mon Jan 14 2008 - 04:31:54 EST
> > Saves memory - you can't make inlined strings __initdata without breaking
> > some compilers. So it is correct.
>
> you could make the same argument about all strings used in all __init
> functions. making a special case for this one string is just
> confusing. this is also used from the *platfrom driver probe*
> function, not the *module init* function, which means it should be
> __devinitdata (see below) ... which quickly adds to the
> confusion/craziness.
Not neccessarily see below. For strings there is a tricky tradeoff
between space on embedded boxes and simplicity. On a 2GB desktop PC the
decision is fairly trivial, on a PDA it gets a bit more important.
> > > > +static int __init gpio_wdt_probe(struct platform_device *pdev)
> > >
> > > shouldnt this be __devinit ?
> >
> > IFF the device can be found/removed dynamically.
>
> wont __init get freed once the module has finished loading ?
If your platform creates the device statically (as a lot of embedded
platforms do) then the __init is fine. The platform register in
init_module will call back the driver probe method and attach the device
before the init_module exits.
Alan
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/