Re: [1/2] lis3: Add device owner

From: Guenter Roeck
Date: Fri Oct 01 2010 - 20:05:06 EST


On Tue, Sep 28, 2010 at 04:52:19AM -0400, Yuri Kululin wrote:
[ ... ]
>
> > On a higher level, reassigning the owner like this seems to be quite uncommon,
> > at least in hwmon. I would like to see an Acked-by from Eric to ensure
> > that the fix is correct.
>
> I tried to use the standard way of module usage control because all functions
> provided by lis3lv02d_i2c.c, lis3lv02d_spi.c or hp_accel.c can be called through
> lis3lv02d_misc_fops file ops or joystick poll device.
>
> I can propose another solution. We can use try_module_get(owner) during device
> registration (in lis3lv02d_add_fs()), release module by using module_put(owner)
> after device unregister (in lis3lv02d_remove_fs()) and do not touch
> lis3lv02d_misc_fops. But anyway dev->owner should be set.
>
Key is really to get feedback from others, since I am neither familiar
with module ownership handling nor with this driver.

Thanks,
Guenter
--
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/