{
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;
GFP_KERNEL);
input = input_allocate_device();
if (!ddata || !input) {
+ dev_err(dev, "failed to allocate state\n");
error = -ENOMEM;
goto fail1;
}
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);
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;
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;
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;
}