Re: [RFC] [PATCH V2 1/2] input: CMA3000 Accelerometer driver

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Dmitry Torokhov
Date: Sunday, August 29, 2010 - 11:49 am

Hi Hemanth,

On Fri, May 21, 2010 at 12:22:57PM +0530, Hemanth V wrote:

Why is it boolean? It should be possible to configure it as a module.


Is SYSFS a hard dependency? Why?

Overall I think you should have a symbol enabling CMA3000 core and then
sub-drivers enabling I2C and SPI interface parts. See adxl134x driver
for the pattern I am looking for. Now that I am done reading the driver
you seem to be pretty much there, just Kconfig needs to be massaged a
bit.


Please try keep Makefile and Kconfig alphabetically ordered.



Do not like repeated release of resources in main and error path... Can
we do it like:

	...
	disable_irq();
	error = cma3000_set(data, CMA3000_CTRL, ctrl, "ctrl");
	if (!error) {
		/* Settling time delay required after mode change */
		msleep(CMA3000_SETDELAY);
	}
	enable_irq();
out:
	mutex_unlock();
	return error ? error : count;



What is the utility of the driver when there is no IRQ line?


How can data be NULL here?


Do not call input_free_device() after input_unregister_device().


You should not call input_free_device() after input_unregister_device().


I'd move this up, before you marked mutex as destroyed...


Do you expect SPI version to have significantly different platform data?
Should it be moved out of include/linux/i2c/?

Thanks.

-- 
Dmitry
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [RFC] [PATCH V2 1/2] input: CMA3000 Accelerometer driver, Jonathan Cameron, (Fri May 21, 4:57 am)
Re: [RFC] [PATCH V2 1/2] input: CMA3000 Accelerometer driver, Dmitry Torokhov, (Sun Aug 29, 11:24 am)
Re: [RFC] [PATCH V2 1/2] input: CMA3000 Accelerometer driver, Dmitry Torokhov, (Sun Aug 29, 11:49 am)
Re: Sensors and the input layer (was Re: [RFC] [PATCH V2 1 ..., Jonathan Cameron, (Mon Aug 30, 10:41 am)
Re: Sensors and the input layer (was Re: [RFC] [PATCH V2 1 ..., Mohamed Ikbel Boulabiar, (Tue Aug 31, 10:24 am)
Re: Sensors and the input layer (was Re: [RFC] [PATCH V2 1 ..., Jonathan Cameron, (Tue Aug 31, 11:03 am)
Re: Sensors and the input layer (was Re: [RFC] [PATCH V2 1 ..., Jonathan Cameron, (Tue Aug 31, 11:14 am)
Re: Sensors and the input layer (was Re: [RFC] [PATCH V2 1 ..., Jonathan Cameron, (Tue Aug 31, 11:20 am)