Input: gpio-keys - add support for setting device name
authorAlexander Stein <alexander.stein@informatik.tu-chemnitz.de>
Tue, 12 Apr 2011 06:34:48 +0000 (23:34 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Tue, 12 Apr 2011 06:53:19 +0000 (23:53 -0700)
This patch allows to set a device name which helps distinguishing several
gpio-keys devices.

Signed-off-by: Alexander Stein <alexander.stein@informatik.tu-chemnitz.de>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
drivers/input/keyboard/gpio_keys.c
include/linux/gpio_keys.h

index 73e58a96ab99dd04c9bfd435938a0a93a0a50907..6e6145b9a4c10b2d84bfd3cce75b1ea12a100b43 100644 (file)
@@ -473,7 +473,7 @@ static int __devinit gpio_keys_probe(struct platform_device *pdev)
        platform_set_drvdata(pdev, ddata);
        input_set_drvdata(input, ddata);
 
-       input->name = pdev->name;
+       input->name = pdata->name ? : pdev->name;
        input->phys = "gpio-keys/input0";
        input->dev.parent = &pdev->dev;
        input->open = gpio_keys_open;
index 3204edfe6b1955f232384c10716d1e0142c7d1ee..b5ca4b2c08ecad2fad00c33d48b62466737966b0 100644 (file)
@@ -22,6 +22,7 @@ struct gpio_keys_platform_data {
        unsigned int rep:1;             /* enable input subsystem auto repeat */
        int (*enable)(struct device *dev);
        void (*disable)(struct device *dev);
+       const char *name;               /* input device name */
 };
 
 #endif