diff options
author | Ben Dooks <ben@simtec.co.uk> | 2009-11-11 00:00:35 -0500 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2009-11-20 03:52:06 -0500 |
commit | db19fd8b3a3e198e84b93fa217acf77e72a4cd35 (patch) | |
tree | 87cf49b790e03e81df8091861fb10f77d4ed5459 | |
parent | fb141597550243b471f3bd526fe689aa3b74df25 (diff) |
Input: gpio_keys - use dev_ macros to report information
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>
-rw-r--r-- | drivers/input/keyboard/gpio_keys.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gpio_keys.c index 77d130914259..5c8e2113cb34 100644 --- a/drivers/input/keyboard/gpio_keys.c +++ b/drivers/input/keyboard/gpio_keys.c | |||
@@ -78,6 +78,7 @@ static int __devinit gpio_keys_probe(struct platform_device *pdev) | |||
78 | { | 78 | { |
79 | struct gpio_keys_platform_data *pdata = pdev->dev.platform_data; | 79 | struct gpio_keys_platform_data *pdata = pdev->dev.platform_data; |
80 | struct gpio_keys_drvdata *ddata; | 80 | struct gpio_keys_drvdata *ddata; |
81 | struct device *dev = &pdev->dev; | ||
81 | struct input_dev *input; | 82 | struct input_dev *input; |
82 | int i, error; | 83 | int i, error; |
83 | int wakeup = 0; | 84 | int wakeup = 0; |
@@ -87,6 +88,7 @@ static int __devinit gpio_keys_probe(struct platform_device *pdev) | |||
87 | GFP_KERNEL); | 88 | GFP_KERNEL); |
88 | input = input_allocate_device(); | 89 | input = input_allocate_device(); |
89 | if (!ddata || !input) { | 90 | if (!ddata || !input) { |
91 | dev_err(dev, "failed to allocate state\n"); | ||
90 | error = -ENOMEM; | 92 | error = -ENOMEM; |
91 | goto fail1; | 93 | goto fail1; |
92 | } | 94 | } |
@@ -122,14 +124,14 @@ static int __devinit gpio_keys_probe(struct platform_device *pdev) | |||
122 | 124 | ||
123 | error = gpio_request(button->gpio, button->desc ?: "gpio_keys"); | 125 | error = gpio_request(button->gpio, button->desc ?: "gpio_keys"); |
124 | if (error < 0) { | 126 | if (error < 0) { |
125 | pr_err("gpio-keys: failed to request GPIO %d," | 127 | dev_err(dev, "failed to request GPIO %d, error %d\n", |
126 | " error %d\n", button->gpio, error); | 128 | button->gpio, error); |
127 | goto fail2; | 129 | goto fail2; |
128 | } | 130 | } |
129 | 131 | ||
130 | error = gpio_direction_input(button->gpio); | 132 | error = gpio_direction_input(button->gpio); |
131 | if (error < 0) { | 133 | if (error < 0) { |
132 | pr_err("gpio-keys: failed to configure input" | 134 | dev_err(dev, "failed to configure" |
133 | " direction for GPIO %d, error %d\n", | 135 | " direction for GPIO %d, error %d\n", |
134 | button->gpio, error); | 136 | button->gpio, error); |
135 | gpio_free(button->gpio); | 137 | gpio_free(button->gpio); |
@@ -139,8 +141,8 @@ static int __devinit gpio_keys_probe(struct platform_device *pdev) | |||
139 | irq = gpio_to_irq(button->gpio); | 141 | irq = gpio_to_irq(button->gpio); |
140 | if (irq < 0) { | 142 | if (irq < 0) { |
141 | error = irq; | 143 | error = irq; |
142 | pr_err("gpio-keys: Unable to get irq number" | 144 | dev_err(dev, "Unable to get irq number " |
143 | " for GPIO %d, error %d\n", | 145 | "for GPIO %d, error %d\n", |
144 | button->gpio, error); | 146 | button->gpio, error); |
145 | gpio_free(button->gpio); | 147 | gpio_free(button->gpio); |
146 | goto fail2; | 148 | goto fail2; |
@@ -152,7 +154,7 @@ static int __devinit gpio_keys_probe(struct platform_device *pdev) | |||
152 | button->desc ? button->desc : "gpio_keys", | 154 | button->desc ? button->desc : "gpio_keys", |
153 | bdata); | 155 | bdata); |
154 | if (error) { | 156 | if (error) { |
155 | pr_err("gpio-keys: Unable to claim irq %d; error %d\n", | 157 | dev_err(dev, "Unable to claim irq %d; error %d\n", |
156 | irq, error); | 158 | irq, error); |
157 | gpio_free(button->gpio); | 159 | gpio_free(button->gpio); |
158 | goto fail2; | 160 | goto fail2; |
@@ -166,7 +168,7 @@ static int __devinit gpio_keys_probe(struct platform_device *pdev) | |||
166 | 168 | ||
167 | error = input_register_device(input); | 169 | error = input_register_device(input); |
168 | if (error) { | 170 | if (error) { |
169 | pr_err("gpio-keys: Unable to register input device, " | 171 | dev_err(dev, "Unable to register input device, " |
170 | "error: %d\n", error); | 172 | "error: %d\n", error); |
171 | goto fail2; | 173 | goto fail2; |
172 | } | 174 | } |