[PATCH 1/2] hwmon: add generic GPIO fan driver

Guenter Roeck
2010-10-20T00:50:26Z

Hi Simon,

On Tue, 2010-10-19 at 20:19 -0400, Simon Guinot wrote:
> Hi Guenter,
>
> On Tue, Oct 19, 2010 at 03:03:45PM -0700, Guenter Roeck wrote:
> > Hi Simon,
> >
> > one more comment ...
> >
> > On Sun, 2010-10-17 at 11:50 -0400, Simon Guinot wrote:
> > [ ... ]
> > > +static int __devinit
> > > +fan_alarm_init(struct gpio_fan_data *fan_data, struct gpio_fan_alarm *alarm)
> > > +{
> >
> > __devinit and __devexit can cause problems if this driver is built into
> > the kernel, but the underlying i2c master driver is built as module.
>
> I am not sure I understand this. Are you talking about a I2C GPIO
> expander ? or about the hwmon registration process ?

Not related to I2C specifically, since you don't use I2C. No idea why I
mentioned I2C, really. Probably because I had I2C in my mind.

Anyway, there are gpio drivers which can be loaded and unloaded. GPIO
pin(s) on one of those could point to the gpio-fan driver. If gpio-fan
is built into the kernel, but the underlying gpio driver is built as
module, loading the gpio driver might cause the gpio-fan probe function
to be called - but that function no longer exists if it is tagged as
__devinit.

Browsing through the gpio code, it seems the problem doesn't really
exist, since the above scenario does not happen (unless I am missing
something, of course). Also, other drivers using gpio calls also use
__devinit and __devexit. So just ignore what I said.

Guenter