Re: [PATCH] input: joystick: Adding Austria Microsystem AS5011 joystick driver (third version)

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Trilok Soni
Date: Tuesday, January 4, 2011 - 4:01 am

Hi Fabien,

On 1/4/2011 3:17 PM, Fabien Marteau wrote:

Looks good. Few comments.


How about moving it to include/linux/input?


Are you using anything from this file? Please audit this list and remove
the files which are not used. Thanks.


I don't find anybody using these #defines. Please remove the defines which
are not used.


We return '0' on success and negative error code for error.


I don't find gpio_request call for this gpio anywhere in this driver. I prefer
that we do that for each gpio we use in the driver itself. Only muxing stuff
can be left out in your init/exit hooks.


I prefer that i2c_read wrapper here would return the actual error code instead,
and have one function argument to return the "x, y" co-ordinates, that way
we don't loose the error codes, and return from here itself if i2c read fails.


Please explain this lock. Sorry if I have missed out your explanation in the earlier threads.


const please. 


Why don't we return same error code instead of overwriting it here?


Would you prefer to move some of the initialization of the chip except
reset of controller to open() call, so that if there is no user of this
device than we don't need to leave this device left configured?


nit-pick: I prefer that we put module_init/exit macros with their relevant functions.


These private stuff should not be part of your platform data structure. When we say
platform data meaning that it will be all public with "const". Please allocate
local data structure in the probe itself with these private members. You can refer
other drivers.


---Trilok Soni

-- 
Sent by a consultant of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH] input: joystick: Adding Austria Microsystem ..., Trilok Soni, (Tue Jan 4, 4:01 am)