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

From: Dmitry Torokhov
Date: Sun Jan 02 2011 - 03:46:50 EST


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
--
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/