Input: gpio_keys - use dev_ macros to report information
authorBen Dooks <ben@simtec.co.uk>
Wed, 11 Nov 2009 05:00:35 +0000 (21:00 -0800)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Fri, 20 Nov 2009 08:52:06 +0000 (00:52 -0800)
The gpio_keys driver is binding to a platform device but using pr_err()
to report errors. Change to using dev_err() so that all messages are
prefixed by the device name.

Signed-off-by: Ben Dooks <ben@simtec.co.uk>
Signed-off-by: Simtec Linux Team <linux@simtec.co.uk>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
drivers/input/keyboard/gpio_keys.c

index 77d130914259ae68419d3781452bf57e494d5d27..5c8e2113cb349c10c8bdebbdafad7bb07b26be35 100644 (file)
@@ -78,6 +78,7 @@ static int __devinit gpio_keys_probe(struct platform_device *pdev)
 {
        struct gpio_keys_platform_data *pdata = pdev->dev.platform_data;
        struct gpio_keys_drvdata *ddata;
+       struct device *dev = &pdev->dev;
        struct input_dev *input;
        int i, error;
        int wakeup = 0;
@@ -87,6 +88,7 @@ static int __devinit gpio_keys_probe(struct platform_device *pdev)
                        GFP_KERNEL);
        input = input_allocate_device();
        if (!ddata || !input) {
+               dev_err(dev, "failed to allocate state\n");
                error = -ENOMEM;
                goto fail1;
        }
@@ -122,14 +124,14 @@ static int __devinit gpio_keys_probe(struct platform_device *pdev)
 
                error = gpio_request(button->gpio, button->desc ?: "gpio_keys");
                if (error < 0) {
-                       pr_err("gpio-keys: failed to request GPIO %d,"
-                               " error %d\n", button->gpio, error);
+                       dev_err(dev, "failed to request GPIO %d, error %d\n",
+                               button->gpio, error);
                        goto fail2;
                }
 
                error = gpio_direction_input(button->gpio);
                if (error < 0) {
-                       pr_err("gpio-keys: failed to configure input"
+                       dev_err(dev, "failed to configure"
                                " direction for GPIO %d, error %d\n",
                                button->gpio, error);
                        gpio_free(button->gpio);
@@ -139,8 +141,8 @@ static int __devinit gpio_keys_probe(struct platform_device *pdev)
                irq = gpio_to_irq(button->gpio);
                if (irq < 0) {
                        error = irq;
-                       pr_err("gpio-keys: Unable to get irq number"
-                               " for GPIO %d, error %d\n",
+                       dev_err(dev, "Unable to get irq number "
+                               "for GPIO %d, error %d\n",
                                button->gpio, error);
                        gpio_free(button->gpio);
                        goto fail2;
@@ -152,7 +154,7 @@ static int __devinit gpio_keys_probe(struct platform_device *pdev)
                                    button->desc ? button->desc : "gpio_keys",
                                    bdata);
                if (error) {
-                       pr_err("gpio-keys: Unable to claim irq %d; error %d\n",
+                       dev_err(dev, "Unable to claim irq %d; error %d\n",
                                irq, error);
                        gpio_free(button->gpio);
                        goto fail2;
@@ -166,7 +168,7 @@ static int __devinit gpio_keys_probe(struct platform_device *pdev)
 
        error = input_register_device(input);
        if (error) {
-               pr_err("gpio-keys: Unable to register input device, "
+               dev_err(dev, "Unable to register input device, "
                        "error: %d\n", error);
                goto fail2;
        }