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

Dmitry Torokhov
2011-01-02T08:46:48Z

On Thu, Dec 30, 2010 at 11:37:37AM +0100, Fabien Marteau wrote:
> +
> + plat_dat->input_dev->name = "Austria Microsystem as5011 joystick";
> + plat_dat->input_dev->uniq = "Austria0";

This is improper value for 'uniq' which has to be globally unique
identifier (across systems). like a serial number.

> + plat_dat->input_dev->id.bustype = BUS_I2C;
> + plat_dat->input_dev->phys = NULL;

No need to set this to NULL.

> + plat_dat->input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS);
> + plat_dat->input_dev->keybit[BIT_WORD(BTN_JOYSTICK)] =
> + BIT_MASK(BTN_JOYSTICK);

__set_bit() is shorter and generally safer (no chance of writing to
wrong longword).

--
Dmitry