Hi Harald,
Sorry for the slow response.
On Dec 18, 2007 6:08 AM, Harald Welte <[EMAIL PROTECTED]> wrote:
> +
> + input_dev->name = "Neo1973 Buttons";
> + input_dev->phys = "neo1973kbd/input0";
> + input_dev->id.bustype = BUS_HOST;
> + input_dev->id.vendor = 0x0001;
> + input_dev->id.product = 0x0001;
> + input_dev->id.version = 0x0100;
> + input_dev->cdev.dev = &pdev->dev;
Please use input_dev->dev.parent instead of cdev as it is going away.
> + input_dev->private = neo1973kbd;
Please use input_set_drvdata() instead of accessing private directly.
> +out_aux:
> + input_unregister_device(neo1973kbd->input);
Add neo1973kbd->input = NULL here, otherwise we'll end up doing
input_free_device after input_unregister_device which is no good
(unregister will free the device if it is the last reference).
> +out_register:
> + input_free_device(neo1973kbd->input);
> + platform_set_drvdata(pdev, NULL);
> + kfree(neo1973kbd);
> +
> + return -ENODEV;
> +}
> +
> +static int neo1973kbd_remove(struct platform_device *pdev)
> +{
> + struct neo1973kbd *neo1973kbd = platform_get_drvdata(pdev);
> +
> + free_irq(s3c2410_gpio_getirq(pdev->resource[2].start), neo1973kbd);
> + free_irq(s3c2410_gpio_getirq(pdev->resource[1].start), neo1973kbd);
> + free_irq(s3c2410_gpio_getirq(pdev->resource[0].start), neo1973kbd);
> +
> + input_unregister_device(neo1973kbd->input);
> + input_free_device(neo1973kbd->input);
Same here, input_free_device() is harmful here.
--
Dmitry
-
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at http://vger.kernel.org/majordomo-info.html