Re: [Uclinux-dist-devel] [PATCH v2] input/misc: new ADXL345/346 driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Oct 16, 2009 at 00:36, Dmitry Torokhov wrote:
> On Wed, Oct 14, 2009 at 06:54:40AM -0400, Mike Frysinger wrote:
>> +/* Stub functions so we can load/unload the module */
>> +static __init int adxl34x_init(void)
>> +{
>> +     return 0;
>> +}
>> +module_init(adxl34x_init);
>> +
>> +static __exit void adxl34x_exit(void)
>> +{
>> +}
>> +module_exit(adxl34x_exit);
>
> Huh?
>
> [root@dtor-d630 ~]# modprobe input_polldev
> [root@dtor-d630 ~]# lsmod | grep input
> input_polldev           2996  0
> uinput                  7353  0
> [root@dtor-d630 ~]# rmmod input_polldev
> [root@dtor-d630 ~]# lsmod | grep input
> uinput                  7353  0
> [root@dtor-d630 ~]# grep -c module_exit ~dtor/kernel/work/drivers/input/input-polldev.c
> 0
> [root@dtor-d630 ~]#

your output doesnt tell the whole story.  the trick is that if you
declare a module_init() but no module_exit(), the kernel wont let you
unload it.  i thought it was a matter of no module_exit(), not an
unbalanced pair.

i'll send an updated ad714x driver too since it does the same thing.

>> +struct device;
>> +struct adxl34x;
>> +typedef int (adxl34x_read_t) (struct device *, unsigned char);
>> +typedef int (adxl34x_read_block_t) (struct device *, unsigned char, int, unsigned char *);
>> +typedef int (adxl34x_write_t) (struct device *, unsigned char, unsigned char);
>> +
>> +void adxl34x_disable(struct adxl34x *ac);
>> +void adxl34x_enable(struct adxl34x *ac);
>> +int adxl34x_probe(struct adxl34x **pac, struct device *dev, u16 bus_type,
>> +     int irq, int fifo_delay_default, adxl34x_read_t read,
>> +     adxl34x_read_block_t read_block, adxl34x_write_t write);
>
> Too many arguments... I think creating "struct adxl34x_ops" is called
> for.

guess i should do the same with the ad714x driver ?

>> --- /dev/null
>> +++ b/include/linux/input/adxl34x.h
>
> Tabs & spaces.

i went through all of the driver code but i guess i forgot to check the header

> Put this in your .vimrc:

well, none of us use vim, so doesnt really matter ;)
-mike
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux