>-----Original Message-----
>From: Mike Frysinger [mailto:[email protected]]
>Sent: Tuesday, March 17, 2009 2:10 PM
>To: [email protected]
>Cc: [email protected]
>Subject: Re: [Linux-kernel-commits] [6188]
trunk/drivers/input/keyboard: [#4375] ADP5520
>Multifunction LCD Backlight and Keypad Input Device
>
>On Tue, Mar 17, 2009 at 08:57,  <[email protected]> wrote:
>> --- trunk/drivers/input/keyboard/Kconfig
>> +++ trunk/drivers/input/keyboard/Kconfig
>> @@ -341,4 +341,12 @@
>> +config KEYBOARD_ADP5520
>> +    tristate "Keypad Support for ADP5520 PMIC"
>> +    depends on PMIC_ADP5520
>> +    help
>> +      This option enables support for the keypad scan matrix
>> +      on Analog Devices ADP5520 PMICs.
>> +
>
>add module name info ?
>
>> --- trunk/drivers/input/keyboard/adp5520-keys.c
>> +++ trunk/drivers/input/keyboard/adp5520-keys.c
>> @@ -0,0 +1,216 @@
>> +static int __devinit adp5520_keys_probe(struct platform_device
*pdev)
>> +....
>> +    dev = kzalloc(sizeof(struct adp5520_keys), GFP_KERNEL);
>
>sizeof(*dev)
>
>> +    input = input_allocate_device();
>> +    if (!input) {
>> +            kfree(dev);
>> +            return -ENOMEM;
>> +    }
>
>ret = -ENOMEM;
>goto err;
>
>> +    ret = input_register_device(input);
>> +    if (ret) {
>> +            dev_err(&pdev->dev,
>> +                    ": Unable to register input device (%d)\n",
ret);
>> +            input_free_device(input);
>> +            goto err;
>
>why not use err1 ?

In case input_register_device fails - I'm not supposed to call
input_unregister_device()


*
 * This function should only be used if input_register_device()
 * was not called yet or if it failed. Once device was registered
 * use input_unregister_device() and memory will be freed once last
 * reference to the device is dropped.
 *
 * Device should be allocated by input_allocate_device().
 *
 * NOTE: If there are references to the input device then memory
 * will not be freed until last reference is dropped.
 */
void input_free_device(struct input_dev *dev)
{
        if (dev)
                input_put_device(dev);
}

-Michael

>-mike



_______________________________________________
Linux-kernel-commits mailing list
[email protected]
http://blackfin.uclinux.org/mailman/listinfo/linux-kernel-commits

Reply via email to