From 6828b4bb7632051cdf925ad0b2f1ba3f906c5d47 Mon Sep 17 00:00:00 2001 From: Kees Cook Date: Wed, 24 Oct 2012 23:53:02 -0700 Subject: Input: remove CONFIG_EXPERIMENTAL from keyboard drivers This config item has not carried much meaning for a while now and is almost always enabled by default. As agreed during the Linux kernel summit, remove it. Signed-off-by: Kees Cook Signed-off-by: Dmitry Torokhov --- drivers/input/keyboard/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/input/keyboard') diff --git a/drivers/input/keyboard/Kconfig b/drivers/input/keyboard/Kconfig index c50fa75416f..f483ce65157 100644 --- a/drivers/input/keyboard/Kconfig +++ b/drivers/input/keyboard/Kconfig @@ -134,7 +134,7 @@ config KEYBOARD_QT1070 config KEYBOARD_QT2160 tristate "Atmel AT42QT2160 Touch Sensor Chip" - depends on I2C && EXPERIMENTAL + depends on I2C help If you say yes here you get support for Atmel AT42QT2160 Touch Sensor chip as a keyboard input. -- cgit v1.2.3 From a6e8c0a25377e27958b11b20e1927885ae7c9857 Mon Sep 17 00:00:00 2001 From: Javier Martin Date: Wed, 24 Oct 2012 23:55:01 -0700 Subject: Input: qt2160 - fix qt2160_write() implementation The previous implementation of qt2160_write() didn't work properly because the value was actually not written to the device. Probably nobody detected this because the only write that was issued was the one related to auto calibration. In order to fix the problem use a similar aproach as qt1070 instead. Signed-off-by: Javier Martin Signed-off-by: Dmitry Torokhov --- drivers/input/keyboard/qt2160.c | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) (limited to 'drivers/input/keyboard') diff --git a/drivers/input/keyboard/qt2160.c b/drivers/input/keyboard/qt2160.c index e7a5e36e120..73ea4b04d4f 100644 --- a/drivers/input/keyboard/qt2160.c +++ b/drivers/input/keyboard/qt2160.c @@ -207,23 +207,14 @@ static int __devinit qt2160_read(struct i2c_client *client, u8 reg) static int __devinit qt2160_write(struct i2c_client *client, u8 reg, u8 data) { - int error; - - error = i2c_smbus_write_byte(client, reg); - if (error) { - dev_err(&client->dev, - "couldn't send request. Returned %d\n", error); - return error; - } + int ret; - error = i2c_smbus_write_byte(client, data); - if (error) { + ret = i2c_smbus_write_byte_data(client, reg, data); + if (ret < 0) dev_err(&client->dev, - "couldn't write data. Returned %d\n", error); - return error; - } + "couldn't write data. Returned %d\n", ret); - return error; + return ret; } -- cgit v1.2.3 From 4e99aab78ab2adf7645b7f58b2b549e6ea205dd7 Mon Sep 17 00:00:00 2001 From: Ulf Hansson Date: Sat, 3 Nov 2012 12:16:51 -0700 Subject: Input: nomadik-ske-keypad - fixup use of clk Do proper error handling for clk and make sure clocks are being prepared|unprepared as well as enabled|disabled. Signed-off-by: Ulf Hansson Acked-by: Linus Walleij Signed-off-by: Dmitry Torokhov --- drivers/input/keyboard/nomadik-ske-keypad.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'drivers/input/keyboard') diff --git a/drivers/input/keyboard/nomadik-ske-keypad.c b/drivers/input/keyboard/nomadik-ske-keypad.c index 49f5fa64e0b..95dcc9bdeec 100644 --- a/drivers/input/keyboard/nomadik-ske-keypad.c +++ b/drivers/input/keyboard/nomadik-ske-keypad.c @@ -287,14 +287,19 @@ static int __init ske_keypad_probe(struct platform_device *pdev) keypad->keymap, input); if (error) { dev_err(&pdev->dev, "Failed to build keymap\n"); - goto err_iounmap; + goto err_clk; } input_set_capability(input, EV_MSC, MSC_SCAN); if (!plat->no_autorepeat) __set_bit(EV_REP, input->evbit); - clk_enable(keypad->clk); + error = clk_prepare_enable(keypad->clk); + if (error) { + dev_err(&pdev->dev, "Failed to prepare/enable clk\n"); + goto err_clk; + } + /* go through board initialization helpers */ if (keypad->board->init) @@ -330,7 +335,8 @@ static int __init ske_keypad_probe(struct platform_device *pdev) err_free_irq: free_irq(keypad->irq, keypad); err_clk_disable: - clk_disable(keypad->clk); + clk_disable_unprepare(keypad->clk); +err_clk: clk_put(keypad->clk); err_iounmap: iounmap(keypad->reg_base); @@ -351,7 +357,7 @@ static int __devexit ske_keypad_remove(struct platform_device *pdev) input_unregister_device(keypad->input); - clk_disable(keypad->clk); + clk_disable_unprepare(keypad->clk); clk_put(keypad->clk); if (keypad->board->exit) -- cgit v1.2.3 From d852f9597359babcc3f6b328cefc151ab6995d00 Mon Sep 17 00:00:00 2001 From: Ulf Hansson Date: Sat, 3 Nov 2012 12:16:55 -0700 Subject: Input: nomadik-ske-keypad - start using the apb_pclk Previously this clock was handled internally by the clockdriver, but now this is separate clk. So we need take care of it. Signed-off-by: Ulf Hansson Acked-by: Linus Walleij Signed-off-by: Dmitry Torokhov --- drivers/input/keyboard/nomadik-ske-keypad.c | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'drivers/input/keyboard') diff --git a/drivers/input/keyboard/nomadik-ske-keypad.c b/drivers/input/keyboard/nomadik-ske-keypad.c index 95dcc9bdeec..a1a9375f18f 100644 --- a/drivers/input/keyboard/nomadik-ske-keypad.c +++ b/drivers/input/keyboard/nomadik-ske-keypad.c @@ -67,6 +67,7 @@ struct ske_keypad { const struct ske_keypad_platform_data *board; unsigned short keymap[SKE_KPD_NUM_ROWS * SKE_KPD_NUM_COLS]; struct clk *clk; + struct clk *pclk; spinlock_t ske_keypad_lock; }; @@ -271,11 +272,18 @@ static int __init ske_keypad_probe(struct platform_device *pdev) goto err_free_mem_region; } + keypad->pclk = clk_get(&pdev->dev, "apb_pclk"); + if (IS_ERR(keypad->pclk)) { + dev_err(&pdev->dev, "failed to get pclk\n"); + error = PTR_ERR(keypad->pclk); + goto err_iounmap; + } + keypad->clk = clk_get(&pdev->dev, NULL); if (IS_ERR(keypad->clk)) { dev_err(&pdev->dev, "failed to get clk\n"); error = PTR_ERR(keypad->clk); - goto err_iounmap; + goto err_pclk; } input->id.bustype = BUS_HOST; @@ -294,10 +302,16 @@ static int __init ske_keypad_probe(struct platform_device *pdev) if (!plat->no_autorepeat) __set_bit(EV_REP, input->evbit); + error = clk_prepare_enable(keypad->pclk); + if (error) { + dev_err(&pdev->dev, "Failed to prepare/enable pclk\n"); + goto err_clk; + } + error = clk_prepare_enable(keypad->clk); if (error) { dev_err(&pdev->dev, "Failed to prepare/enable clk\n"); - goto err_clk; + goto err_pclk_disable; } @@ -336,8 +350,12 @@ err_free_irq: free_irq(keypad->irq, keypad); err_clk_disable: clk_disable_unprepare(keypad->clk); +err_pclk_disable: + clk_disable_unprepare(keypad->pclk); err_clk: clk_put(keypad->clk); +err_pclk: + clk_put(keypad->pclk); err_iounmap: iounmap(keypad->reg_base); err_free_mem_region: -- cgit v1.2.3 From 1eee4af30e9261114e6e4e3576f130780124d7be Mon Sep 17 00:00:00 2001 From: Deepak Sikri Date: Thu, 8 Nov 2012 16:35:27 -0800 Subject: Input: spear-keyboard - fix for balancing the enable_irq_wake This patch handles the fix for unbalanced irq for the cases when enable_irq_wake fails, and a warning related to same is displayed on the console. The workaround is handled at the driver level. Signed-off-by: Deepak Sikri Signed-off-by: Viresh Kumar Signed-off-by: Dmitry Torokhov --- drivers/input/keyboard/spear-keyboard.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'drivers/input/keyboard') diff --git a/drivers/input/keyboard/spear-keyboard.c b/drivers/input/keyboard/spear-keyboard.c index c7ca97f44bf..7685b476d6c 100644 --- a/drivers/input/keyboard/spear-keyboard.c +++ b/drivers/input/keyboard/spear-keyboard.c @@ -60,10 +60,11 @@ struct spear_kbd { struct clk *clk; unsigned int irq; unsigned int mode; + unsigned int suspended_rate; unsigned short last_key; unsigned short keycodes[NUM_ROWS * NUM_COLS]; bool rep; - unsigned int suspended_rate; + bool irq_wake_enabled; u32 mode_ctl_reg; }; @@ -333,7 +334,8 @@ static int spear_kbd_suspend(struct device *dev) mode_ctl_reg = readl_relaxed(kbd->io_base + MODE_CTL_REG); if (device_may_wakeup(&pdev->dev)) { - enable_irq_wake(kbd->irq); + if (!enable_irq_wake(kbd->irq)) + kbd->irq_wake_enabled = true; /* * reprogram the keyboard operating frequency as on some @@ -379,7 +381,10 @@ static int spear_kbd_resume(struct device *dev) mutex_lock(&input_dev->mutex); if (device_may_wakeup(&pdev->dev)) { - disable_irq_wake(kbd->irq); + if (kbd->irq_wake_enabled) { + kbd->irq_wake_enabled = false; + disable_irq_wake(kbd->irq); + } } else { if (input_dev->users) clk_enable(kbd->clk); -- cgit v1.2.3 From 6102752eb354cca8fb751d8bace2c1ad4efffdde Mon Sep 17 00:00:00 2001 From: Viresh Kumar Date: Thu, 8 Nov 2012 21:41:24 -0800 Subject: Input: spear-keyboard - switch to using managed resources This patch frees spear-keyboard driver from burden of freeing resources :) devm_* derivatives of multiple routines are used while allocating resources, which would be freed automatically by kernel. Signed-off-by: Viresh Kumar Signed-off-by: Dmitry Torokhov --- drivers/input/keyboard/spear-keyboard.c | 77 ++++++++++----------------------- 1 file changed, 23 insertions(+), 54 deletions(-) (limited to 'drivers/input/keyboard') diff --git a/drivers/input/keyboard/spear-keyboard.c b/drivers/input/keyboard/spear-keyboard.c index 7685b476d6c..da914fea0c1 100644 --- a/drivers/input/keyboard/spear-keyboard.c +++ b/drivers/input/keyboard/spear-keyboard.c @@ -55,7 +55,6 @@ struct spear_kbd { struct input_dev *input; - struct resource *res; void __iomem *io_base; struct clk *clk; unsigned int irq; @@ -204,12 +203,16 @@ static int __devinit spear_kbd_probe(struct platform_device *pdev) return irq; } - kbd = kzalloc(sizeof(*kbd), GFP_KERNEL); - input_dev = input_allocate_device(); - if (!kbd || !input_dev) { - dev_err(&pdev->dev, "out of memory\n"); - error = -ENOMEM; - goto err_free_mem; + kbd = devm_kzalloc(&pdev->dev, sizeof(*kbd), GFP_KERNEL); + if (!kbd) { + dev_err(&pdev->dev, "not enough memory for driver data\n"); + return -ENOMEM; + } + + input_dev = devm_input_allocate_device(&pdev->dev); + if (!input_dev) { + dev_err(&pdev->dev, "unable to allocate input device\n"); + return -ENOMEM; } kbd->input = input_dev; @@ -218,37 +221,25 @@ static int __devinit spear_kbd_probe(struct platform_device *pdev) if (!pdata) { error = spear_kbd_parse_dt(pdev, kbd); if (error) - goto err_free_mem; + return error; } else { kbd->mode = pdata->mode; kbd->rep = pdata->rep; kbd->suspended_rate = pdata->suspended_rate; } - kbd->res = request_mem_region(res->start, resource_size(res), - pdev->name); - if (!kbd->res) { - dev_err(&pdev->dev, "keyboard region already claimed\n"); - error = -EBUSY; - goto err_free_mem; - } - - kbd->io_base = ioremap(res->start, resource_size(res)); + kbd->io_base = devm_request_and_ioremap(&pdev->dev, res); if (!kbd->io_base) { - dev_err(&pdev->dev, "ioremap failed for kbd_region\n"); - error = -ENOMEM; - goto err_release_mem_region; + dev_err(&pdev->dev, "request-ioremap failed for kbd_region\n"); + return -ENOMEM; } - kbd->clk = clk_get(&pdev->dev, NULL); - if (IS_ERR(kbd->clk)) { - error = PTR_ERR(kbd->clk); - goto err_iounmap; - } + kbd->clk = devm_clk_get(&pdev->dev, NULL); + if (IS_ERR(kbd->clk)) + return PTR_ERR(kbd->clk); input_dev->name = "Spear Keyboard"; input_dev->phys = "keyboard/input0"; - input_dev->dev.parent = &pdev->dev; input_dev->id.bustype = BUS_HOST; input_dev->id.vendor = 0x0001; input_dev->id.product = 0x0001; @@ -260,7 +251,7 @@ static int __devinit spear_kbd_probe(struct platform_device *pdev) kbd->keycodes, input_dev); if (error) { dev_err(&pdev->dev, "Failed to build keymap\n"); - goto err_put_clk; + return error; } if (kbd->rep) @@ -269,49 +260,27 @@ static int __devinit spear_kbd_probe(struct platform_device *pdev) input_set_drvdata(input_dev, kbd); - error = request_irq(irq, spear_kbd_interrupt, 0, "keyboard", kbd); + error = devm_request_irq(&pdev->dev, irq, spear_kbd_interrupt, 0, + "keyboard", kbd); if (error) { - dev_err(&pdev->dev, "request_irq fail\n"); - goto err_put_clk; + dev_err(&pdev->dev, "request_irq failed\n"); + return error; } error = input_register_device(input_dev); if (error) { dev_err(&pdev->dev, "Unable to register keyboard device\n"); - goto err_free_irq; + return error; } device_init_wakeup(&pdev->dev, 1); platform_set_drvdata(pdev, kbd); return 0; - -err_free_irq: - free_irq(kbd->irq, kbd); -err_put_clk: - clk_put(kbd->clk); -err_iounmap: - iounmap(kbd->io_base); -err_release_mem_region: - release_mem_region(res->start, resource_size(res)); -err_free_mem: - input_free_device(input_dev); - kfree(kbd); - - return error; } static int __devexit spear_kbd_remove(struct platform_device *pdev) { - struct spear_kbd *kbd = platform_get_drvdata(pdev); - - free_irq(kbd->irq, kbd); - input_unregister_device(kbd->input); - clk_put(kbd->clk); - iounmap(kbd->io_base); - release_mem_region(kbd->res->start, resource_size(kbd->res)); - kfree(kbd); - device_init_wakeup(&pdev->dev, 0); platform_set_drvdata(pdev, NULL); -- cgit v1.2.3 From aaa4f2a7f6cce4485dc60063a56e210761f5a0c8 Mon Sep 17 00:00:00 2001 From: Viresh Kumar Date: Sat, 10 Nov 2012 00:11:10 -0800 Subject: Input: stmpe-keyboard - switch to using managed resources This patch frees stmpe-keyboard driver from burden of freeing resources :) devm_* derivatives of multiple routines are used while allocating resources, which would be freed automatically by kernel. Signed-off-by: Viresh Kumar Signed-off-by: Dmitry Torokhov --- drivers/input/keyboard/stmpe-keypad.c | 72 ++++++++++++++--------------------- 1 file changed, 28 insertions(+), 44 deletions(-) (limited to 'drivers/input/keyboard') diff --git a/drivers/input/keyboard/stmpe-keypad.c b/drivers/input/keyboard/stmpe-keypad.c index 470a8778dec..d3d2eaa5f84 100644 --- a/drivers/input/keyboard/stmpe-keypad.c +++ b/drivers/input/keyboard/stmpe-keypad.c @@ -260,10 +260,10 @@ static int __devinit stmpe_keypad_chip_init(struct stmpe_keypad *keypad) static int __devinit stmpe_keypad_probe(struct platform_device *pdev) { struct stmpe *stmpe = dev_get_drvdata(pdev->dev.parent); - struct stmpe_keypad_platform_data *plat; + const struct stmpe_keypad_platform_data *plat; struct stmpe_keypad *keypad; struct input_dev *input; - int ret; + int error; int irq; int i; @@ -275,26 +275,25 @@ static int __devinit stmpe_keypad_probe(struct platform_device *pdev) if (irq < 0) return irq; - keypad = kzalloc(sizeof(struct stmpe_keypad), GFP_KERNEL); + keypad = devm_kzalloc(&pdev->dev, sizeof(struct stmpe_keypad), + GFP_KERNEL); if (!keypad) return -ENOMEM; - input = input_allocate_device(); - if (!input) { - ret = -ENOMEM; - goto out_freekeypad; - } + input = devm_input_allocate_device(&pdev->dev); + if (!input) + return -ENOMEM; input->name = "STMPE keypad"; input->id.bustype = BUS_I2C; input->dev.parent = &pdev->dev; - ret = matrix_keypad_build_keymap(plat->keymap_data, NULL, - STMPE_KEYPAD_MAX_ROWS, - STMPE_KEYPAD_MAX_COLS, - keypad->keymap, input); - if (ret) - goto out_freeinput; + error = matrix_keypad_build_keymap(plat->keymap_data, NULL, + STMPE_KEYPAD_MAX_ROWS, + STMPE_KEYPAD_MAX_COLS, + keypad->keymap, input); + if (error) + return error; input_set_capability(input, EV_MSC, MSC_SCAN); if (!plat->no_autorepeat) @@ -312,50 +311,35 @@ static int __devinit stmpe_keypad_probe(struct platform_device *pdev) keypad->input = input; keypad->variant = &stmpe_keypad_variants[stmpe->partnum]; - ret = stmpe_keypad_chip_init(keypad); - if (ret < 0) - goto out_freeinput; + error = stmpe_keypad_chip_init(keypad); + if (error < 0) + return error; - ret = input_register_device(input); - if (ret) { - dev_err(&pdev->dev, - "unable to register input device: %d\n", ret); - goto out_freeinput; + error = devm_request_threaded_irq(&pdev->dev, irq, + NULL, stmpe_keypad_irq, + IRQF_ONESHOT, "stmpe-keypad", keypad); + if (error) { + dev_err(&pdev->dev, "unable to get irq: %d\n", error); + return error; } - ret = request_threaded_irq(irq, NULL, stmpe_keypad_irq, IRQF_ONESHOT, - "stmpe-keypad", keypad); - if (ret) { - dev_err(&pdev->dev, "unable to get irq: %d\n", ret); - goto out_unregisterinput; + error = input_register_device(input); + if (error) { + dev_err(&pdev->dev, + "unable to register input device: %d\n", error); + return error; } platform_set_drvdata(pdev, keypad); return 0; - -out_unregisterinput: - input_unregister_device(input); - input = NULL; -out_freeinput: - input_free_device(input); -out_freekeypad: - kfree(keypad); - return ret; } static int __devexit stmpe_keypad_remove(struct platform_device *pdev) { struct stmpe_keypad *keypad = platform_get_drvdata(pdev); - struct stmpe *stmpe = keypad->stmpe; - int irq = platform_get_irq(pdev, 0); - - stmpe_disable(stmpe, STMPE_BLOCK_KEYPAD); - free_irq(irq, keypad); - input_unregister_device(keypad->input); - platform_set_drvdata(pdev, NULL); - kfree(keypad); + stmpe_disable(keypad->stmpe, STMPE_BLOCK_KEYPAD); return 0; } -- cgit v1.2.3 From 4a83eecff65bd327bf5cb3b400b96fa975c73308 Mon Sep 17 00:00:00 2001 From: AnilKumar Ch Date: Tue, 20 Nov 2012 22:49:31 -0800 Subject: Input: matrix-keypad - add device tree support Also the driver was modifued to take advantage of recent improvements in matrix_keypad_build_keymap() implementation, which automatically allocates memory for keymap. The driver was tested on AM335x EVM. Signed-off-by: AnilKumar Ch Acked-by: Rob Herring Signed-off-by: Dmitry Torokhov --- drivers/input/keyboard/matrix_keypad.c | 119 +++++++++++++++++++++++++++------ 1 file changed, 97 insertions(+), 22 deletions(-) (limited to 'drivers/input/keyboard') diff --git a/drivers/input/keyboard/matrix_keypad.c b/drivers/input/keyboard/matrix_keypad.c index 18b72372028..05d3a969ff4 100644 --- a/drivers/input/keyboard/matrix_keypad.c +++ b/drivers/input/keyboard/matrix_keypad.c @@ -23,6 +23,9 @@ #include #include #include +#include +#include +#include struct matrix_keypad { const struct matrix_keypad_platform_data *pdata; @@ -37,8 +40,6 @@ struct matrix_keypad { bool scan_pending; bool stopped; bool gpio_all_disabled; - - unsigned short keycodes[]; }; /* @@ -118,6 +119,7 @@ static void matrix_keypad_scan(struct work_struct *work) struct matrix_keypad *keypad = container_of(work, struct matrix_keypad, work.work); struct input_dev *input_dev = keypad->input_dev; + const unsigned short *keycodes = input_dev->keycode; const struct matrix_keypad_platform_data *pdata = keypad->pdata; uint32_t new_state[MATRIX_MAX_COLS]; int row, col, code; @@ -153,7 +155,7 @@ static void matrix_keypad_scan(struct work_struct *work) code = MATRIX_SCAN_CODE(row, col, keypad->row_shift); input_event(input_dev, EV_MSC, MSC_SCAN, code); input_report_key(input_dev, - keypad->keycodes[code], + keycodes[code], new_state[col] & (1 << row)); } } @@ -394,33 +396,95 @@ static void matrix_keypad_free_gpio(struct matrix_keypad *keypad) gpio_free(pdata->col_gpios[i]); } +#ifdef CONFIG_OF +static struct matrix_keypad_platform_data * __devinit +matrix_keypad_parse_dt(struct device *dev) +{ + struct matrix_keypad_platform_data *pdata; + struct device_node *np = dev->of_node; + unsigned int *gpios; + int i; + + if (!np) { + dev_err(dev, "device lacks DT data\n"); + return ERR_PTR(-ENODEV); + } + + pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL); + if (!pdata) { + dev_err(dev, "could not allocate memory for platform data\n"); + return ERR_PTR(-ENOMEM); + } + + pdata->num_row_gpios = of_gpio_named_count(np, "row-gpios"); + pdata->num_col_gpios = of_gpio_named_count(np, "col-gpios"); + if (!pdata->num_row_gpios || !pdata->num_col_gpios) { + dev_err(dev, "number of keypad rows/columns not specified\n"); + return ERR_PTR(-EINVAL); + } + + if (of_get_property(np, "linux,no-autorepeat", NULL)) + pdata->no_autorepeat = true; + if (of_get_property(np, "linux,wakeup", NULL)) + pdata->wakeup = true; + if (of_get_property(np, "gpio-activelow", NULL)) + pdata->active_low = true; + + of_property_read_u32(np, "debounce-delay-ms", &pdata->debounce_ms); + of_property_read_u32(np, "col-scan-delay-us", + &pdata->col_scan_delay_us); + + gpios = devm_kzalloc(dev, + sizeof(unsigned int) * + (pdata->num_row_gpios + pdata->num_col_gpios), + GFP_KERNEL); + if (!gpios) { + dev_err(dev, "could not allocate memory for gpios\n"); + return ERR_PTR(-ENOMEM); + } + + for (i = 0; i < pdata->num_row_gpios; i++) + gpios[i] = of_get_named_gpio(np, "row-gpios", i); + + for (i = 0; i < pdata->num_col_gpios; i++) + gpios[pdata->num_row_gpios + i] = + of_get_named_gpio(np, "col-gpios", i); + + pdata->row_gpios = gpios; + pdata->col_gpios = &gpios[pdata->num_row_gpios]; + + return pdata; +} +#else +static inline struct matrix_keypad_platform_data * +matrix_keypad_parse_dt(struct device *dev) +{ + dev_err(dev, "no platform data defined\n"); + + return ERR_PTR(-EINVAL); +} +#endif + static int __devinit matrix_keypad_probe(struct platform_device *pdev) { const struct matrix_keypad_platform_data *pdata; - const struct matrix_keymap_data *keymap_data; struct matrix_keypad *keypad; struct input_dev *input_dev; - unsigned int row_shift; - size_t keymap_size; int err; - pdata = pdev->dev.platform_data; + pdata = dev_get_platdata(&pdev->dev); if (!pdata) { - dev_err(&pdev->dev, "no platform data defined\n"); - return -EINVAL; - } - - keymap_data = pdata->keymap_data; - if (!keymap_data) { + pdata = matrix_keypad_parse_dt(&pdev->dev); + if (IS_ERR(pdata)) { + dev_err(&pdev->dev, "no platform data defined\n"); + return PTR_ERR(pdata); + } + } else if (!pdata->keymap_data) { dev_err(&pdev->dev, "no keymap data defined\n"); return -EINVAL; } - row_shift = get_count_order(pdata->num_col_gpios); - keymap_size = (pdata->num_row_gpios << row_shift) * - sizeof(keypad->keycodes[0]); - keypad = kzalloc(sizeof(struct matrix_keypad) + keymap_size, - GFP_KERNEL); + keypad = kzalloc(sizeof(struct matrix_keypad), GFP_KERNEL); input_dev = input_allocate_device(); if (!keypad || !input_dev) { err = -ENOMEM; @@ -429,7 +493,7 @@ static int __devinit matrix_keypad_probe(struct platform_device *pdev) keypad->input_dev = input_dev; keypad->pdata = pdata; - keypad->row_shift = row_shift; + keypad->row_shift = get_count_order(pdata->num_col_gpios); keypad->stopped = true; INIT_DELAYED_WORK(&keypad->work, matrix_keypad_scan); spin_lock_init(&keypad->lock); @@ -440,12 +504,14 @@ static int __devinit matrix_keypad_probe(struct platform_device *pdev) input_dev->open = matrix_keypad_start; input_dev->close = matrix_keypad_stop; - err = matrix_keypad_build_keymap(keymap_data, NULL, + err = matrix_keypad_build_keymap(pdata->keymap_data, NULL, pdata->num_row_gpios, pdata->num_col_gpios, - keypad->keycodes, input_dev); - if (err) + NULL, input_dev); + if (err) { + dev_err(&pdev->dev, "failed to build keymap\n"); goto err_free_mem; + } if (!pdata->no_autorepeat) __set_bit(EV_REP, input_dev->evbit); @@ -488,6 +554,14 @@ static int __devexit matrix_keypad_remove(struct platform_device *pdev) return 0; } +#ifdef CONFIG_OF +static const struct of_device_id matrix_keypad_dt_match[] = { + { .compatible = "gpio-matrix-keypad" }, + { } +}; +MODULE_DEVICE_TABLE(of, matrix_keypad_dt_match); +#endif + static struct platform_driver matrix_keypad_driver = { .probe = matrix_keypad_probe, .remove = __devexit_p(matrix_keypad_remove), @@ -495,6 +569,7 @@ static struct platform_driver matrix_keypad_driver = { .name = "matrix-keypad", .owner = THIS_MODULE, .pm = &matrix_keypad_pm_ops, + .of_match_table = of_match_ptr(matrix_keypad_dt_match), }, }; module_platform_driver(matrix_keypad_driver); -- cgit v1.2.3 From 1cb0aa88179b7a71c240529e9d781d7bbb43d2e8 Mon Sep 17 00:00:00 2001 From: Bill Pemberton Date: Fri, 23 Nov 2012 21:27:39 -0800 Subject: Input: remove use of __devexit_p CONFIG_HOTPLUG is going away as an option so __devexit_p is no longer needed. Signed-off-by: Bill Pemberton Acked-by: Russell King Signed-off-by: Dmitry Torokhov --- drivers/input/keyboard/adp5520-keys.c | 2 +- drivers/input/keyboard/adp5588-keys.c | 2 +- drivers/input/keyboard/adp5589-keys.c | 2 +- drivers/input/keyboard/bf54x-keys.c | 2 +- drivers/input/keyboard/davinci_keyscan.c | 2 +- drivers/input/keyboard/ep93xx_keypad.c | 2 +- drivers/input/keyboard/gpio_keys.c | 2 +- drivers/input/keyboard/gpio_keys_polled.c | 2 +- drivers/input/keyboard/hilkbd.c | 2 +- drivers/input/keyboard/imx_keypad.c | 2 +- drivers/input/keyboard/jornada680_kbd.c | 2 +- drivers/input/keyboard/jornada720_kbd.c | 2 +- drivers/input/keyboard/lm8323.c | 2 +- drivers/input/keyboard/lm8333.c | 2 +- drivers/input/keyboard/locomokbd.c | 2 +- drivers/input/keyboard/lpc32xx-keys.c | 2 +- drivers/input/keyboard/matrix_keypad.c | 2 +- drivers/input/keyboard/max7359_keypad.c | 2 +- drivers/input/keyboard/mcs_touchkey.c | 2 +- drivers/input/keyboard/mpr121_touchkey.c | 2 +- drivers/input/keyboard/nomadik-ske-keypad.c | 2 +- drivers/input/keyboard/omap-keypad.c | 2 +- drivers/input/keyboard/omap4-keypad.c | 2 +- drivers/input/keyboard/opencores-kbd.c | 2 +- drivers/input/keyboard/pmic8xxx-keypad.c | 2 +- drivers/input/keyboard/pxa27x_keypad.c | 2 +- drivers/input/keyboard/pxa930_rotary.c | 2 +- drivers/input/keyboard/qt1070.c | 2 +- drivers/input/keyboard/qt2160.c | 2 +- drivers/input/keyboard/samsung-keypad.c | 2 +- drivers/input/keyboard/sh_keysc.c | 2 +- drivers/input/keyboard/spear-keyboard.c | 2 +- drivers/input/keyboard/stmpe-keypad.c | 2 +- drivers/input/keyboard/tc3589x-keypad.c | 2 +- drivers/input/keyboard/tca6416-keypad.c | 2 +- drivers/input/keyboard/tca8418_keypad.c | 2 +- drivers/input/keyboard/tegra-kbc.c | 2 +- drivers/input/keyboard/tnetv107x-keypad.c | 2 +- drivers/input/keyboard/twl4030_keypad.c | 2 +- drivers/input/keyboard/w90p910_keypad.c | 2 +- 40 files changed, 40 insertions(+), 40 deletions(-) (limited to 'drivers/input/keyboard') diff --git a/drivers/input/keyboard/adp5520-keys.c b/drivers/input/keyboard/adp5520-keys.c index e9e8674dfda..46796b26ff3 100644 --- a/drivers/input/keyboard/adp5520-keys.c +++ b/drivers/input/keyboard/adp5520-keys.c @@ -200,7 +200,7 @@ static struct platform_driver adp5520_keys_driver = { .owner = THIS_MODULE, }, .probe = adp5520_keys_probe, - .remove = __devexit_p(adp5520_keys_remove), + .remove = adp5520_keys_remove, }; module_platform_driver(adp5520_keys_driver); diff --git a/drivers/input/keyboard/adp5588-keys.c b/drivers/input/keyboard/adp5588-keys.c index b083bf10f13..39c2a6d2c99 100644 --- a/drivers/input/keyboard/adp5588-keys.c +++ b/drivers/input/keyboard/adp5588-keys.c @@ -650,7 +650,7 @@ static struct i2c_driver adp5588_driver = { #endif }, .probe = adp5588_probe, - .remove = __devexit_p(adp5588_remove), + .remove = adp5588_remove, .id_table = adp5588_id, }; diff --git a/drivers/input/keyboard/adp5589-keys.c b/drivers/input/keyboard/adp5589-keys.c index 74e60321338..6e0c2e3a6a8 100644 --- a/drivers/input/keyboard/adp5589-keys.c +++ b/drivers/input/keyboard/adp5589-keys.c @@ -1104,7 +1104,7 @@ static struct i2c_driver adp5589_driver = { .pm = &adp5589_dev_pm_ops, }, .probe = adp5589_probe, - .remove = __devexit_p(adp5589_remove), + .remove = adp5589_remove, .id_table = adp5589_id, }; diff --git a/drivers/input/keyboard/bf54x-keys.c b/drivers/input/keyboard/bf54x-keys.c index 8eb9116e0a5..8a7909a8721 100644 --- a/drivers/input/keyboard/bf54x-keys.c +++ b/drivers/input/keyboard/bf54x-keys.c @@ -390,7 +390,7 @@ static struct platform_driver bfin_kpad_device_driver = { .owner = THIS_MODULE, }, .probe = bfin_kpad_probe, - .remove = __devexit_p(bfin_kpad_remove), + .remove = bfin_kpad_remove, .suspend = bfin_kpad_suspend, .resume = bfin_kpad_resume, }; diff --git a/drivers/input/keyboard/davinci_keyscan.c b/drivers/input/keyboard/davinci_keyscan.c index d5bacbb479b..8e4b438ddc8 100644 --- a/drivers/input/keyboard/davinci_keyscan.c +++ b/drivers/input/keyboard/davinci_keyscan.c @@ -326,7 +326,7 @@ static struct platform_driver davinci_ks_driver = { .name = "davinci_keyscan", .owner = THIS_MODULE, }, - .remove = __devexit_p(davinci_ks_remove), + .remove = davinci_ks_remove, }; static int __init davinci_ks_init(void) diff --git a/drivers/input/keyboard/ep93xx_keypad.c b/drivers/input/keyboard/ep93xx_keypad.c index 7363402de8d..bdf32615596 100644 --- a/drivers/input/keyboard/ep93xx_keypad.c +++ b/drivers/input/keyboard/ep93xx_keypad.c @@ -380,7 +380,7 @@ static struct platform_driver ep93xx_keypad_driver = { .pm = &ep93xx_keypad_pm_ops, }, .probe = ep93xx_keypad_probe, - .remove = __devexit_p(ep93xx_keypad_remove), + .remove = ep93xx_keypad_remove, }; module_platform_driver(ep93xx_keypad_driver); diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gpio_keys.c index 6a68041c261..96b5ac5998f 100644 --- a/drivers/input/keyboard/gpio_keys.c +++ b/drivers/input/keyboard/gpio_keys.c @@ -824,7 +824,7 @@ static SIMPLE_DEV_PM_OPS(gpio_keys_pm_ops, gpio_keys_suspend, gpio_keys_resume); static struct platform_driver gpio_keys_device_driver = { .probe = gpio_keys_probe, - .remove = __devexit_p(gpio_keys_remove), + .remove = gpio_keys_remove, .driver = { .name = "gpio-keys", .owner = THIS_MODULE, diff --git a/drivers/input/keyboard/gpio_keys_polled.c b/drivers/input/keyboard/gpio_keys_polled.c index f2142de789e..922cbbdb5c8 100644 --- a/drivers/input/keyboard/gpio_keys_polled.c +++ b/drivers/input/keyboard/gpio_keys_polled.c @@ -357,7 +357,7 @@ static int __devexit gpio_keys_polled_remove(struct platform_device *pdev) static struct platform_driver gpio_keys_polled_driver = { .probe = gpio_keys_polled_probe, - .remove = __devexit_p(gpio_keys_polled_remove), + .remove = gpio_keys_polled_remove, .driver = { .name = DRV_NAME, .owner = THIS_MODULE, diff --git a/drivers/input/keyboard/hilkbd.c b/drivers/input/keyboard/hilkbd.c index 5f72440b50c..97d3151232b 100644 --- a/drivers/input/keyboard/hilkbd.c +++ b/drivers/input/keyboard/hilkbd.c @@ -341,7 +341,7 @@ static struct parisc_driver hil_driver = { .name = "hil", .id_table = hil_tbl, .probe = hil_probe_chip, - .remove = __devexit_p(hil_remove_chip), + .remove = hil_remove_chip, }; static int __init hil_init(void) diff --git a/drivers/input/keyboard/imx_keypad.c b/drivers/input/keyboard/imx_keypad.c index cdc252612c0..93c344137cc 100644 --- a/drivers/input/keyboard/imx_keypad.c +++ b/drivers/input/keyboard/imx_keypad.c @@ -632,7 +632,7 @@ static struct platform_driver imx_keypad_driver = { .pm = &imx_kbd_pm_ops, }, .probe = imx_keypad_probe, - .remove = __devexit_p(imx_keypad_remove), + .remove = imx_keypad_remove, }; module_platform_driver(imx_keypad_driver); diff --git a/drivers/input/keyboard/jornada680_kbd.c b/drivers/input/keyboard/jornada680_kbd.c index 24f3ea01c4d..bd1a9c365d1 100644 --- a/drivers/input/keyboard/jornada680_kbd.c +++ b/drivers/input/keyboard/jornada680_kbd.c @@ -258,7 +258,7 @@ static struct platform_driver jornada680kbd_driver = { .owner = THIS_MODULE, }, .probe = jornada680kbd_probe, - .remove = __devexit_p(jornada680kbd_remove), + .remove = jornada680kbd_remove, }; module_platform_driver(jornada680kbd_driver); diff --git a/drivers/input/keyboard/jornada720_kbd.c b/drivers/input/keyboard/jornada720_kbd.c index 9d639fa1afb..9771db1de01 100644 --- a/drivers/input/keyboard/jornada720_kbd.c +++ b/drivers/input/keyboard/jornada720_kbd.c @@ -173,6 +173,6 @@ static struct platform_driver jornada720_kbd_driver = { .owner = THIS_MODULE, }, .probe = jornada720_kbd_probe, - .remove = __devexit_p(jornada720_kbd_remove), + .remove = jornada720_kbd_remove, }; module_platform_driver(jornada720_kbd_driver); diff --git a/drivers/input/keyboard/lm8323.c b/drivers/input/keyboard/lm8323.c index 39ac2787e27..87432859be5 100644 --- a/drivers/input/keyboard/lm8323.c +++ b/drivers/input/keyboard/lm8323.c @@ -846,7 +846,7 @@ static struct i2c_driver lm8323_i2c_driver = { .pm = &lm8323_pm_ops, }, .probe = lm8323_probe, - .remove = __devexit_p(lm8323_remove), + .remove = lm8323_remove, .id_table = lm8323_id, }; MODULE_DEVICE_TABLE(i2c, lm8323_id); diff --git a/drivers/input/keyboard/lm8333.c b/drivers/input/keyboard/lm8333.c index 081fd9effa8..c76e488ce9b 100644 --- a/drivers/input/keyboard/lm8333.c +++ b/drivers/input/keyboard/lm8333.c @@ -225,7 +225,7 @@ static struct i2c_driver lm8333_driver = { .owner = THIS_MODULE, }, .probe = lm8333_probe, - .remove = __devexit_p(lm8333_remove), + .remove = lm8333_remove, .id_table = lm8333_id, }; module_i2c_driver(lm8333_driver); diff --git a/drivers/input/keyboard/locomokbd.c b/drivers/input/keyboard/locomokbd.c index b1ab29861e1..5f66272c2d7 100644 --- a/drivers/input/keyboard/locomokbd.c +++ b/drivers/input/keyboard/locomokbd.c @@ -345,7 +345,7 @@ static struct locomo_driver keyboard_driver = { }, .devid = LOCOMO_DEVID_KEYBOARD, .probe = locomokbd_probe, - .remove = __devexit_p(locomokbd_remove), + .remove = locomokbd_remove, }; static int __init locomokbd_init(void) diff --git a/drivers/input/keyboard/lpc32xx-keys.c b/drivers/input/keyboard/lpc32xx-keys.c index dd786c8a758..8872ce62c9d 100644 --- a/drivers/input/keyboard/lpc32xx-keys.c +++ b/drivers/input/keyboard/lpc32xx-keys.c @@ -377,7 +377,7 @@ MODULE_DEVICE_TABLE(of, lpc32xx_kscan_match); static struct platform_driver lpc32xx_kscan_driver = { .probe = lpc32xx_kscan_probe, - .remove = __devexit_p(lpc32xx_kscan_remove), + .remove = lpc32xx_kscan_remove, .driver = { .name = DRV_NAME, .owner = THIS_MODULE, diff --git a/drivers/input/keyboard/matrix_keypad.c b/drivers/input/keyboard/matrix_keypad.c index 05d3a969ff4..ed2bacdf2cc 100644 --- a/drivers/input/keyboard/matrix_keypad.c +++ b/drivers/input/keyboard/matrix_keypad.c @@ -564,7 +564,7 @@ MODULE_DEVICE_TABLE(of, matrix_keypad_dt_match); static struct platform_driver matrix_keypad_driver = { .probe = matrix_keypad_probe, - .remove = __devexit_p(matrix_keypad_remove), + .remove = matrix_keypad_remove, .driver = { .name = "matrix-keypad", .owner = THIS_MODULE, diff --git a/drivers/input/keyboard/max7359_keypad.c b/drivers/input/keyboard/max7359_keypad.c index 8edada8ae71..90478d182bc 100644 --- a/drivers/input/keyboard/max7359_keypad.c +++ b/drivers/input/keyboard/max7359_keypad.c @@ -312,7 +312,7 @@ static struct i2c_driver max7359_i2c_driver = { .pm = &max7359_pm, }, .probe = max7359_probe, - .remove = __devexit_p(max7359_remove), + .remove = max7359_remove, .id_table = max7359_ids, }; diff --git a/drivers/input/keyboard/mcs_touchkey.c b/drivers/input/keyboard/mcs_touchkey.c index 0d77f6c8495..751b1419e56 100644 --- a/drivers/input/keyboard/mcs_touchkey.c +++ b/drivers/input/keyboard/mcs_touchkey.c @@ -270,7 +270,7 @@ static struct i2c_driver mcs_touchkey_driver = { .pm = &mcs_touchkey_pm_ops, }, .probe = mcs_touchkey_probe, - .remove = __devexit_p(mcs_touchkey_remove), + .remove = mcs_touchkey_remove, .shutdown = mcs_touchkey_shutdown, .id_table = mcs_touchkey_id, }; diff --git a/drivers/input/keyboard/mpr121_touchkey.c b/drivers/input/keyboard/mpr121_touchkey.c index 7613f1cac95..63b20d02945 100644 --- a/drivers/input/keyboard/mpr121_touchkey.c +++ b/drivers/input/keyboard/mpr121_touchkey.c @@ -327,7 +327,7 @@ static struct i2c_driver mpr_touchkey_driver = { }, .id_table = mpr121_id, .probe = mpr_touchkey_probe, - .remove = __devexit_p(mpr_touchkey_remove), + .remove = mpr_touchkey_remove, }; module_i2c_driver(mpr_touchkey_driver); diff --git a/drivers/input/keyboard/nomadik-ske-keypad.c b/drivers/input/keyboard/nomadik-ske-keypad.c index a1a9375f18f..2304a8192cf 100644 --- a/drivers/input/keyboard/nomadik-ske-keypad.c +++ b/drivers/input/keyboard/nomadik-ske-keypad.c @@ -427,7 +427,7 @@ static struct platform_driver ske_keypad_driver = { .owner = THIS_MODULE, .pm = &ske_keypad_dev_pm_ops, }, - .remove = __devexit_p(ske_keypad_remove), + .remove = ske_keypad_remove, }; static int __init ske_keypad_init(void) diff --git a/drivers/input/keyboard/omap-keypad.c b/drivers/input/keyboard/omap-keypad.c index 4a5fcc8026f..1d17d91ed1e 100644 --- a/drivers/input/keyboard/omap-keypad.c +++ b/drivers/input/keyboard/omap-keypad.c @@ -379,7 +379,7 @@ static int __devexit omap_kp_remove(struct platform_device *pdev) static struct platform_driver omap_kp_driver = { .probe = omap_kp_probe, - .remove = __devexit_p(omap_kp_remove), + .remove = omap_kp_remove, .suspend = omap_kp_suspend, .resume = omap_kp_resume, .driver = { diff --git a/drivers/input/keyboard/omap4-keypad.c b/drivers/input/keyboard/omap4-keypad.c index c05f98c4141..7145ab3401f 100644 --- a/drivers/input/keyboard/omap4-keypad.c +++ b/drivers/input/keyboard/omap4-keypad.c @@ -440,7 +440,7 @@ MODULE_DEVICE_TABLE(of, omap_keypad_dt_match); static struct platform_driver omap4_keypad_driver = { .probe = omap4_keypad_probe, - .remove = __devexit_p(omap4_keypad_remove), + .remove = omap4_keypad_remove, .driver = { .name = "omap4-keypad", .owner = THIS_MODULE, diff --git a/drivers/input/keyboard/opencores-kbd.c b/drivers/input/keyboard/opencores-kbd.c index abe728c7b88..7914ede8e4b 100644 --- a/drivers/input/keyboard/opencores-kbd.c +++ b/drivers/input/keyboard/opencores-kbd.c @@ -158,7 +158,7 @@ static int __devexit opencores_kbd_remove(struct platform_device *pdev) static struct platform_driver opencores_kbd_device_driver = { .probe = opencores_kbd_probe, - .remove = __devexit_p(opencores_kbd_remove), + .remove = opencores_kbd_remove, .driver = { .name = "opencores-kbd", }, diff --git a/drivers/input/keyboard/pmic8xxx-keypad.c b/drivers/input/keyboard/pmic8xxx-keypad.c index 52c34657d30..d3623c5a3ee 100644 --- a/drivers/input/keyboard/pmic8xxx-keypad.c +++ b/drivers/input/keyboard/pmic8xxx-keypad.c @@ -773,7 +773,7 @@ static SIMPLE_DEV_PM_OPS(pm8xxx_kp_pm_ops, static struct platform_driver pmic8xxx_kp_driver = { .probe = pmic8xxx_kp_probe, - .remove = __devexit_p(pmic8xxx_kp_remove), + .remove = pmic8xxx_kp_remove, .driver = { .name = PM8XXX_KEYPAD_DEV_NAME, .owner = THIS_MODULE, diff --git a/drivers/input/keyboard/pxa27x_keypad.c b/drivers/input/keyboard/pxa27x_keypad.c index cad9d5dd597..a6bcd3129f0 100644 --- a/drivers/input/keyboard/pxa27x_keypad.c +++ b/drivers/input/keyboard/pxa27x_keypad.c @@ -620,7 +620,7 @@ MODULE_ALIAS("platform:pxa27x-keypad"); static struct platform_driver pxa27x_keypad_driver = { .probe = pxa27x_keypad_probe, - .remove = __devexit_p(pxa27x_keypad_remove), + .remove = pxa27x_keypad_remove, .driver = { .name = "pxa27x-keypad", .owner = THIS_MODULE, diff --git a/drivers/input/keyboard/pxa930_rotary.c b/drivers/input/keyboard/pxa930_rotary.c index 41488f9add2..f8f89d1f230 100644 --- a/drivers/input/keyboard/pxa930_rotary.c +++ b/drivers/input/keyboard/pxa930_rotary.c @@ -193,7 +193,7 @@ static struct platform_driver pxa930_rotary_driver = { .owner = THIS_MODULE, }, .probe = pxa930_rotary_probe, - .remove = __devexit_p(pxa930_rotary_remove), + .remove = pxa930_rotary_remove, }; module_platform_driver(pxa930_rotary_driver); diff --git a/drivers/input/keyboard/qt1070.c b/drivers/input/keyboard/qt1070.c index ca68f2992d7..eb46405eaad 100644 --- a/drivers/input/keyboard/qt1070.c +++ b/drivers/input/keyboard/qt1070.c @@ -256,7 +256,7 @@ static struct i2c_driver qt1070_driver = { }, .id_table = qt1070_id, .probe = qt1070_probe, - .remove = __devexit_p(qt1070_remove), + .remove = qt1070_remove, }; module_i2c_driver(qt1070_driver); diff --git a/drivers/input/keyboard/qt2160.c b/drivers/input/keyboard/qt2160.c index 031eed73990..691fe92a982 100644 --- a/drivers/input/keyboard/qt2160.c +++ b/drivers/input/keyboard/qt2160.c @@ -366,7 +366,7 @@ static struct i2c_driver qt2160_driver = { .id_table = qt2160_idtable, .probe = qt2160_probe, - .remove = __devexit_p(qt2160_remove), + .remove = qt2160_remove, }; module_i2c_driver(qt2160_driver); diff --git a/drivers/input/keyboard/samsung-keypad.c b/drivers/input/keyboard/samsung-keypad.c index 9d7a111486f..f02772aa47d 100644 --- a/drivers/input/keyboard/samsung-keypad.c +++ b/drivers/input/keyboard/samsung-keypad.c @@ -685,7 +685,7 @@ MODULE_DEVICE_TABLE(platform, samsung_keypad_driver_ids); static struct platform_driver samsung_keypad_driver = { .probe = samsung_keypad_probe, - .remove = __devexit_p(samsung_keypad_remove), + .remove = samsung_keypad_remove, .driver = { .name = "samsung-keypad", .owner = THIS_MODULE, diff --git a/drivers/input/keyboard/sh_keysc.c b/drivers/input/keyboard/sh_keysc.c index da54ad5db15..07415a36ec1 100644 --- a/drivers/input/keyboard/sh_keysc.c +++ b/drivers/input/keyboard/sh_keysc.c @@ -331,7 +331,7 @@ static SIMPLE_DEV_PM_OPS(sh_keysc_dev_pm_ops, static struct platform_driver sh_keysc_device_driver = { .probe = sh_keysc_probe, - .remove = __devexit_p(sh_keysc_remove), + .remove = sh_keysc_remove, .driver = { .name = "sh_keysc", .pm = &sh_keysc_dev_pm_ops, diff --git a/drivers/input/keyboard/spear-keyboard.c b/drivers/input/keyboard/spear-keyboard.c index da914fea0c1..0c8862343e7 100644 --- a/drivers/input/keyboard/spear-keyboard.c +++ b/drivers/input/keyboard/spear-keyboard.c @@ -381,7 +381,7 @@ MODULE_DEVICE_TABLE(of, spear_kbd_id_table); static struct platform_driver spear_kbd_driver = { .probe = spear_kbd_probe, - .remove = __devexit_p(spear_kbd_remove), + .remove = spear_kbd_remove, .driver = { .name = "keyboard", .owner = THIS_MODULE, diff --git a/drivers/input/keyboard/stmpe-keypad.c b/drivers/input/keyboard/stmpe-keypad.c index d3d2eaa5f84..286719f5bc0 100644 --- a/drivers/input/keyboard/stmpe-keypad.c +++ b/drivers/input/keyboard/stmpe-keypad.c @@ -348,7 +348,7 @@ static struct platform_driver stmpe_keypad_driver = { .driver.name = "stmpe-keypad", .driver.owner = THIS_MODULE, .probe = stmpe_keypad_probe, - .remove = __devexit_p(stmpe_keypad_remove), + .remove = stmpe_keypad_remove, }; module_platform_driver(stmpe_keypad_driver); diff --git a/drivers/input/keyboard/tc3589x-keypad.c b/drivers/input/keyboard/tc3589x-keypad.c index 7d498e69850..75fa2b98aae 100644 --- a/drivers/input/keyboard/tc3589x-keypad.c +++ b/drivers/input/keyboard/tc3589x-keypad.c @@ -448,7 +448,7 @@ static struct platform_driver tc3589x_keypad_driver = { .pm = &tc3589x_keypad_dev_pm_ops, }, .probe = tc3589x_keypad_probe, - .remove = __devexit_p(tc3589x_keypad_remove), + .remove = tc3589x_keypad_remove, }; module_platform_driver(tc3589x_keypad_driver); diff --git a/drivers/input/keyboard/tca6416-keypad.c b/drivers/input/keyboard/tca6416-keypad.c index c355cdde8d2..f5fa75aa9db 100644 --- a/drivers/input/keyboard/tca6416-keypad.c +++ b/drivers/input/keyboard/tca6416-keypad.c @@ -361,7 +361,7 @@ static struct i2c_driver tca6416_keypad_driver = { .pm = &tca6416_keypad_dev_pm_ops, }, .probe = tca6416_keypad_probe, - .remove = __devexit_p(tca6416_keypad_remove), + .remove = tca6416_keypad_remove, .id_table = tca6416_id, }; diff --git a/drivers/input/keyboard/tca8418_keypad.c b/drivers/input/keyboard/tca8418_keypad.c index 893869b29ed..672b5f8bcc1 100644 --- a/drivers/input/keyboard/tca8418_keypad.c +++ b/drivers/input/keyboard/tca8418_keypad.c @@ -408,7 +408,7 @@ static struct i2c_driver tca8418_keypad_driver = { .owner = THIS_MODULE, }, .probe = tca8418_keypad_probe, - .remove = __devexit_p(tca8418_keypad_remove), + .remove = tca8418_keypad_remove, .id_table = tca8418_id, }; diff --git a/drivers/input/keyboard/tegra-kbc.c b/drivers/input/keyboard/tegra-kbc.c index 5faaf2553e3..48ef283cef3 100644 --- a/drivers/input/keyboard/tegra-kbc.c +++ b/drivers/input/keyboard/tegra-kbc.c @@ -954,7 +954,7 @@ MODULE_DEVICE_TABLE(of, tegra_kbc_of_match); static struct platform_driver tegra_kbc_driver = { .probe = tegra_kbc_probe, - .remove = __devexit_p(tegra_kbc_remove), + .remove = tegra_kbc_remove, .driver = { .name = "tegra-kbc", .owner = THIS_MODULE, diff --git a/drivers/input/keyboard/tnetv107x-keypad.c b/drivers/input/keyboard/tnetv107x-keypad.c index 4c34f21fbe2..05d923c51c1 100644 --- a/drivers/input/keyboard/tnetv107x-keypad.c +++ b/drivers/input/keyboard/tnetv107x-keypad.c @@ -319,7 +319,7 @@ static int __devexit keypad_remove(struct platform_device *pdev) static struct platform_driver keypad_driver = { .probe = keypad_probe, - .remove = __devexit_p(keypad_remove), + .remove = keypad_remove, .driver.name = "tnetv107x-keypad", .driver.owner = THIS_MODULE, }; diff --git a/drivers/input/keyboard/twl4030_keypad.c b/drivers/input/keyboard/twl4030_keypad.c index a2c6f79aa10..ae25909d51b 100644 --- a/drivers/input/keyboard/twl4030_keypad.c +++ b/drivers/input/keyboard/twl4030_keypad.c @@ -452,7 +452,7 @@ static int __devexit twl4030_kp_remove(struct platform_device *pdev) static struct platform_driver twl4030_kp_driver = { .probe = twl4030_kp_probe, - .remove = __devexit_p(twl4030_kp_remove), + .remove = twl4030_kp_remove, .driver = { .name = "twl4030_keypad", .owner = THIS_MODULE, diff --git a/drivers/input/keyboard/w90p910_keypad.c b/drivers/input/keyboard/w90p910_keypad.c index e0f6cd1ad0f..a90fdfc0948 100644 --- a/drivers/input/keyboard/w90p910_keypad.c +++ b/drivers/input/keyboard/w90p910_keypad.c @@ -257,7 +257,7 @@ static int __devexit w90p910_keypad_remove(struct platform_device *pdev) static struct platform_driver w90p910_keypad_driver = { .probe = w90p910_keypad_probe, - .remove = __devexit_p(w90p910_keypad_remove), + .remove = w90p910_keypad_remove, .driver = { .name = "nuc900-kpi", .owner = THIS_MODULE, -- cgit v1.2.3 From d6f6dfd941de2b106af1290b810eff9b1c523772 Mon Sep 17 00:00:00 2001 From: Bill Pemberton Date: Fri, 23 Nov 2012 21:30:24 -0800 Subject: Input: remove use of __devinitdata CONFIG_HOTPLUG is going away as an option so __devinitdata is no longer needed. Signed-off-by: Bill Pemberton Signed-off-by: Dmitry Torokhov --- drivers/input/keyboard/tegra-kbc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/input/keyboard') diff --git a/drivers/input/keyboard/tegra-kbc.c b/drivers/input/keyboard/tegra-kbc.c index 48ef283cef3..0bbcf971d10 100644 --- a/drivers/input/keyboard/tegra-kbc.c +++ b/drivers/input/keyboard/tegra-kbc.c @@ -87,7 +87,7 @@ struct tegra_kbc { struct clk *clk; }; -static const u32 tegra_kbc_default_keymap[] __devinitdata = { +static const u32 tegra_kbc_default_keymap[] = { KEY(0, 2, KEY_W), KEY(0, 3, KEY_S), KEY(0, 4, KEY_A), @@ -223,7 +223,7 @@ static const u32 tegra_kbc_default_keymap[] __devinitdata = { }; static const -struct matrix_keymap_data tegra_kbc_default_keymap_data __devinitdata = { +struct matrix_keymap_data tegra_kbc_default_keymap_data = { .keymap = tegra_kbc_default_keymap, .keymap_size = ARRAY_SIZE(tegra_kbc_default_keymap), }; -- cgit v1.2.3 From 78f50c246f4286d40a1f42fecc779d47e40503a2 Mon Sep 17 00:00:00 2001 From: Bill Pemberton Date: Fri, 23 Nov 2012 21:31:00 -0800 Subject: Input: remove use of __devinitconst CONFIG_HOTPLUG is going away as an option so __devinitconst is no longer needed. Signed-off-by: Bill Pemberton Signed-off-by: Dmitry Torokhov --- drivers/input/keyboard/locomokbd.c | 2 +- drivers/input/keyboard/mpr121_touchkey.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/input/keyboard') diff --git a/drivers/input/keyboard/locomokbd.c b/drivers/input/keyboard/locomokbd.c index 5f66272c2d7..dba900c54ce 100644 --- a/drivers/input/keyboard/locomokbd.c +++ b/drivers/input/keyboard/locomokbd.c @@ -46,7 +46,7 @@ MODULE_LICENSE("GPL"); #define KEY_CENTER KEY_F15 static const unsigned char -locomokbd_keycode[LOCOMOKBD_NUMKEYS] __devinitconst = { +locomokbd_keycode[LOCOMOKBD_NUMKEYS] = { 0, KEY_ESC, KEY_ACTIVITY, 0, 0, 0, 0, 0, 0, 0, /* 0 - 9 */ 0, 0, 0, 0, 0, 0, 0, KEY_MENU, KEY_HOME, KEY_CONTACT, /* 10 - 19 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 20 - 29 */ diff --git a/drivers/input/keyboard/mpr121_touchkey.c b/drivers/input/keyboard/mpr121_touchkey.c index 63b20d02945..38b1c0f72ed 100644 --- a/drivers/input/keyboard/mpr121_touchkey.c +++ b/drivers/input/keyboard/mpr121_touchkey.c @@ -71,7 +71,7 @@ struct mpr121_init_register { u8 val; }; -static const struct mpr121_init_register init_reg_table[] __devinitconst = { +static const struct mpr121_init_register init_reg_table[] = { { MHD_RISING_ADDR, 0x1 }, { NHD_RISING_ADDR, 0x1 }, { MHD_FALLING_ADDR, 0x1 }, -- cgit v1.2.3 From 5298cc4cc753bbe4c530b41341834f6ef3344d0d Mon Sep 17 00:00:00 2001 From: Bill Pemberton Date: Fri, 23 Nov 2012 21:38:25 -0800 Subject: Input: remove use of __devinit CONFIG_HOTPLUG is going away as an option so __devinit is no longer needed. Signed-off-by: Bill Pemberton Acked-by: Mark Brown Acked-by: Javier Martinez Canillas Signed-off-by: Dmitry Torokhov --- drivers/input/keyboard/adp5520-keys.c | 2 +- drivers/input/keyboard/adp5588-keys.c | 12 ++++++------ drivers/input/keyboard/adp5589-keys.c | 15 +++++++-------- drivers/input/keyboard/bf54x-keys.c | 2 +- drivers/input/keyboard/ep93xx_keypad.c | 2 +- drivers/input/keyboard/gpio_keys.c | 12 ++++++------ drivers/input/keyboard/gpio_keys_polled.c | 5 ++--- drivers/input/keyboard/hilkbd.c | 4 ++-- drivers/input/keyboard/imx_keypad.c | 2 +- drivers/input/keyboard/jornada680_kbd.c | 2 +- drivers/input/keyboard/jornada720_kbd.c | 2 +- drivers/input/keyboard/lm8323.c | 2 +- drivers/input/keyboard/lm8333.c | 2 +- drivers/input/keyboard/locomokbd.c | 2 +- drivers/input/keyboard/lpc32xx-keys.c | 4 ++-- drivers/input/keyboard/matrix_keypad.c | 8 ++++---- drivers/input/keyboard/max7359_keypad.c | 2 +- drivers/input/keyboard/mcs_touchkey.c | 2 +- drivers/input/keyboard/mpr121_touchkey.c | 6 +++--- drivers/input/keyboard/omap-keypad.c | 2 +- drivers/input/keyboard/omap4-keypad.c | 6 +++--- drivers/input/keyboard/opencores-kbd.c | 2 +- drivers/input/keyboard/pmic8xxx-keypad.c | 6 +++--- drivers/input/keyboard/pxa27x_keypad.c | 2 +- drivers/input/keyboard/pxa930_rotary.c | 2 +- drivers/input/keyboard/qt1070.c | 4 ++-- drivers/input/keyboard/qt2160.c | 8 ++++---- drivers/input/keyboard/samsung-keypad.c | 2 +- drivers/input/keyboard/sh_keysc.c | 2 +- drivers/input/keyboard/spear-keyboard.c | 4 ++-- drivers/input/keyboard/stmpe-keypad.c | 6 +++--- drivers/input/keyboard/tc3589x-keypad.c | 2 +- drivers/input/keyboard/tca6416-keypad.c | 4 ++-- drivers/input/keyboard/tca8418_keypad.c | 4 ++-- drivers/input/keyboard/tegra-kbc.c | 8 ++++---- drivers/input/keyboard/tnetv107x-keypad.c | 2 +- drivers/input/keyboard/twl4030_keypad.c | 4 ++-- drivers/input/keyboard/w90p910_keypad.c | 2 +- 38 files changed, 79 insertions(+), 81 deletions(-) (limited to 'drivers/input/keyboard') diff --git a/drivers/input/keyboard/adp5520-keys.c b/drivers/input/keyboard/adp5520-keys.c index 46796b26ff3..64de9652398 100644 --- a/drivers/input/keyboard/adp5520-keys.c +++ b/drivers/input/keyboard/adp5520-keys.c @@ -69,7 +69,7 @@ static int adp5520_keys_notifier(struct notifier_block *nb, return 0; } -static int __devinit adp5520_keys_probe(struct platform_device *pdev) +static int adp5520_keys_probe(struct platform_device *pdev) { struct adp5520_keys_platform_data *pdata = pdev->dev.platform_data; struct input_dev *input; diff --git a/drivers/input/keyboard/adp5588-keys.c b/drivers/input/keyboard/adp5588-keys.c index 39c2a6d2c99..a20fe70ffa8 100644 --- a/drivers/input/keyboard/adp5588-keys.c +++ b/drivers/input/keyboard/adp5588-keys.c @@ -145,7 +145,7 @@ static int adp5588_gpio_direction_output(struct gpio_chip *chip, return ret; } -static int __devinit adp5588_build_gpiomap(struct adp5588_kpad *kpad, +static int adp5588_build_gpiomap(struct adp5588_kpad *kpad, const struct adp5588_kpad_platform_data *pdata) { bool pin_used[ADP5588_MAXGPIO]; @@ -170,7 +170,7 @@ static int __devinit adp5588_build_gpiomap(struct adp5588_kpad *kpad, return n_unused; } -static int __devinit adp5588_gpio_add(struct adp5588_kpad *kpad) +static int adp5588_gpio_add(struct adp5588_kpad *kpad) { struct device *dev = &kpad->client->dev; const struct adp5588_kpad_platform_data *pdata = dev->platform_data; @@ -319,7 +319,7 @@ static irqreturn_t adp5588_irq(int irq, void *handle) return IRQ_HANDLED; } -static int __devinit adp5588_setup(struct i2c_client *client) +static int adp5588_setup(struct i2c_client *client) { const struct adp5588_kpad_platform_data *pdata = client->dev.platform_data; const struct adp5588_gpio_platform_data *gpio_data = pdata->gpio_data; @@ -382,7 +382,7 @@ static int __devinit adp5588_setup(struct i2c_client *client) return 0; } -static void __devinit adp5588_report_switch_state(struct adp5588_kpad *kpad) +static void adp5588_report_switch_state(struct adp5588_kpad *kpad) { int gpi_stat1 = adp5588_read(kpad->client, GPIO_DAT_STAT1); int gpi_stat2 = adp5588_read(kpad->client, GPIO_DAT_STAT2); @@ -420,8 +420,8 @@ static void __devinit adp5588_report_switch_state(struct adp5588_kpad *kpad) } -static int __devinit adp5588_probe(struct i2c_client *client, - const struct i2c_device_id *id) +static int adp5588_probe(struct i2c_client *client, + const struct i2c_device_id *id) { struct adp5588_kpad *kpad; const struct adp5588_kpad_platform_data *pdata = client->dev.platform_data; diff --git a/drivers/input/keyboard/adp5589-keys.c b/drivers/input/keyboard/adp5589-keys.c index 6e0c2e3a6a8..8f591da17de 100644 --- a/drivers/input/keyboard/adp5589-keys.c +++ b/drivers/input/keyboard/adp5589-keys.c @@ -464,7 +464,7 @@ static int adp5589_gpio_direction_output(struct gpio_chip *chip, return ret; } -static int __devinit adp5589_build_gpiomap(struct adp5589_kpad *kpad, +static int adp5589_build_gpiomap(struct adp5589_kpad *kpad, const struct adp5589_kpad_platform_data *pdata) { bool pin_used[ADP5589_MAXGPIO]; @@ -496,7 +496,7 @@ static int __devinit adp5589_build_gpiomap(struct adp5589_kpad *kpad, return n_unused; } -static int __devinit adp5589_gpio_add(struct adp5589_kpad *kpad) +static int adp5589_gpio_add(struct adp5589_kpad *kpad) { struct device *dev = &kpad->client->dev; const struct adp5589_kpad_platform_data *pdata = dev->platform_data; @@ -641,8 +641,7 @@ static irqreturn_t adp5589_irq(int irq, void *handle) return IRQ_HANDLED; } -static int __devinit adp5589_get_evcode(struct adp5589_kpad *kpad, - unsigned short key) +static int adp5589_get_evcode(struct adp5589_kpad *kpad, unsigned short key) { int i; @@ -655,7 +654,7 @@ static int __devinit adp5589_get_evcode(struct adp5589_kpad *kpad, return -EINVAL; } -static int __devinit adp5589_setup(struct adp5589_kpad *kpad) +static int adp5589_setup(struct adp5589_kpad *kpad) { struct i2c_client *client = kpad->client; const struct adp5589_kpad_platform_data *pdata = @@ -820,7 +819,7 @@ static int __devinit adp5589_setup(struct adp5589_kpad *kpad) return 0; } -static void __devinit adp5589_report_switch_state(struct adp5589_kpad *kpad) +static void adp5589_report_switch_state(struct adp5589_kpad *kpad) { int gpi_stat_tmp, pin_loc; int i; @@ -860,8 +859,8 @@ static void __devinit adp5589_report_switch_state(struct adp5589_kpad *kpad) input_sync(kpad->input); } -static int __devinit adp5589_probe(struct i2c_client *client, - const struct i2c_device_id *id) +static int adp5589_probe(struct i2c_client *client, + const struct i2c_device_id *id) { struct adp5589_kpad *kpad; const struct adp5589_kpad_platform_data *pdata = diff --git a/drivers/input/keyboard/bf54x-keys.c b/drivers/input/keyboard/bf54x-keys.c index 8a7909a8721..8f3c2b66538 100644 --- a/drivers/input/keyboard/bf54x-keys.c +++ b/drivers/input/keyboard/bf54x-keys.c @@ -177,7 +177,7 @@ static irqreturn_t bfin_kpad_isr(int irq, void *dev_id) return IRQ_HANDLED; } -static int __devinit bfin_kpad_probe(struct platform_device *pdev) +static int bfin_kpad_probe(struct platform_device *pdev) { struct bf54x_kpad *bf54x_kpad; struct bfin_kpad_platform_data *pdata = pdev->dev.platform_data; diff --git a/drivers/input/keyboard/ep93xx_keypad.c b/drivers/input/keyboard/ep93xx_keypad.c index bdf32615596..30c00082ed9 100644 --- a/drivers/input/keyboard/ep93xx_keypad.c +++ b/drivers/input/keyboard/ep93xx_keypad.c @@ -232,7 +232,7 @@ static int ep93xx_keypad_resume(struct device *dev) static SIMPLE_DEV_PM_OPS(ep93xx_keypad_pm_ops, ep93xx_keypad_suspend, ep93xx_keypad_resume); -static int __devinit ep93xx_keypad_probe(struct platform_device *pdev) +static int ep93xx_keypad_probe(struct platform_device *pdev) { struct ep93xx_keypad *keypad; const struct matrix_keymap_data *keymap_data; diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gpio_keys.c index 96b5ac5998f..c714c585c30 100644 --- a/drivers/input/keyboard/gpio_keys.c +++ b/drivers/input/keyboard/gpio_keys.c @@ -423,10 +423,10 @@ out: return IRQ_HANDLED; } -static int __devinit gpio_keys_setup_key(struct platform_device *pdev, - struct input_dev *input, - struct gpio_button_data *bdata, - const struct gpio_keys_button *button) +static int gpio_keys_setup_key(struct platform_device *pdev, + struct input_dev *input, + struct gpio_button_data *bdata, + const struct gpio_keys_button *button) { const char *desc = button->desc ? button->desc : "gpio_keys"; struct device *dev = &pdev->dev; @@ -551,7 +551,7 @@ static void gpio_keys_close(struct input_dev *input) /* * Translate OpenFirmware node properties into platform_data */ -static struct gpio_keys_platform_data * __devinit +static struct gpio_keys_platform_data * gpio_keys_get_devtree_pdata(struct device *dev) { struct device_node *node, *pp; @@ -658,7 +658,7 @@ static void gpio_remove_key(struct gpio_button_data *bdata) gpio_free(bdata->button->gpio); } -static int __devinit gpio_keys_probe(struct platform_device *pdev) +static int gpio_keys_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; const struct gpio_keys_platform_data *pdata = dev_get_platdata(dev); diff --git a/drivers/input/keyboard/gpio_keys_polled.c b/drivers/input/keyboard/gpio_keys_polled.c index 922cbbdb5c8..8c09ce244aa 100644 --- a/drivers/input/keyboard/gpio_keys_polled.c +++ b/drivers/input/keyboard/gpio_keys_polled.c @@ -103,8 +103,7 @@ static void gpio_keys_polled_close(struct input_polled_dev *dev) } #ifdef CONFIG_OF -static struct gpio_keys_platform_data * __devinit -gpio_keys_polled_get_devtree_pdata(struct device *dev) +static struct gpio_keys_platform_data *gpio_keys_polled_get_devtree_pdata(struct device *dev) { struct device_node *node, *pp; struct gpio_keys_platform_data *pdata; @@ -196,7 +195,7 @@ gpio_keys_polled_get_devtree_pdata(struct device *dev) } #endif -static int __devinit gpio_keys_polled_probe(struct platform_device *pdev) +static int gpio_keys_polled_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; const struct gpio_keys_platform_data *pdata = dev_get_platdata(dev); diff --git a/drivers/input/keyboard/hilkbd.c b/drivers/input/keyboard/hilkbd.c index 97d3151232b..a5da05ac609 100644 --- a/drivers/input/keyboard/hilkbd.c +++ b/drivers/input/keyboard/hilkbd.c @@ -200,7 +200,7 @@ static void hil_do(unsigned char cmd, unsigned char *data, unsigned int len) /* initialize HIL */ -static int __devinit hil_keyb_init(void) +static int hil_keyb_init(void) { unsigned char c; unsigned int i, kbid; @@ -299,7 +299,7 @@ static void __devexit hil_keyb_exit(void) } #if defined(CONFIG_PARISC) -static int __devinit hil_probe_chip(struct parisc_device *dev) +static int hil_probe_chip(struct parisc_device *dev) { /* Only allow one HIL keyboard */ if (hil_dev.dev) diff --git a/drivers/input/keyboard/imx_keypad.c b/drivers/input/keyboard/imx_keypad.c index 93c344137cc..d4d95428c27 100644 --- a/drivers/input/keyboard/imx_keypad.c +++ b/drivers/input/keyboard/imx_keypad.c @@ -413,7 +413,7 @@ open_err: return -EIO; } -static int __devinit imx_keypad_probe(struct platform_device *pdev) +static int imx_keypad_probe(struct platform_device *pdev) { const struct matrix_keymap_data *keymap_data = pdev->dev.platform_data; struct imx_keypad *keypad; diff --git a/drivers/input/keyboard/jornada680_kbd.c b/drivers/input/keyboard/jornada680_kbd.c index bd1a9c365d1..eac650c26ad 100644 --- a/drivers/input/keyboard/jornada680_kbd.c +++ b/drivers/input/keyboard/jornada680_kbd.c @@ -179,7 +179,7 @@ static void jornadakbd680_poll(struct input_polled_dev *dev) memcpy(jornadakbd->old_scan, jornadakbd->new_scan, JORNADA_SCAN_SIZE); } -static int __devinit jornada680kbd_probe(struct platform_device *pdev) +static int jornada680kbd_probe(struct platform_device *pdev) { struct jornadakbd *jornadakbd; struct input_polled_dev *poll_dev; diff --git a/drivers/input/keyboard/jornada720_kbd.c b/drivers/input/keyboard/jornada720_kbd.c index 9771db1de01..2f08a03e7cb 100644 --- a/drivers/input/keyboard/jornada720_kbd.c +++ b/drivers/input/keyboard/jornada720_kbd.c @@ -94,7 +94,7 @@ static irqreturn_t jornada720_kbd_interrupt(int irq, void *dev_id) return IRQ_HANDLED; }; -static int __devinit jornada720_kbd_probe(struct platform_device *pdev) +static int jornada720_kbd_probe(struct platform_device *pdev) { struct jornadakbd *jornadakbd; struct input_dev *input_dev; diff --git a/drivers/input/keyboard/lm8323.c b/drivers/input/keyboard/lm8323.c index 87432859be5..ee0116b0a42 100644 --- a/drivers/input/keyboard/lm8323.c +++ b/drivers/input/keyboard/lm8323.c @@ -624,7 +624,7 @@ static ssize_t lm8323_set_disable(struct device *dev, } static DEVICE_ATTR(disable_kp, 0644, lm8323_show_disable, lm8323_set_disable); -static int __devinit lm8323_probe(struct i2c_client *client, +static int lm8323_probe(struct i2c_client *client, const struct i2c_device_id *id) { struct lm8323_platform_data *pdata = client->dev.platform_data; diff --git a/drivers/input/keyboard/lm8333.c b/drivers/input/keyboard/lm8333.c index c76e488ce9b..9fc03727d61 100644 --- a/drivers/input/keyboard/lm8333.c +++ b/drivers/input/keyboard/lm8333.c @@ -128,7 +128,7 @@ static irqreturn_t lm8333_irq_thread(int irq, void *data) return IRQ_HANDLED; } -static int __devinit lm8333_probe(struct i2c_client *client, +static int lm8333_probe(struct i2c_client *client, const struct i2c_device_id *id) { const struct lm8333_platform_data *pdata = client->dev.platform_data; diff --git a/drivers/input/keyboard/locomokbd.c b/drivers/input/keyboard/locomokbd.c index dba900c54ce..e2892466f3c 100644 --- a/drivers/input/keyboard/locomokbd.c +++ b/drivers/input/keyboard/locomokbd.c @@ -236,7 +236,7 @@ static void locomokbd_close(struct input_dev *dev) locomo_writel(r, locomokbd->base + LOCOMO_KIC); } -static int __devinit locomokbd_probe(struct locomo_dev *dev) +static int locomokbd_probe(struct locomo_dev *dev) { struct locomokbd *locomokbd; struct input_dev *input_dev; diff --git a/drivers/input/keyboard/lpc32xx-keys.c b/drivers/input/keyboard/lpc32xx-keys.c index 8872ce62c9d..72f8a0be82e 100644 --- a/drivers/input/keyboard/lpc32xx-keys.c +++ b/drivers/input/keyboard/lpc32xx-keys.c @@ -139,7 +139,7 @@ static void lpc32xx_kscan_close(struct input_dev *dev) clk_disable_unprepare(kscandat->clk); } -static int __devinit lpc32xx_parse_dt(struct device *dev, +static int lpc32xx_parse_dt(struct device *dev, struct lpc32xx_kscan_drv *kscandat) { struct device_node *np = dev->of_node; @@ -166,7 +166,7 @@ static int __devinit lpc32xx_parse_dt(struct device *dev, return 0; } -static int __devinit lpc32xx_kscan_probe(struct platform_device *pdev) +static int lpc32xx_kscan_probe(struct platform_device *pdev) { struct lpc32xx_kscan_drv *kscandat; struct input_dev *input; diff --git a/drivers/input/keyboard/matrix_keypad.c b/drivers/input/keyboard/matrix_keypad.c index ed2bacdf2cc..b9d67c2f30d 100644 --- a/drivers/input/keyboard/matrix_keypad.c +++ b/drivers/input/keyboard/matrix_keypad.c @@ -301,8 +301,8 @@ static int matrix_keypad_resume(struct device *dev) static SIMPLE_DEV_PM_OPS(matrix_keypad_pm_ops, matrix_keypad_suspend, matrix_keypad_resume); -static int __devinit matrix_keypad_init_gpio(struct platform_device *pdev, - struct matrix_keypad *keypad) +static int matrix_keypad_init_gpio(struct platform_device *pdev, + struct matrix_keypad *keypad) { const struct matrix_keypad_platform_data *pdata = keypad->pdata; int i, err; @@ -397,7 +397,7 @@ static void matrix_keypad_free_gpio(struct matrix_keypad *keypad) } #ifdef CONFIG_OF -static struct matrix_keypad_platform_data * __devinit +static struct matrix_keypad_platform_data * matrix_keypad_parse_dt(struct device *dev) { struct matrix_keypad_platform_data *pdata; @@ -465,7 +465,7 @@ matrix_keypad_parse_dt(struct device *dev) } #endif -static int __devinit matrix_keypad_probe(struct platform_device *pdev) +static int matrix_keypad_probe(struct platform_device *pdev) { const struct matrix_keypad_platform_data *pdata; struct matrix_keypad *keypad; diff --git a/drivers/input/keyboard/max7359_keypad.c b/drivers/input/keyboard/max7359_keypad.c index 90478d182bc..98b8ff10e6f 100644 --- a/drivers/input/keyboard/max7359_keypad.c +++ b/drivers/input/keyboard/max7359_keypad.c @@ -179,7 +179,7 @@ static void max7359_initialize(struct i2c_client *client) max7359_fall_deepsleep(client); } -static int __devinit max7359_probe(struct i2c_client *client, +static int max7359_probe(struct i2c_client *client, const struct i2c_device_id *id) { const struct matrix_keymap_data *keymap_data = client->dev.platform_data; diff --git a/drivers/input/keyboard/mcs_touchkey.c b/drivers/input/keyboard/mcs_touchkey.c index 751b1419e56..e729774cecd 100644 --- a/drivers/input/keyboard/mcs_touchkey.c +++ b/drivers/input/keyboard/mcs_touchkey.c @@ -97,7 +97,7 @@ static irqreturn_t mcs_touchkey_interrupt(int irq, void *dev_id) return IRQ_HANDLED; } -static int __devinit mcs_touchkey_probe(struct i2c_client *client, +static int mcs_touchkey_probe(struct i2c_client *client, const struct i2c_device_id *id) { const struct mcs_platform_data *pdata; diff --git a/drivers/input/keyboard/mpr121_touchkey.c b/drivers/input/keyboard/mpr121_touchkey.c index 38b1c0f72ed..854486c347f 100644 --- a/drivers/input/keyboard/mpr121_touchkey.c +++ b/drivers/input/keyboard/mpr121_touchkey.c @@ -123,7 +123,7 @@ out: return IRQ_HANDLED; } -static int __devinit mpr121_phys_init(const struct mpr121_platform_data *pdata, +static int mpr121_phys_init(const struct mpr121_platform_data *pdata, struct mpr121_touchkey *mpr121, struct i2c_client *client) { @@ -185,8 +185,8 @@ err_i2c_write: return ret; } -static int __devinit mpr_touchkey_probe(struct i2c_client *client, - const struct i2c_device_id *id) +static int mpr_touchkey_probe(struct i2c_client *client, + const struct i2c_device_id *id) { const struct mpr121_platform_data *pdata = client->dev.platform_data; struct mpr121_touchkey *mpr121; diff --git a/drivers/input/keyboard/omap-keypad.c b/drivers/input/keyboard/omap-keypad.c index 1d17d91ed1e..ffb8c6c1c5d 100644 --- a/drivers/input/keyboard/omap-keypad.c +++ b/drivers/input/keyboard/omap-keypad.c @@ -244,7 +244,7 @@ static int omap_kp_resume(struct platform_device *dev) #define omap_kp_resume NULL #endif -static int __devinit omap_kp_probe(struct platform_device *pdev) +static int omap_kp_probe(struct platform_device *pdev) { struct omap_kp *omap_kp; struct input_dev *input_dev; diff --git a/drivers/input/keyboard/omap4-keypad.c b/drivers/input/keyboard/omap4-keypad.c index 7145ab3401f..c16a3229968 100644 --- a/drivers/input/keyboard/omap4-keypad.c +++ b/drivers/input/keyboard/omap4-keypad.c @@ -211,8 +211,8 @@ static void omap4_keypad_close(struct input_dev *input) } #ifdef CONFIG_OF -static int __devinit omap4_keypad_parse_dt(struct device *dev, - struct omap4_keypad *keypad_data) +static int omap4_keypad_parse_dt(struct device *dev, + struct omap4_keypad *keypad_data) { struct device_node *np = dev->of_node; @@ -241,7 +241,7 @@ static inline int omap4_keypad_parse_dt(struct device *dev, } #endif -static int __devinit omap4_keypad_probe(struct platform_device *pdev) +static int omap4_keypad_probe(struct platform_device *pdev) { const struct omap4_keypad_platform_data *pdata = dev_get_platdata(&pdev->dev); diff --git a/drivers/input/keyboard/opencores-kbd.c b/drivers/input/keyboard/opencores-kbd.c index 7914ede8e4b..ddc1c39c0c3 100644 --- a/drivers/input/keyboard/opencores-kbd.c +++ b/drivers/input/keyboard/opencores-kbd.c @@ -37,7 +37,7 @@ static irqreturn_t opencores_kbd_isr(int irq, void *dev_id) return IRQ_HANDLED; } -static int __devinit opencores_kbd_probe(struct platform_device *pdev) +static int opencores_kbd_probe(struct platform_device *pdev) { struct input_dev *input; struct opencores_kbd *opencores_kbd; diff --git a/drivers/input/keyboard/pmic8xxx-keypad.c b/drivers/input/keyboard/pmic8xxx-keypad.c index d3623c5a3ee..fa177aba5db 100644 --- a/drivers/input/keyboard/pmic8xxx-keypad.c +++ b/drivers/input/keyboard/pmic8xxx-keypad.c @@ -397,7 +397,7 @@ static irqreturn_t pmic8xxx_kp_irq(int irq, void *data) return IRQ_HANDLED; } -static int __devinit pmic8xxx_kpd_init(struct pmic8xxx_kp *kp) +static int pmic8xxx_kpd_init(struct pmic8xxx_kp *kp) { int bits, rc, cycles; u8 scan_val = 0, ctrl_val = 0; @@ -447,7 +447,7 @@ static int __devinit pmic8xxx_kpd_init(struct pmic8xxx_kp *kp) } -static int __devinit pmic8xxx_kp_config_gpio(int gpio_start, int num_gpios, +static int pmic8xxx_kp_config_gpio(int gpio_start, int num_gpios, struct pmic8xxx_kp *kp, struct pm_gpio *gpio_config) { int rc, i; @@ -518,7 +518,7 @@ static void pmic8xxx_kp_close(struct input_dev *dev) * - set irq edge type. * - enable the keypad controller. */ -static int __devinit pmic8xxx_kp_probe(struct platform_device *pdev) +static int pmic8xxx_kp_probe(struct platform_device *pdev) { const struct pm8xxx_keypad_platform_data *pdata = dev_get_platdata(&pdev->dev); diff --git a/drivers/input/keyboard/pxa27x_keypad.c b/drivers/input/keyboard/pxa27x_keypad.c index a6bcd3129f0..91778fee8b9 100644 --- a/drivers/input/keyboard/pxa27x_keypad.c +++ b/drivers/input/keyboard/pxa27x_keypad.c @@ -482,7 +482,7 @@ static const struct dev_pm_ops pxa27x_keypad_pm_ops = { }; #endif -static int __devinit pxa27x_keypad_probe(struct platform_device *pdev) +static int pxa27x_keypad_probe(struct platform_device *pdev) { struct pxa27x_keypad_platform_data *pdata = pdev->dev.platform_data; struct pxa27x_keypad *keypad; diff --git a/drivers/input/keyboard/pxa930_rotary.c b/drivers/input/keyboard/pxa930_rotary.c index f8f89d1f230..60797c22322 100644 --- a/drivers/input/keyboard/pxa930_rotary.c +++ b/drivers/input/keyboard/pxa930_rotary.c @@ -82,7 +82,7 @@ static void pxa930_rotary_close(struct input_dev *dev) clear_sbcr(r); } -static int __devinit pxa930_rotary_probe(struct platform_device *pdev) +static int pxa930_rotary_probe(struct platform_device *pdev) { struct pxa930_rotary_platform_data *pdata = pdev->dev.platform_data; struct pxa930_rotary *r; diff --git a/drivers/input/keyboard/qt1070.c b/drivers/input/keyboard/qt1070.c index eb46405eaad..f9358e7d90b 100644 --- a/drivers/input/keyboard/qt1070.c +++ b/drivers/input/keyboard/qt1070.c @@ -91,7 +91,7 @@ static int qt1070_write(struct i2c_client *client, u8 reg, u8 data) return ret; } -static bool __devinit qt1070_identify(struct i2c_client *client) +static bool qt1070_identify(struct i2c_client *client) { int id, ver; @@ -140,7 +140,7 @@ static irqreturn_t qt1070_interrupt(int irq, void *dev_id) return IRQ_HANDLED; } -static int __devinit qt1070_probe(struct i2c_client *client, +static int qt1070_probe(struct i2c_client *client, const struct i2c_device_id *id) { struct qt1070_data *data; diff --git a/drivers/input/keyboard/qt2160.c b/drivers/input/keyboard/qt2160.c index 691fe92a982..69a6a6ffdbe 100644 --- a/drivers/input/keyboard/qt2160.c +++ b/drivers/input/keyboard/qt2160.c @@ -183,7 +183,7 @@ static void qt2160_worker(struct work_struct *work) qt2160_schedule_read(qt2160); } -static int __devinit qt2160_read(struct i2c_client *client, u8 reg) +static int qt2160_read(struct i2c_client *client, u8 reg) { int ret; @@ -204,7 +204,7 @@ static int __devinit qt2160_read(struct i2c_client *client, u8 reg) return ret; } -static int __devinit qt2160_write(struct i2c_client *client, u8 reg, u8 data) +static int qt2160_write(struct i2c_client *client, u8 reg, u8 data) { int ret; @@ -217,7 +217,7 @@ static int __devinit qt2160_write(struct i2c_client *client, u8 reg, u8 data) } -static bool __devinit qt2160_identify(struct i2c_client *client) +static bool qt2160_identify(struct i2c_client *client) { int id, ver, rev; @@ -248,7 +248,7 @@ static bool __devinit qt2160_identify(struct i2c_client *client) return true; } -static int __devinit qt2160_probe(struct i2c_client *client, +static int qt2160_probe(struct i2c_client *client, const struct i2c_device_id *id) { struct qt2160_data *qt2160; diff --git a/drivers/input/keyboard/samsung-keypad.c b/drivers/input/keyboard/samsung-keypad.c index f02772aa47d..5c6a808ed62 100644 --- a/drivers/input/keyboard/samsung-keypad.c +++ b/drivers/input/keyboard/samsung-keypad.c @@ -366,7 +366,7 @@ static void samsung_keypad_dt_gpio_free(struct samsung_keypad *keypad) } #endif -static int __devinit samsung_keypad_probe(struct platform_device *pdev) +static int samsung_keypad_probe(struct platform_device *pdev) { const struct samsung_keypad_platdata *pdata; const struct matrix_keymap_data *keymap_data; diff --git a/drivers/input/keyboard/sh_keysc.c b/drivers/input/keyboard/sh_keysc.c index 07415a36ec1..ffa9adb23f2 100644 --- a/drivers/input/keyboard/sh_keysc.c +++ b/drivers/input/keyboard/sh_keysc.c @@ -162,7 +162,7 @@ static irqreturn_t sh_keysc_isr(int irq, void *dev_id) return IRQ_HANDLED; } -static int __devinit sh_keysc_probe(struct platform_device *pdev) +static int sh_keysc_probe(struct platform_device *pdev) { struct sh_keysc_priv *priv; struct sh_keysc_info *pdata; diff --git a/drivers/input/keyboard/spear-keyboard.c b/drivers/input/keyboard/spear-keyboard.c index 0c8862343e7..3c503dae7b6 100644 --- a/drivers/input/keyboard/spear-keyboard.c +++ b/drivers/input/keyboard/spear-keyboard.c @@ -146,7 +146,7 @@ static void spear_kbd_close(struct input_dev *dev) } #ifdef CONFIG_OF -static int __devinit spear_kbd_parse_dt(struct platform_device *pdev, +static int spear_kbd_parse_dt(struct platform_device *pdev, struct spear_kbd *kbd) { struct device_node *np = pdev->dev.of_node; @@ -181,7 +181,7 @@ static inline int spear_kbd_parse_dt(struct platform_device *pdev, } #endif -static int __devinit spear_kbd_probe(struct platform_device *pdev) +static int spear_kbd_probe(struct platform_device *pdev) { struct kbd_platform_data *pdata = dev_get_platdata(&pdev->dev); const struct matrix_keymap_data *keymap = pdata ? pdata->keymap : NULL; diff --git a/drivers/input/keyboard/stmpe-keypad.c b/drivers/input/keyboard/stmpe-keypad.c index 286719f5bc0..b3f917d73cd 100644 --- a/drivers/input/keyboard/stmpe-keypad.c +++ b/drivers/input/keyboard/stmpe-keypad.c @@ -166,7 +166,7 @@ static irqreturn_t stmpe_keypad_irq(int irq, void *dev) return IRQ_HANDLED; } -static int __devinit stmpe_keypad_altfunc_init(struct stmpe_keypad *keypad) +static int stmpe_keypad_altfunc_init(struct stmpe_keypad *keypad) { const struct stmpe_keypad_variant *variant = keypad->variant; unsigned int col_gpios = variant->col_gpios; @@ -207,7 +207,7 @@ static int __devinit stmpe_keypad_altfunc_init(struct stmpe_keypad *keypad) return stmpe_set_altfunc(stmpe, pins, STMPE_BLOCK_KEYPAD); } -static int __devinit stmpe_keypad_chip_init(struct stmpe_keypad *keypad) +static int stmpe_keypad_chip_init(struct stmpe_keypad *keypad) { const struct stmpe_keypad_platform_data *plat = keypad->plat; const struct stmpe_keypad_variant *variant = keypad->variant; @@ -257,7 +257,7 @@ static int __devinit stmpe_keypad_chip_init(struct stmpe_keypad *keypad) (plat->debounce_ms << 1)); } -static int __devinit stmpe_keypad_probe(struct platform_device *pdev) +static int stmpe_keypad_probe(struct platform_device *pdev) { struct stmpe *stmpe = dev_get_drvdata(pdev->dev.parent); const struct stmpe_keypad_platform_data *plat; diff --git a/drivers/input/keyboard/tc3589x-keypad.c b/drivers/input/keyboard/tc3589x-keypad.c index 75fa2b98aae..6d725d633ae 100644 --- a/drivers/input/keyboard/tc3589x-keypad.c +++ b/drivers/input/keyboard/tc3589x-keypad.c @@ -299,7 +299,7 @@ static void tc3589x_keypad_close(struct input_dev *input) tc3589x_keypad_disable(keypad); } -static int __devinit tc3589x_keypad_probe(struct platform_device *pdev) +static int tc3589x_keypad_probe(struct platform_device *pdev) { struct tc3589x *tc3589x = dev_get_drvdata(pdev->dev.parent); struct tc_keypad *keypad; diff --git a/drivers/input/keyboard/tca6416-keypad.c b/drivers/input/keyboard/tca6416-keypad.c index f5fa75aa9db..4f44579689a 100644 --- a/drivers/input/keyboard/tca6416-keypad.c +++ b/drivers/input/keyboard/tca6416-keypad.c @@ -166,7 +166,7 @@ static void tca6416_keys_close(struct input_dev *dev) disable_irq(chip->irqnum); } -static int __devinit tca6416_setup_registers(struct tca6416_keypad_chip *chip) +static int tca6416_setup_registers(struct tca6416_keypad_chip *chip) { int error; @@ -197,7 +197,7 @@ static int __devinit tca6416_setup_registers(struct tca6416_keypad_chip *chip) return 0; } -static int __devinit tca6416_keypad_probe(struct i2c_client *client, +static int tca6416_keypad_probe(struct i2c_client *client, const struct i2c_device_id *id) { struct tca6416_keys_platform_data *pdata; diff --git a/drivers/input/keyboard/tca8418_keypad.c b/drivers/input/keyboard/tca8418_keypad.c index 672b5f8bcc1..6f970961f24 100644 --- a/drivers/input/keyboard/tca8418_keypad.c +++ b/drivers/input/keyboard/tca8418_keypad.c @@ -241,7 +241,7 @@ exit: /* * Configure the TCA8418 for keypad operation */ -static int __devinit tca8418_configure(struct tca8418_keypad *keypad_data) +static int tca8418_configure(struct tca8418_keypad *keypad_data) { int reg, error; @@ -270,7 +270,7 @@ static int __devinit tca8418_configure(struct tca8418_keypad *keypad_data) return error; } -static int __devinit tca8418_keypad_probe(struct i2c_client *client, +static int tca8418_keypad_probe(struct i2c_client *client, const struct i2c_device_id *id) { const struct tca8418_keypad_platform_data *pdata = diff --git a/drivers/input/keyboard/tegra-kbc.c b/drivers/input/keyboard/tegra-kbc.c index 0bbcf971d10..cf8ab689231 100644 --- a/drivers/input/keyboard/tegra-kbc.c +++ b/drivers/input/keyboard/tegra-kbc.c @@ -573,7 +573,7 @@ static void tegra_kbc_close(struct input_dev *dev) return tegra_kbc_stop(kbc); } -static bool __devinit +static bool tegra_kbc_check_pin_cfg(const struct tegra_kbc_platform_data *pdata, struct device *dev, unsigned int *num_rows) { @@ -619,7 +619,7 @@ tegra_kbc_check_pin_cfg(const struct tegra_kbc_platform_data *pdata, } #ifdef CONFIG_OF -static struct tegra_kbc_platform_data * __devinit tegra_kbc_dt_parse_pdata( +static struct tegra_kbc_platform_data *tegra_kbc_dt_parse_pdata( struct platform_device *pdev) { struct tegra_kbc_platform_data *pdata; @@ -670,7 +670,7 @@ static inline struct tegra_kbc_platform_data *tegra_kbc_dt_parse_pdata( } #endif -static int __devinit tegra_kbd_setup_keymap(struct tegra_kbc *kbc) +static int tegra_kbd_setup_keymap(struct tegra_kbc *kbc) { const struct tegra_kbc_platform_data *pdata = kbc->pdata; const struct matrix_keymap_data *keymap_data = pdata->keymap_data; @@ -697,7 +697,7 @@ static int __devinit tegra_kbd_setup_keymap(struct tegra_kbc *kbc) return retval; } -static int __devinit tegra_kbc_probe(struct platform_device *pdev) +static int tegra_kbc_probe(struct platform_device *pdev) { const struct tegra_kbc_platform_data *pdata = pdev->dev.platform_data; struct tegra_kbc *kbc; diff --git a/drivers/input/keyboard/tnetv107x-keypad.c b/drivers/input/keyboard/tnetv107x-keypad.c index 05d923c51c1..55cd0700af8 100644 --- a/drivers/input/keyboard/tnetv107x-keypad.c +++ b/drivers/input/keyboard/tnetv107x-keypad.c @@ -153,7 +153,7 @@ static void keypad_stop(struct input_dev *dev) clk_disable(kp->clk); } -static int __devinit keypad_probe(struct platform_device *pdev) +static int keypad_probe(struct platform_device *pdev) { const struct matrix_keypad_platform_data *pdata; const struct matrix_keymap_data *keymap_data; diff --git a/drivers/input/keyboard/twl4030_keypad.c b/drivers/input/keyboard/twl4030_keypad.c index ae25909d51b..78dd9f27dd8 100644 --- a/drivers/input/keyboard/twl4030_keypad.c +++ b/drivers/input/keyboard/twl4030_keypad.c @@ -271,7 +271,7 @@ static irqreturn_t do_kp_irq(int irq, void *_kp) return IRQ_HANDLED; } -static int __devinit twl4030_kp_program(struct twl4030_keypad *kp) +static int twl4030_kp_program(struct twl4030_keypad *kp) { u8 reg; int i; @@ -328,7 +328,7 @@ static int __devinit twl4030_kp_program(struct twl4030_keypad *kp) * Registers keypad device with input subsystem * and configures TWL4030 keypad registers */ -static int __devinit twl4030_kp_probe(struct platform_device *pdev) +static int twl4030_kp_probe(struct platform_device *pdev) { struct twl4030_keypad_data *pdata = pdev->dev.platform_data; const struct matrix_keymap_data *keymap_data; diff --git a/drivers/input/keyboard/w90p910_keypad.c b/drivers/input/keyboard/w90p910_keypad.c index a90fdfc0948..7574e10ef09 100644 --- a/drivers/input/keyboard/w90p910_keypad.c +++ b/drivers/input/keyboard/w90p910_keypad.c @@ -118,7 +118,7 @@ static void w90p910_keypad_close(struct input_dev *dev) clk_disable(keypad->clk); } -static int __devinit w90p910_keypad_probe(struct platform_device *pdev) +static int w90p910_keypad_probe(struct platform_device *pdev) { const struct w90p910_keypad_platform_data *pdata = pdev->dev.platform_data; -- cgit v1.2.3 From e2619cf78e19476bfd7ceaefa9eff0847529346e Mon Sep 17 00:00:00 2001 From: Bill Pemberton Date: Fri, 23 Nov 2012 21:50:47 -0800 Subject: Input: remove use of __devexit CONFIG_HOTPLUG is going away as an option so __devexit is no longer needed. Signed-off-by: Bill Pemberton Acked-by: Mark Brown Signed-off-by: Dmitry Torokhov --- drivers/input/keyboard/adp5520-keys.c | 2 +- drivers/input/keyboard/adp5588-keys.c | 4 ++-- drivers/input/keyboard/adp5589-keys.c | 4 ++-- drivers/input/keyboard/bf54x-keys.c | 2 +- drivers/input/keyboard/davinci_keyscan.c | 2 +- drivers/input/keyboard/ep93xx_keypad.c | 2 +- drivers/input/keyboard/gpio_keys.c | 2 +- drivers/input/keyboard/gpio_keys_polled.c | 2 +- drivers/input/keyboard/hilkbd.c | 4 ++-- drivers/input/keyboard/imx_keypad.c | 2 +- drivers/input/keyboard/jornada680_kbd.c | 2 +- drivers/input/keyboard/jornada720_kbd.c | 2 +- drivers/input/keyboard/lm8323.c | 2 +- drivers/input/keyboard/lm8333.c | 2 +- drivers/input/keyboard/locomokbd.c | 2 +- drivers/input/keyboard/lpc32xx-keys.c | 2 +- drivers/input/keyboard/matrix_keypad.c | 2 +- drivers/input/keyboard/max7359_keypad.c | 2 +- drivers/input/keyboard/mcs_touchkey.c | 2 +- drivers/input/keyboard/mpr121_touchkey.c | 2 +- drivers/input/keyboard/nomadik-ske-keypad.c | 2 +- drivers/input/keyboard/omap-keypad.c | 2 +- drivers/input/keyboard/omap4-keypad.c | 2 +- drivers/input/keyboard/opencores-kbd.c | 2 +- drivers/input/keyboard/pmic8xxx-keypad.c | 2 +- drivers/input/keyboard/pxa27x_keypad.c | 2 +- drivers/input/keyboard/pxa930_rotary.c | 2 +- drivers/input/keyboard/qt1070.c | 2 +- drivers/input/keyboard/qt2160.c | 2 +- drivers/input/keyboard/samsung-keypad.c | 2 +- drivers/input/keyboard/sh_keysc.c | 2 +- drivers/input/keyboard/spear-keyboard.c | 2 +- drivers/input/keyboard/stmpe-keypad.c | 2 +- drivers/input/keyboard/tc3589x-keypad.c | 2 +- drivers/input/keyboard/tca6416-keypad.c | 2 +- drivers/input/keyboard/tca8418_keypad.c | 2 +- drivers/input/keyboard/tegra-kbc.c | 2 +- drivers/input/keyboard/tnetv107x-keypad.c | 2 +- drivers/input/keyboard/twl4030_keypad.c | 2 +- drivers/input/keyboard/w90p910_keypad.c | 2 +- 40 files changed, 43 insertions(+), 43 deletions(-) (limited to 'drivers/input/keyboard') diff --git a/drivers/input/keyboard/adp5520-keys.c b/drivers/input/keyboard/adp5520-keys.c index 64de9652398..ef26b17fb15 100644 --- a/drivers/input/keyboard/adp5520-keys.c +++ b/drivers/input/keyboard/adp5520-keys.c @@ -182,7 +182,7 @@ err: return ret; } -static int __devexit adp5520_keys_remove(struct platform_device *pdev) +static int adp5520_keys_remove(struct platform_device *pdev) { struct adp5520_keys *dev = platform_get_drvdata(pdev); diff --git a/drivers/input/keyboard/adp5588-keys.c b/drivers/input/keyboard/adp5588-keys.c index a20fe70ffa8..dbd2047f164 100644 --- a/drivers/input/keyboard/adp5588-keys.c +++ b/drivers/input/keyboard/adp5588-keys.c @@ -224,7 +224,7 @@ static int adp5588_gpio_add(struct adp5588_kpad *kpad) return 0; } -static void __devexit adp5588_gpio_remove(struct adp5588_kpad *kpad) +static void adp5588_gpio_remove(struct adp5588_kpad *kpad) { struct device *dev = &kpad->client->dev; const struct adp5588_kpad_platform_data *pdata = dev->platform_data; @@ -587,7 +587,7 @@ static int adp5588_probe(struct i2c_client *client, return error; } -static int __devexit adp5588_remove(struct i2c_client *client) +static int adp5588_remove(struct i2c_client *client) { struct adp5588_kpad *kpad = i2c_get_clientdata(client); diff --git a/drivers/input/keyboard/adp5589-keys.c b/drivers/input/keyboard/adp5589-keys.c index 8f591da17de..67d12b3427c 100644 --- a/drivers/input/keyboard/adp5589-keys.c +++ b/drivers/input/keyboard/adp5589-keys.c @@ -550,7 +550,7 @@ static int adp5589_gpio_add(struct adp5589_kpad *kpad) return 0; } -static void __devexit adp5589_gpio_remove(struct adp5589_kpad *kpad) +static void adp5589_gpio_remove(struct adp5589_kpad *kpad) { struct device *dev = &kpad->client->dev; const struct adp5589_kpad_platform_data *pdata = dev->platform_data; @@ -1044,7 +1044,7 @@ err_free_mem: return error; } -static int __devexit adp5589_remove(struct i2c_client *client) +static int adp5589_remove(struct i2c_client *client) { struct adp5589_kpad *kpad = i2c_get_clientdata(client); diff --git a/drivers/input/keyboard/bf54x-keys.c b/drivers/input/keyboard/bf54x-keys.c index 8f3c2b66538..20b9fa91fb9 100644 --- a/drivers/input/keyboard/bf54x-keys.c +++ b/drivers/input/keyboard/bf54x-keys.c @@ -331,7 +331,7 @@ out: return error; } -static int __devexit bfin_kpad_remove(struct platform_device *pdev) +static int bfin_kpad_remove(struct platform_device *pdev) { struct bfin_kpad_platform_data *pdata = pdev->dev.platform_data; struct bf54x_kpad *bf54x_kpad = platform_get_drvdata(pdev); diff --git a/drivers/input/keyboard/davinci_keyscan.c b/drivers/input/keyboard/davinci_keyscan.c index 8e4b438ddc8..4e4e453ea15 100644 --- a/drivers/input/keyboard/davinci_keyscan.c +++ b/drivers/input/keyboard/davinci_keyscan.c @@ -303,7 +303,7 @@ fail1: return error; } -static int __devexit davinci_ks_remove(struct platform_device *pdev) +static int davinci_ks_remove(struct platform_device *pdev) { struct davinci_ks *davinci_ks = platform_get_drvdata(pdev); diff --git a/drivers/input/keyboard/ep93xx_keypad.c b/drivers/input/keyboard/ep93xx_keypad.c index 30c00082ed9..9857e8fd098 100644 --- a/drivers/input/keyboard/ep93xx_keypad.c +++ b/drivers/input/keyboard/ep93xx_keypad.c @@ -346,7 +346,7 @@ failed_free: return err; } -static int __devexit ep93xx_keypad_remove(struct platform_device *pdev) +static int ep93xx_keypad_remove(struct platform_device *pdev) { struct ep93xx_keypad *keypad = platform_get_drvdata(pdev); struct resource *res; diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gpio_keys.c index c714c585c30..1a5cb6f34f4 100644 --- a/drivers/input/keyboard/gpio_keys.c +++ b/drivers/input/keyboard/gpio_keys.c @@ -760,7 +760,7 @@ static int gpio_keys_probe(struct platform_device *pdev) return error; } -static int __devexit gpio_keys_remove(struct platform_device *pdev) +static int gpio_keys_remove(struct platform_device *pdev) { struct gpio_keys_drvdata *ddata = platform_get_drvdata(pdev); struct input_dev *input = ddata->input; diff --git a/drivers/input/keyboard/gpio_keys_polled.c b/drivers/input/keyboard/gpio_keys_polled.c index 8c09ce244aa..32e508781dd 100644 --- a/drivers/input/keyboard/gpio_keys_polled.c +++ b/drivers/input/keyboard/gpio_keys_polled.c @@ -328,7 +328,7 @@ err_free_pdata: return error; } -static int __devexit gpio_keys_polled_remove(struct platform_device *pdev) +static int gpio_keys_polled_remove(struct platform_device *pdev) { struct gpio_keys_polled_dev *bdev = platform_get_drvdata(pdev); const struct gpio_keys_platform_data *pdata = bdev->pdata; diff --git a/drivers/input/keyboard/hilkbd.c b/drivers/input/keyboard/hilkbd.c index a5da05ac609..198dc07a1be 100644 --- a/drivers/input/keyboard/hilkbd.c +++ b/drivers/input/keyboard/hilkbd.c @@ -286,7 +286,7 @@ err1: return err; } -static void __devexit hil_keyb_exit(void) +static void hil_keyb_exit(void) { if (HIL_IRQ) free_irq(HIL_IRQ, hil_dev.dev_id); @@ -320,7 +320,7 @@ static int hil_probe_chip(struct parisc_device *dev) return hil_keyb_init(); } -static int __devexit hil_remove_chip(struct parisc_device *dev) +static int hil_remove_chip(struct parisc_device *dev) { hil_keyb_exit(); diff --git a/drivers/input/keyboard/imx_keypad.c b/drivers/input/keyboard/imx_keypad.c index d4d95428c27..7ad74517654 100644 --- a/drivers/input/keyboard/imx_keypad.c +++ b/drivers/input/keyboard/imx_keypad.c @@ -554,7 +554,7 @@ failed_rel_mem: return error; } -static int __devexit imx_keypad_remove(struct platform_device *pdev) +static int imx_keypad_remove(struct platform_device *pdev) { struct imx_keypad *keypad = platform_get_drvdata(pdev); struct resource *res; diff --git a/drivers/input/keyboard/jornada680_kbd.c b/drivers/input/keyboard/jornada680_kbd.c index eac650c26ad..74e75a6e8de 100644 --- a/drivers/input/keyboard/jornada680_kbd.c +++ b/drivers/input/keyboard/jornada680_kbd.c @@ -240,7 +240,7 @@ static int jornada680kbd_probe(struct platform_device *pdev) } -static int __devexit jornada680kbd_remove(struct platform_device *pdev) +static int jornada680kbd_remove(struct platform_device *pdev) { struct jornadakbd *jornadakbd = platform_get_drvdata(pdev); diff --git a/drivers/input/keyboard/jornada720_kbd.c b/drivers/input/keyboard/jornada720_kbd.c index 2f08a03e7cb..5ceef636df2 100644 --- a/drivers/input/keyboard/jornada720_kbd.c +++ b/drivers/input/keyboard/jornada720_kbd.c @@ -152,7 +152,7 @@ static int jornada720_kbd_probe(struct platform_device *pdev) return err; }; -static int __devexit jornada720_kbd_remove(struct platform_device *pdev) +static int jornada720_kbd_remove(struct platform_device *pdev) { struct jornadakbd *jornadakbd = platform_get_drvdata(pdev); diff --git a/drivers/input/keyboard/lm8323.c b/drivers/input/keyboard/lm8323.c index ee0116b0a42..93c81266213 100644 --- a/drivers/input/keyboard/lm8323.c +++ b/drivers/input/keyboard/lm8323.c @@ -764,7 +764,7 @@ fail1: return err; } -static int __devexit lm8323_remove(struct i2c_client *client) +static int lm8323_remove(struct i2c_client *client) { struct lm8323_chip *lm = i2c_get_clientdata(client); int i; diff --git a/drivers/input/keyboard/lm8333.c b/drivers/input/keyboard/lm8333.c index 9fc03727d61..5a8ca35dc9a 100644 --- a/drivers/input/keyboard/lm8333.c +++ b/drivers/input/keyboard/lm8333.c @@ -202,7 +202,7 @@ static int lm8333_probe(struct i2c_client *client, return err; } -static int __devexit lm8333_remove(struct i2c_client *client) +static int lm8333_remove(struct i2c_client *client) { struct lm8333 *lm8333 = i2c_get_clientdata(client); diff --git a/drivers/input/keyboard/locomokbd.c b/drivers/input/keyboard/locomokbd.c index e2892466f3c..c94d610b9d7 100644 --- a/drivers/input/keyboard/locomokbd.c +++ b/drivers/input/keyboard/locomokbd.c @@ -321,7 +321,7 @@ static int locomokbd_probe(struct locomo_dev *dev) return err; } -static int __devexit locomokbd_remove(struct locomo_dev *dev) +static int locomokbd_remove(struct locomo_dev *dev) { struct locomokbd *locomokbd = locomo_get_drvdata(dev); diff --git a/drivers/input/keyboard/lpc32xx-keys.c b/drivers/input/keyboard/lpc32xx-keys.c index 72f8a0be82e..1b8add6cfb9 100644 --- a/drivers/input/keyboard/lpc32xx-keys.c +++ b/drivers/input/keyboard/lpc32xx-keys.c @@ -310,7 +310,7 @@ err_free_mem: return error; } -static int __devexit lpc32xx_kscan_remove(struct platform_device *pdev) +static int lpc32xx_kscan_remove(struct platform_device *pdev) { struct lpc32xx_kscan_drv *kscandat = platform_get_drvdata(pdev); diff --git a/drivers/input/keyboard/matrix_keypad.c b/drivers/input/keyboard/matrix_keypad.c index b9d67c2f30d..f4ff0dda759 100644 --- a/drivers/input/keyboard/matrix_keypad.c +++ b/drivers/input/keyboard/matrix_keypad.c @@ -539,7 +539,7 @@ err_free_mem: return err; } -static int __devexit matrix_keypad_remove(struct platform_device *pdev) +static int matrix_keypad_remove(struct platform_device *pdev) { struct matrix_keypad *keypad = platform_get_drvdata(pdev); diff --git a/drivers/input/keyboard/max7359_keypad.c b/drivers/input/keyboard/max7359_keypad.c index 98b8ff10e6f..7c7af2b01e6 100644 --- a/drivers/input/keyboard/max7359_keypad.c +++ b/drivers/input/keyboard/max7359_keypad.c @@ -260,7 +260,7 @@ failed_free_mem: return error; } -static int __devexit max7359_remove(struct i2c_client *client) +static int max7359_remove(struct i2c_client *client) { struct max7359_keypad *keypad = i2c_get_clientdata(client); diff --git a/drivers/input/keyboard/mcs_touchkey.c b/drivers/input/keyboard/mcs_touchkey.c index e729774cecd..7c236f9c6a5 100644 --- a/drivers/input/keyboard/mcs_touchkey.c +++ b/drivers/input/keyboard/mcs_touchkey.c @@ -200,7 +200,7 @@ err_free_mem: return error; } -static int __devexit mcs_touchkey_remove(struct i2c_client *client) +static int mcs_touchkey_remove(struct i2c_client *client) { struct mcs_touchkey_data *data = i2c_get_clientdata(client); diff --git a/drivers/input/keyboard/mpr121_touchkey.c b/drivers/input/keyboard/mpr121_touchkey.c index 854486c347f..f7f3e9a9fd3 100644 --- a/drivers/input/keyboard/mpr121_touchkey.c +++ b/drivers/input/keyboard/mpr121_touchkey.c @@ -272,7 +272,7 @@ err_free_mem: return error; } -static int __devexit mpr_touchkey_remove(struct i2c_client *client) +static int mpr_touchkey_remove(struct i2c_client *client) { struct mpr121_touchkey *mpr121 = i2c_get_clientdata(client); diff --git a/drivers/input/keyboard/nomadik-ske-keypad.c b/drivers/input/keyboard/nomadik-ske-keypad.c index 2304a8192cf..0e6a8151fee 100644 --- a/drivers/input/keyboard/nomadik-ske-keypad.c +++ b/drivers/input/keyboard/nomadik-ske-keypad.c @@ -366,7 +366,7 @@ err_free_mem: return error; } -static int __devexit ske_keypad_remove(struct platform_device *pdev) +static int ske_keypad_remove(struct platform_device *pdev) { struct ske_keypad *keypad = platform_get_drvdata(pdev); struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0); diff --git a/drivers/input/keyboard/omap-keypad.c b/drivers/input/keyboard/omap-keypad.c index ffb8c6c1c5d..d0d5226d9cd 100644 --- a/drivers/input/keyboard/omap-keypad.c +++ b/drivers/input/keyboard/omap-keypad.c @@ -357,7 +357,7 @@ err2: return -EINVAL; } -static int __devexit omap_kp_remove(struct platform_device *pdev) +static int omap_kp_remove(struct platform_device *pdev) { struct omap_kp *omap_kp = platform_get_drvdata(pdev); diff --git a/drivers/input/keyboard/omap4-keypad.c b/drivers/input/keyboard/omap4-keypad.c index c16a3229968..e25b022692c 100644 --- a/drivers/input/keyboard/omap4-keypad.c +++ b/drivers/input/keyboard/omap4-keypad.c @@ -406,7 +406,7 @@ err_free_keypad: return error; } -static int __devexit omap4_keypad_remove(struct platform_device *pdev) +static int omap4_keypad_remove(struct platform_device *pdev) { struct omap4_keypad *keypad_data = platform_get_drvdata(pdev); struct resource *res; diff --git a/drivers/input/keyboard/opencores-kbd.c b/drivers/input/keyboard/opencores-kbd.c index ddc1c39c0c3..7ac5f174c6f 100644 --- a/drivers/input/keyboard/opencores-kbd.c +++ b/drivers/input/keyboard/opencores-kbd.c @@ -139,7 +139,7 @@ static int opencores_kbd_probe(struct platform_device *pdev) return error; } -static int __devexit opencores_kbd_remove(struct platform_device *pdev) +static int opencores_kbd_remove(struct platform_device *pdev) { struct opencores_kbd *opencores_kbd = platform_get_drvdata(pdev); diff --git a/drivers/input/keyboard/pmic8xxx-keypad.c b/drivers/input/keyboard/pmic8xxx-keypad.c index fa177aba5db..74339e139d4 100644 --- a/drivers/input/keyboard/pmic8xxx-keypad.c +++ b/drivers/input/keyboard/pmic8xxx-keypad.c @@ -712,7 +712,7 @@ err_alloc_device: return rc; } -static int __devexit pmic8xxx_kp_remove(struct platform_device *pdev) +static int pmic8xxx_kp_remove(struct platform_device *pdev) { struct pmic8xxx_kp *kp = platform_get_drvdata(pdev); diff --git a/drivers/input/keyboard/pxa27x_keypad.c b/drivers/input/keyboard/pxa27x_keypad.c index 91778fee8b9..5330d8fbf6c 100644 --- a/drivers/input/keyboard/pxa27x_keypad.c +++ b/drivers/input/keyboard/pxa27x_keypad.c @@ -595,7 +595,7 @@ failed_free: return error; } -static int __devexit pxa27x_keypad_remove(struct platform_device *pdev) +static int pxa27x_keypad_remove(struct platform_device *pdev) { struct pxa27x_keypad *keypad = platform_get_drvdata(pdev); struct resource *res; diff --git a/drivers/input/keyboard/pxa930_rotary.c b/drivers/input/keyboard/pxa930_rotary.c index 60797c22322..bcad95be73a 100644 --- a/drivers/input/keyboard/pxa930_rotary.c +++ b/drivers/input/keyboard/pxa930_rotary.c @@ -174,7 +174,7 @@ failed_free: return err; } -static int __devexit pxa930_rotary_remove(struct platform_device *pdev) +static int pxa930_rotary_remove(struct platform_device *pdev) { struct pxa930_rotary *r = platform_get_drvdata(pdev); diff --git a/drivers/input/keyboard/qt1070.c b/drivers/input/keyboard/qt1070.c index f9358e7d90b..42b773b3125 100644 --- a/drivers/input/keyboard/qt1070.c +++ b/drivers/input/keyboard/qt1070.c @@ -230,7 +230,7 @@ err_free_mem: return err; } -static int __devexit qt1070_remove(struct i2c_client *client) +static int qt1070_remove(struct i2c_client *client) { struct qt1070_data *data = i2c_get_clientdata(client); diff --git a/drivers/input/keyboard/qt2160.c b/drivers/input/keyboard/qt2160.c index 69a6a6ffdbe..3dc2b0f27b0 100644 --- a/drivers/input/keyboard/qt2160.c +++ b/drivers/input/keyboard/qt2160.c @@ -335,7 +335,7 @@ err_free_mem: return error; } -static int __devexit qt2160_remove(struct i2c_client *client) +static int qt2160_remove(struct i2c_client *client) { struct qt2160_data *qt2160 = i2c_get_clientdata(client); diff --git a/drivers/input/keyboard/samsung-keypad.c b/drivers/input/keyboard/samsung-keypad.c index 5c6a808ed62..acc161966c3 100644 --- a/drivers/input/keyboard/samsung-keypad.c +++ b/drivers/input/keyboard/samsung-keypad.c @@ -523,7 +523,7 @@ err_free_mem: return error; } -static int __devexit samsung_keypad_remove(struct platform_device *pdev) +static int samsung_keypad_remove(struct platform_device *pdev) { struct samsung_keypad *keypad = platform_get_drvdata(pdev); diff --git a/drivers/input/keyboard/sh_keysc.c b/drivers/input/keyboard/sh_keysc.c index ffa9adb23f2..fdb9eb2df38 100644 --- a/drivers/input/keyboard/sh_keysc.c +++ b/drivers/input/keyboard/sh_keysc.c @@ -272,7 +272,7 @@ static int sh_keysc_probe(struct platform_device *pdev) return error; } -static int __devexit sh_keysc_remove(struct platform_device *pdev) +static int sh_keysc_remove(struct platform_device *pdev) { struct sh_keysc_priv *priv = platform_get_drvdata(pdev); diff --git a/drivers/input/keyboard/spear-keyboard.c b/drivers/input/keyboard/spear-keyboard.c index 3c503dae7b6..d70093bef74 100644 --- a/drivers/input/keyboard/spear-keyboard.c +++ b/drivers/input/keyboard/spear-keyboard.c @@ -279,7 +279,7 @@ static int spear_kbd_probe(struct platform_device *pdev) return 0; } -static int __devexit spear_kbd_remove(struct platform_device *pdev) +static int spear_kbd_remove(struct platform_device *pdev) { device_init_wakeup(&pdev->dev, 0); platform_set_drvdata(pdev, NULL); diff --git a/drivers/input/keyboard/stmpe-keypad.c b/drivers/input/keyboard/stmpe-keypad.c index b3f917d73cd..7bac0524900 100644 --- a/drivers/input/keyboard/stmpe-keypad.c +++ b/drivers/input/keyboard/stmpe-keypad.c @@ -335,7 +335,7 @@ static int stmpe_keypad_probe(struct platform_device *pdev) return 0; } -static int __devexit stmpe_keypad_remove(struct platform_device *pdev) +static int stmpe_keypad_remove(struct platform_device *pdev) { struct stmpe_keypad *keypad = platform_get_drvdata(pdev); diff --git a/drivers/input/keyboard/tc3589x-keypad.c b/drivers/input/keyboard/tc3589x-keypad.c index 6d725d633ae..2fb0d76a04c 100644 --- a/drivers/input/keyboard/tc3589x-keypad.c +++ b/drivers/input/keyboard/tc3589x-keypad.c @@ -382,7 +382,7 @@ err_free_mem: return error; } -static int __devexit tc3589x_keypad_remove(struct platform_device *pdev) +static int tc3589x_keypad_remove(struct platform_device *pdev) { struct tc_keypad *keypad = platform_get_drvdata(pdev); int irq = platform_get_irq(pdev, 0); diff --git a/drivers/input/keyboard/tca6416-keypad.c b/drivers/input/keyboard/tca6416-keypad.c index 4f44579689a..bfc832c35a7 100644 --- a/drivers/input/keyboard/tca6416-keypad.c +++ b/drivers/input/keyboard/tca6416-keypad.c @@ -313,7 +313,7 @@ fail1: return error; } -static int __devexit tca6416_keypad_remove(struct i2c_client *client) +static int tca6416_keypad_remove(struct i2c_client *client) { struct tca6416_keypad_chip *chip = i2c_get_clientdata(client); diff --git a/drivers/input/keyboard/tca8418_keypad.c b/drivers/input/keyboard/tca8418_keypad.c index 6f970961f24..f1e966bdcff 100644 --- a/drivers/input/keyboard/tca8418_keypad.c +++ b/drivers/input/keyboard/tca8418_keypad.c @@ -388,7 +388,7 @@ fail1: return error; } -static int __devexit tca8418_keypad_remove(struct i2c_client *client) +static int tca8418_keypad_remove(struct i2c_client *client) { struct tca8418_keypad *keypad_data = i2c_get_clientdata(client); diff --git a/drivers/input/keyboard/tegra-kbc.c b/drivers/input/keyboard/tegra-kbc.c index cf8ab689231..c76f96872d3 100644 --- a/drivers/input/keyboard/tegra-kbc.c +++ b/drivers/input/keyboard/tegra-kbc.c @@ -838,7 +838,7 @@ err_free_pdata: return err; } -static int __devexit tegra_kbc_remove(struct platform_device *pdev) +static int tegra_kbc_remove(struct platform_device *pdev) { struct tegra_kbc *kbc = platform_get_drvdata(pdev); struct resource *res; diff --git a/drivers/input/keyboard/tnetv107x-keypad.c b/drivers/input/keyboard/tnetv107x-keypad.c index 55cd0700af8..ee163501129 100644 --- a/drivers/input/keyboard/tnetv107x-keypad.c +++ b/drivers/input/keyboard/tnetv107x-keypad.c @@ -301,7 +301,7 @@ error_res: return error; } -static int __devexit keypad_remove(struct platform_device *pdev) +static int keypad_remove(struct platform_device *pdev) { struct keypad_data *kp = platform_get_drvdata(pdev); diff --git a/drivers/input/keyboard/twl4030_keypad.c b/drivers/input/keyboard/twl4030_keypad.c index 78dd9f27dd8..04f84fd5717 100644 --- a/drivers/input/keyboard/twl4030_keypad.c +++ b/drivers/input/keyboard/twl4030_keypad.c @@ -432,7 +432,7 @@ err1: return error; } -static int __devexit twl4030_kp_remove(struct platform_device *pdev) +static int twl4030_kp_remove(struct platform_device *pdev) { struct twl4030_keypad *kp = platform_get_drvdata(pdev); diff --git a/drivers/input/keyboard/w90p910_keypad.c b/drivers/input/keyboard/w90p910_keypad.c index 7574e10ef09..ee163bee8cc 100644 --- a/drivers/input/keyboard/w90p910_keypad.c +++ b/drivers/input/keyboard/w90p910_keypad.c @@ -234,7 +234,7 @@ failed_free: return error; } -static int __devexit w90p910_keypad_remove(struct platform_device *pdev) +static int w90p910_keypad_remove(struct platform_device *pdev) { struct w90p910_keypad *keypad = platform_get_drvdata(pdev); struct resource *res; -- cgit v1.2.3 From 6ea32387a0c7fb9ca0213fd22b47c5a1ca4c2972 Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Wed, 14 Nov 2012 08:55:21 -0800 Subject: Input: stmpe-keypad - add support for Device Tree bindings This patch allows the STMPE driver to be successfully probed and initialised when Device Tree support is enabled. Besides the usual platform data changes, we also separate the process of filling in the 'in use' pin bitmap, as we have to extract the information from Device Tree in the DT boot case. Acked-by: Arnd Bergmann Acked-by: Linus Walleij Signed-off-by: Lee Jones Signed-off-by: Dmitry Torokhov --- drivers/input/keyboard/stmpe-keypad.c | 60 +++++++++++++++++++++++++++++------ 1 file changed, 51 insertions(+), 9 deletions(-) (limited to 'drivers/input/keyboard') diff --git a/drivers/input/keyboard/stmpe-keypad.c b/drivers/input/keyboard/stmpe-keypad.c index 7bac0524900..5cbec56f772 100644 --- a/drivers/input/keyboard/stmpe-keypad.c +++ b/drivers/input/keyboard/stmpe-keypad.c @@ -257,6 +257,51 @@ static int stmpe_keypad_chip_init(struct stmpe_keypad *keypad) (plat->debounce_ms << 1)); } +static void stmpe_keypad_fill_used_pins(struct stmpe_keypad *keypad) +{ + int row, col; + + for (row = 0; row < STMPE_KEYPAD_MAX_ROWS; row++) { + for (col = 0; col < STMPE_KEYPAD_MAX_COLS; col++) { + int code = MATRIX_SCAN_CODE(row, col, + STMPE_KEYPAD_ROW_SHIFT); + if (keypad->keymap[code] != KEY_RESERVED) { + keypad->rows |= 1 << row; + keypad->cols |= 1 << col; + } + } + } +} + +#ifdef CONFIG_OF +static const struct stmpe_keypad_platform_data * +stmpe_keypad_of_probe(struct device *dev) +{ + struct device_node *np = dev->of_node; + struct stmpe_keypad_platform_data *plat; + + if (!np) + return ERR_PTR(-ENODEV); + + plat = devm_kzalloc(dev, sizeof(*plat), GFP_KERNEL); + if (!plat) + return ERR_PTR(-ENOMEM); + + of_property_read_u32(np, "debounce-interval", &plat->debounce_ms); + of_property_read_u32(np, "st,scan-count", &plat->scan_count); + + plat->no_autorepeat = of_property_read_bool(np, "st,no-autorepeat"); + + return plat; +} +#else +static inline const struct stmpe_keypad_platform_data * +stmpe_keypad_of_probe(struct device *dev) +{ + return ERR_PTR(-EINVAL); +} +#endif + static int stmpe_keypad_probe(struct platform_device *pdev) { struct stmpe *stmpe = dev_get_drvdata(pdev->dev.parent); @@ -265,11 +310,13 @@ static int stmpe_keypad_probe(struct platform_device *pdev) struct input_dev *input; int error; int irq; - int i; plat = stmpe->pdata->keypad; - if (!plat) - return -ENODEV; + if (!plat) { + plat = stmpe_keypad_of_probe(&pdev->dev); + if (IS_ERR(plat)) + return PTR_ERR(plat); + } irq = platform_get_irq(pdev, 0); if (irq < 0) @@ -299,12 +346,7 @@ static int stmpe_keypad_probe(struct platform_device *pdev) if (!plat->no_autorepeat) __set_bit(EV_REP, input->evbit); - for (i = 0; i < plat->keymap_data->keymap_size; i++) { - unsigned int key = plat->keymap_data->keymap[i]; - - keypad->cols |= 1 << KEY_COL(key); - keypad->rows |= 1 << KEY_ROW(key); - } + stmpe_keypad_fill_used_pins(keypad); keypad->stmpe = stmpe; keypad->plat = plat; -- cgit v1.2.3 From 92aab96034c2cdf11eb61a6b14409c2da8e5158d Mon Sep 17 00:00:00 2001 From: Andreas Pretzsch Date: Sat, 24 Nov 2012 23:31:38 -0800 Subject: Input: imx_keypad - only set enabled columns to open-drain In imx_keypad_inhibit(), all 8 columns were set to open-drain, in contrast to the rest of the driver, where only the enabled columns are modified/used. Contrary to the normal expectation, this also affects column I/Os not even mapped via IOMUX to the KPP hardware module but used as a GPIO. Therefore only init enabled columns to open-drain and leave all others with their default reset value of 0, i.e. totem-pole. Signed-off-by: Andreas Pretzsch Signed-off-by: Dmitry Torokhov --- drivers/input/keyboard/imx_keypad.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'drivers/input/keyboard') diff --git a/drivers/input/keyboard/imx_keypad.c b/drivers/input/keyboard/imx_keypad.c index 7ad74517654..6d150e3e1f5 100644 --- a/drivers/input/keyboard/imx_keypad.c +++ b/drivers/input/keyboard/imx_keypad.c @@ -362,7 +362,8 @@ static void imx_keypad_inhibit(struct imx_keypad *keypad) writew(reg_val, keypad->mmio_base + KPSR); /* Colums as open drain and disable all rows */ - writew(0xff00, keypad->mmio_base + KPCR); + reg_val = (keypad->cols_en_mask & 0xff) << 8; + writew(reg_val, keypad->mmio_base + KPCR); } static void imx_keypad_close(struct input_dev *dev) -- cgit v1.2.3 From 9336648978c2e9de9bf3c026918db386ace19a86 Mon Sep 17 00:00:00 2001 From: Vipul Kumar Samar Date: Mon, 26 Nov 2012 08:50:08 -0800 Subject: Input: spear-keyboard - add clk_{un}prepare() support clk_{un}prepare is mandatory for platforms using common clock framework. Because for SPEAr we don't do anything in clk_{un}prepare() calls, just call them once in probe/remove. Signed-off-by: Vipul Kumar Samar Signed-off-by: Viresh Kumar Signed-off-by: Dmitry Torokhov --- drivers/input/keyboard/spear-keyboard.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'drivers/input/keyboard') diff --git a/drivers/input/keyboard/spear-keyboard.c b/drivers/input/keyboard/spear-keyboard.c index d70093bef74..695d237417d 100644 --- a/drivers/input/keyboard/spear-keyboard.c +++ b/drivers/input/keyboard/spear-keyboard.c @@ -267,9 +267,14 @@ static int spear_kbd_probe(struct platform_device *pdev) return error; } + error = clk_prepare(kbd->clk); + if (error) + return error; + error = input_register_device(input_dev); if (error) { dev_err(&pdev->dev, "Unable to register keyboard device\n"); + clk_unprepare(kbd->clk); return error; } @@ -281,6 +286,11 @@ static int spear_kbd_probe(struct platform_device *pdev) static int spear_kbd_remove(struct platform_device *pdev) { + struct spear_kbd *kbd = platform_get_drvdata(pdev); + + input_unregister_device(kbd->input); + clk_unprepare(kbd->clk); + device_init_wakeup(&pdev->dev, 0); platform_set_drvdata(pdev, NULL); -- cgit v1.2.3 From a57da34795452bbe44b55e2b69c3ab6b117cc4b4 Mon Sep 17 00:00:00 2001 From: Sachin Kamat Date: Tue, 27 Nov 2012 22:34:38 -0800 Subject: Input: samsung-keypad - switch to using managed resources devm_* functions are device managed and make error handling and code simpler. While at it also fix error exit paths. Signed-off-by: Sachin Kamat Signed-off-by: Dmitry Torokhov --- drivers/input/keyboard/samsung-keypad.c | 103 ++++++++++---------------------- 1 file changed, 31 insertions(+), 72 deletions(-) (limited to 'drivers/input/keyboard') diff --git a/drivers/input/keyboard/samsung-keypad.c b/drivers/input/keyboard/samsung-keypad.c index acc161966c3..22e357b5102 100644 --- a/drivers/input/keyboard/samsung-keypad.c +++ b/drivers/input/keyboard/samsung-keypad.c @@ -309,7 +309,7 @@ static void samsung_keypad_parse_dt_gpio(struct device *dev, struct samsung_keypad *keypad) { struct device_node *np = dev->of_node; - int gpio, ret, row, col; + int gpio, error, row, col; for (row = 0; row < keypad->rows; row++) { gpio = of_get_named_gpio(np, "row-gpios", row); @@ -320,10 +320,11 @@ static void samsung_keypad_parse_dt_gpio(struct device *dev, continue; } - ret = gpio_request(gpio, "keypad-row"); - if (ret) - dev_err(dev, "keypad row[%d] gpio request failed\n", - row); + error = devm_gpio_request(dev, gpio, "keypad-row"); + if (error) + dev_err(dev, + "keypad row[%d] gpio request failed: %d\n", + row, error); } for (col = 0; col < keypad->cols; col++) { @@ -335,35 +336,19 @@ static void samsung_keypad_parse_dt_gpio(struct device *dev, continue; } - ret = gpio_request(gpio, "keypad-col"); - if (ret) - dev_err(dev, "keypad column[%d] gpio request failed\n", - col); + error = devm_gpio_request(dev, gpio, "keypad-col"); + if (error) + dev_err(dev, + "keypad column[%d] gpio request failed: %d\n", + col, error); } } - -static void samsung_keypad_dt_gpio_free(struct samsung_keypad *keypad) -{ - int cnt; - - for (cnt = 0; cnt < keypad->rows; cnt++) - if (gpio_is_valid(keypad->row_gpios[cnt])) - gpio_free(keypad->row_gpios[cnt]); - - for (cnt = 0; cnt < keypad->cols; cnt++) - if (gpio_is_valid(keypad->col_gpios[cnt])) - gpio_free(keypad->col_gpios[cnt]); -} #else static struct samsung_keypad_platdata *samsung_keypad_parse_dt(struct device *dev) { return NULL; } - -static void samsung_keypad_dt_gpio_free(struct samsung_keypad *keypad) -{ -} #endif static int samsung_keypad_probe(struct platform_device *pdev) @@ -405,36 +390,30 @@ static int samsung_keypad_probe(struct platform_device *pdev) row_shift = get_count_order(pdata->cols); keymap_size = (pdata->rows << row_shift) * sizeof(keypad->keycodes[0]); - keypad = kzalloc(sizeof(*keypad) + keymap_size, GFP_KERNEL); - input_dev = input_allocate_device(); - if (!keypad || !input_dev) { - error = -ENOMEM; - goto err_free_mem; - } + keypad = devm_kzalloc(&pdev->dev, sizeof(*keypad) + keymap_size, + GFP_KERNEL); + input_dev = devm_input_allocate_device(&pdev->dev); + if (!keypad || !input_dev) + return -ENOMEM; res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (!res) { - error = -ENODEV; - goto err_free_mem; - } + if (!res) + return -ENODEV; - keypad->base = ioremap(res->start, resource_size(res)); - if (!keypad->base) { - error = -EBUSY; - goto err_free_mem; - } + keypad->base = devm_ioremap(&pdev->dev, res->start, resource_size(res)); + if (!keypad->base) + return -EBUSY; - keypad->clk = clk_get(&pdev->dev, "keypad"); + keypad->clk = devm_clk_get(&pdev->dev, "keypad"); if (IS_ERR(keypad->clk)) { dev_err(&pdev->dev, "failed to get keypad clk\n"); - error = PTR_ERR(keypad->clk); - goto err_unmap_base; + return PTR_ERR(keypad->clk); } error = clk_prepare(keypad->clk); if (error) { dev_err(&pdev->dev, "keypad clock prepare failed\n"); - goto err_put_clk; + return error; } keypad->input_dev = input_dev; @@ -479,14 +458,15 @@ static int samsung_keypad_probe(struct platform_device *pdev) keypad->irq = platform_get_irq(pdev, 0); if (keypad->irq < 0) { error = keypad->irq; - goto err_put_clk; + goto err_unprepare_clk; } - error = request_threaded_irq(keypad->irq, NULL, samsung_keypad_irq, - IRQF_ONESHOT, dev_name(&pdev->dev), keypad); + error = devm_request_threaded_irq(&pdev->dev, keypad->irq, NULL, + samsung_keypad_irq, IRQF_ONESHOT, + dev_name(&pdev->dev), keypad); if (error) { dev_err(&pdev->dev, "failed to register keypad interrupt\n"); - goto err_put_clk; + goto err_unprepare_clk; } device_init_wakeup(&pdev->dev, pdata->wakeup); @@ -495,7 +475,7 @@ static int samsung_keypad_probe(struct platform_device *pdev) error = input_register_device(keypad->input_dev); if (error) - goto err_free_irq; + goto err_disable_runtime_pm; if (pdev->dev.of_node) { devm_kfree(&pdev->dev, (void *)pdata->keymap_data->keymap); @@ -504,22 +484,12 @@ static int samsung_keypad_probe(struct platform_device *pdev) } return 0; -err_free_irq: - free_irq(keypad->irq, keypad); +err_disable_runtime_pm: pm_runtime_disable(&pdev->dev); device_init_wakeup(&pdev->dev, 0); platform_set_drvdata(pdev, NULL); err_unprepare_clk: clk_unprepare(keypad->clk); -err_put_clk: - clk_put(keypad->clk); - samsung_keypad_dt_gpio_free(keypad); -err_unmap_base: - iounmap(keypad->base); -err_free_mem: - input_free_device(input_dev); - kfree(keypad); - return error; } @@ -533,18 +503,7 @@ static int samsung_keypad_remove(struct platform_device *pdev) input_unregister_device(keypad->input_dev); - /* - * It is safe to free IRQ after unregistering device because - * samsung_keypad_close will shut off interrupts. - */ - free_irq(keypad->irq, keypad); - clk_unprepare(keypad->clk); - clk_put(keypad->clk); - samsung_keypad_dt_gpio_free(keypad); - - iounmap(keypad->base); - kfree(keypad); return 0; } -- cgit v1.2.3 From 5b76d7b4cd965a84d922f303fe51a49cca89f9bb Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Sat, 24 Nov 2012 01:22:43 -0800 Subject: Input: gpio_keys - report initial state when opening the device Instead of reporting the initial stage when the device is registered we should do it when the device is opened (so there are users). Signed-off-by: Dmitry Torokhov --- drivers/input/keyboard/gpio_keys.c | 39 +++++++++++++++++++++++++------------- 1 file changed, 26 insertions(+), 13 deletions(-) (limited to 'drivers/input/keyboard') diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gpio_keys.c index 1a5cb6f34f4..c7764ca17b8 100644 --- a/drivers/input/keyboard/gpio_keys.c +++ b/drivers/input/keyboard/gpio_keys.c @@ -526,12 +526,35 @@ fail: return error; } +static void gpio_keys_report_state(struct gpio_keys_drvdata *ddata) +{ + struct input_dev *input = ddata->input; + int i; + + for (i = 0; i < ddata->pdata->nbuttons; i++) { + struct gpio_button_data *bdata = &ddata->data[i]; + if (gpio_is_valid(bdata->button->gpio)) + gpio_keys_gpio_report_event(bdata); + } + input_sync(input); +} + static int gpio_keys_open(struct input_dev *input) { struct gpio_keys_drvdata *ddata = input_get_drvdata(input); const struct gpio_keys_platform_data *pdata = ddata->pdata; + int error; + + if (pdata->enable) { + error = pdata->enable(input->dev.parent); + if (error) + return error; + } - return pdata->enable ? pdata->enable(input->dev.parent) : 0; + /* Report current state of buttons that are connected to GPIOs */ + gpio_keys_report_state(ddata); + + return 0; } static void gpio_keys_close(struct input_dev *input) @@ -731,14 +754,6 @@ static int gpio_keys_probe(struct platform_device *pdev) goto fail3; } - /* get current state of buttons that are connected to GPIOs */ - for (i = 0; i < pdata->nbuttons; i++) { - struct gpio_button_data *bdata = &ddata->data[i]; - if (gpio_is_valid(bdata->button->gpio)) - gpio_keys_gpio_report_event(bdata); - } - input_sync(input); - device_init_wakeup(&pdev->dev, wakeup); return 0; @@ -810,11 +825,9 @@ static int gpio_keys_resume(struct device *dev) struct gpio_button_data *bdata = &ddata->data[i]; if (bdata->button->wakeup && device_may_wakeup(dev)) disable_irq_wake(bdata->irq); - - if (gpio_is_valid(bdata->button->gpio)) - gpio_keys_gpio_report_event(bdata); } - input_sync(ddata->input); + + gpio_keys_report_state(ddata); return 0; } -- cgit v1.2.3 From dda19a92f033399641e47db0b75beb01d001146b Mon Sep 17 00:00:00 2001 From: Jonas Aaberg Date: Sat, 24 Nov 2012 00:10:29 -0800 Subject: Input: gpio_keys - disable hardware on suspend Disable hardware if active when suspending if the hw can not wake the system from suspend. [Dmitry Torokhov: use input_dev->users instead of a separate flag] Signed-off-by: Jonas Aaberg Signed-off-by: Philippe Langlais Reviewed-by: Bengt Jonsson Signed-off-by: Lee Jones Signed-off-by: Dmitry Torokhov --- drivers/input/keyboard/gpio_keys.c | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) (limited to 'drivers/input/keyboard') diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gpio_keys.c index c7764ca17b8..79435de0caa 100644 --- a/drivers/input/keyboard/gpio_keys.c +++ b/drivers/input/keyboard/gpio_keys.c @@ -803,6 +803,7 @@ static int gpio_keys_remove(struct platform_device *pdev) static int gpio_keys_suspend(struct device *dev) { struct gpio_keys_drvdata *ddata = dev_get_drvdata(dev); + struct input_dev *input = ddata->input; int i; if (device_may_wakeup(dev)) { @@ -811,6 +812,11 @@ static int gpio_keys_suspend(struct device *dev) if (bdata->button->wakeup) enable_irq_wake(bdata->irq); } + } else { + mutex_lock(&input->mutex); + if (input->users) + gpio_keys_close(input); + mutex_unlock(&input->mutex); } return 0; @@ -819,16 +825,27 @@ static int gpio_keys_suspend(struct device *dev) static int gpio_keys_resume(struct device *dev) { struct gpio_keys_drvdata *ddata = dev_get_drvdata(dev); + struct input_dev *input = ddata->input; + int error = 0; int i; - for (i = 0; i < ddata->pdata->nbuttons; i++) { - struct gpio_button_data *bdata = &ddata->data[i]; - if (bdata->button->wakeup && device_may_wakeup(dev)) - disable_irq_wake(bdata->irq); + if (device_may_wakeup(dev)) { + for (i = 0; i < ddata->pdata->nbuttons; i++) { + struct gpio_button_data *bdata = &ddata->data[i]; + if (bdata->button->wakeup) + disable_irq_wake(bdata->irq); + } + } else { + mutex_lock(&input->mutex); + if (input->users) + error = gpio_keys_open(input); + mutex_unlock(&input->mutex); } - gpio_keys_report_state(ddata); + if (error) + return error; + gpio_keys_report_state(ddata); return 0; } #endif -- cgit v1.2.3 From e89e29b8585379c844b03fb3aa2cca73e2bc5b26 Mon Sep 17 00:00:00 2001 From: Alban Bedel Date: Mon, 5 Nov 2012 10:55:25 -0800 Subject: Input: tca8418_keypad - add support for device tree bindings Signed-off-by: Alban Bedel Signed-off-by: Dmitry Torokhov --- drivers/input/keyboard/tca8418_keypad.c | 68 ++++++++++++++++++++------------- 1 file changed, 41 insertions(+), 27 deletions(-) (limited to 'drivers/input/keyboard') diff --git a/drivers/input/keyboard/tca8418_keypad.c b/drivers/input/keyboard/tca8418_keypad.c index f1e966bdcff..1a2894dd03c 100644 --- a/drivers/input/keyboard/tca8418_keypad.c +++ b/drivers/input/keyboard/tca8418_keypad.c @@ -35,6 +35,7 @@ #include #include #include +#include /* TCA8418 hardware limits */ #define TCA8418_MAX_ROWS 8 @@ -116,10 +117,15 @@ static const struct i2c_device_id tca8418_id[] = { }; MODULE_DEVICE_TABLE(i2c, tca8418_id); +#ifdef CONFIG_OF +static const struct of_device_id tca8418_dt_ids[] __devinitconst = { + { .compatible = "ti,tca8418", }, + { } +}; +MODULE_DEVICE_TABLE(of, tca8418_dt_ids); +#endif + struct tca8418_keypad { - unsigned int rows; - unsigned int cols; - unsigned int keypad_mask; /* Mask for keypad col/rol regs */ unsigned int irq; unsigned int row_shift; @@ -241,7 +247,8 @@ exit: /* * Configure the TCA8418 for keypad operation */ -static int tca8418_configure(struct tca8418_keypad *keypad_data) +static int tca8418_configure(struct tca8418_keypad *keypad_data, + u32 rows, u32 cols) { int reg, error; @@ -253,9 +260,8 @@ static int tca8418_configure(struct tca8418_keypad *keypad_data) /* Assemble a mask for row and column registers */ - reg = ~(~0 << keypad_data->rows); - reg += (~(~0 << keypad_data->cols)) << 8; - keypad_data->keypad_mask = reg; + reg = ~(~0 << rows); + reg += (~(~0 << cols)) << 8; /* Set registers to keypad mode */ error |= tca8418_write_byte(keypad_data, REG_KP_GPIO1, reg); @@ -277,25 +283,36 @@ static int tca8418_keypad_probe(struct i2c_client *client, client->dev.platform_data; struct tca8418_keypad *keypad_data; struct input_dev *input; + const struct matrix_keymap_data *keymap_data = NULL; + u32 rows = 0, cols = 0; + bool rep = false; + bool irq_is_gpio = false; int error, row_shift, max_keys; /* Copy the platform data */ - if (!pdata) { - dev_dbg(&client->dev, "no platform data\n"); - return -EINVAL; + if (pdata) { + if (!pdata->keymap_data) { + dev_err(&client->dev, "no keymap data defined\n"); + return -EINVAL; + } + keymap_data = pdata->keymap_data; + rows = pdata->rows; + cols = pdata->cols; + rep = pdata->rep; + irq_is_gpio = pdata->irq_is_gpio; + } else { + struct device_node *np = client->dev.of_node; + of_property_read_u32(np, "keypad,num-rows", &rows); + of_property_read_u32(np, "keypad,num-columns", &cols); + rep = of_property_read_bool(np, "keypad,autorepeat"); } - if (!pdata->keymap_data) { - dev_err(&client->dev, "no keymap data defined\n"); - return -EINVAL; - } - - if (!pdata->rows || pdata->rows > TCA8418_MAX_ROWS) { + if (!rows || rows > TCA8418_MAX_ROWS) { dev_err(&client->dev, "invalid rows\n"); return -EINVAL; } - if (!pdata->cols || pdata->cols > TCA8418_MAX_COLS) { + if (!cols || cols > TCA8418_MAX_COLS) { dev_err(&client->dev, "invalid columns\n"); return -EINVAL; } @@ -307,8 +324,8 @@ static int tca8418_keypad_probe(struct i2c_client *client, return -ENODEV; } - row_shift = get_count_order(pdata->cols); - max_keys = pdata->rows << row_shift; + row_shift = get_count_order(cols); + max_keys = rows << row_shift; /* Allocate memory for keypad_data, keymap and input device */ keypad_data = kzalloc(sizeof(*keypad_data) + @@ -316,13 +333,11 @@ static int tca8418_keypad_probe(struct i2c_client *client, if (!keypad_data) return -ENOMEM; - keypad_data->rows = pdata->rows; - keypad_data->cols = pdata->cols; keypad_data->client = client; keypad_data->row_shift = row_shift; /* Initialize the chip or fail if chip isn't present */ - error = tca8418_configure(keypad_data); + error = tca8418_configure(keypad_data, rows, cols); if (error < 0) goto fail1; @@ -342,21 +357,20 @@ static int tca8418_keypad_probe(struct i2c_client *client, input->id.product = 0x001; input->id.version = 0x0001; - error = matrix_keypad_build_keymap(pdata->keymap_data, NULL, - pdata->rows, pdata->cols, + error = matrix_keypad_build_keymap(keymap_data, NULL, rows, cols, keypad_data->keymap, input); if (error) { dev_dbg(&client->dev, "Failed to build keymap\n"); goto fail2; } - if (pdata->rep) + if (rep) __set_bit(EV_REP, input->evbit); input_set_capability(input, EV_MSC, MSC_SCAN); input_set_drvdata(input, keypad_data); - if (pdata->irq_is_gpio) + if (irq_is_gpio) client->irq = gpio_to_irq(client->irq); error = request_threaded_irq(client->irq, NULL, tca8418_irq_handler, @@ -401,11 +415,11 @@ static int tca8418_keypad_remove(struct i2c_client *client) return 0; } - static struct i2c_driver tca8418_keypad_driver = { .driver = { .name = TCA8418_NAME, .owner = THIS_MODULE, + .of_match_table = of_match_ptr(tca8418_dt_ids), }, .probe = tca8418_keypad_probe, .remove = tca8418_keypad_remove, -- cgit v1.2.3 From bf7f5316cbacbcb7d3c337eba36322cab255dec0 Mon Sep 17 00:00:00 2001 From: Alban Bedel Date: Thu, 8 Nov 2012 08:57:55 -0800 Subject: Input: tca8418_keypad - add support for shared interrupt Signed-off-by: Alban Bedel Signed-off-by: Dmitry Torokhov --- drivers/input/keyboard/tca8418_keypad.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'drivers/input/keyboard') diff --git a/drivers/input/keyboard/tca8418_keypad.c b/drivers/input/keyboard/tca8418_keypad.c index 1a2894dd03c..ac4ff13f51c 100644 --- a/drivers/input/keyboard/tca8418_keypad.c +++ b/drivers/input/keyboard/tca8418_keypad.c @@ -224,16 +224,18 @@ static irqreturn_t tca8418_irq_handler(int irq, void *dev_id) if (error) { dev_err(&keypad_data->client->dev, "unable to read REG_INT_STAT\n"); - goto exit; + return IRQ_NONE; } + if (!reg) + return IRQ_NONE; + if (reg & INT_STAT_OVR_FLOW_INT) dev_warn(&keypad_data->client->dev, "overflow occurred\n"); if (reg & INT_STAT_K_INT) tca8418_read_keypad(keypad_data); -exit: /* Clear all interrupts, even IRQs we didn't check (GPI, CAD, LCK) */ reg = 0xff; error = tca8418_write_byte(keypad_data, REG_INT_STAT, reg); @@ -374,7 +376,9 @@ static int tca8418_keypad_probe(struct i2c_client *client, client->irq = gpio_to_irq(client->irq); error = request_threaded_irq(client->irq, NULL, tca8418_irq_handler, - IRQF_TRIGGER_FALLING | IRQF_ONESHOT, + IRQF_TRIGGER_FALLING | + IRQF_SHARED | + IRQF_ONESHOT, client->name, keypad_data); if (error) { dev_dbg(&client->dev, -- cgit v1.2.3 From efce8a412161b0555254bd6ac1dcdfb7886bfd8c Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Wed, 14 Nov 2012 08:06:44 -0800 Subject: Input: tca8418_keypad - use a temporary variable for parent device Use a temporary variable for our parent device (coming from I2C client structure); we'll be also using it during conversion to managed resources. Reviewed-by: Alban Bedel Signed-off-by: Dmitry Torokhov --- drivers/input/keyboard/tca8418_keypad.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'drivers/input/keyboard') diff --git a/drivers/input/keyboard/tca8418_keypad.c b/drivers/input/keyboard/tca8418_keypad.c index ac4ff13f51c..3bb981af8ac 100644 --- a/drivers/input/keyboard/tca8418_keypad.c +++ b/drivers/input/keyboard/tca8418_keypad.c @@ -281,6 +281,7 @@ static int tca8418_configure(struct tca8418_keypad *keypad_data, static int tca8418_keypad_probe(struct i2c_client *client, const struct i2c_device_id *id) { + struct device *dev = &client->dev; const struct tca8418_keypad_platform_data *pdata = client->dev.platform_data; struct tca8418_keypad *keypad_data; @@ -294,7 +295,7 @@ static int tca8418_keypad_probe(struct i2c_client *client, /* Copy the platform data */ if (pdata) { if (!pdata->keymap_data) { - dev_err(&client->dev, "no keymap data defined\n"); + dev_err(dev, "no keymap data defined\n"); return -EINVAL; } keymap_data = pdata->keymap_data; @@ -303,25 +304,25 @@ static int tca8418_keypad_probe(struct i2c_client *client, rep = pdata->rep; irq_is_gpio = pdata->irq_is_gpio; } else { - struct device_node *np = client->dev.of_node; + struct device_node *np = dev->of_node; of_property_read_u32(np, "keypad,num-rows", &rows); of_property_read_u32(np, "keypad,num-columns", &cols); rep = of_property_read_bool(np, "keypad,autorepeat"); } if (!rows || rows > TCA8418_MAX_ROWS) { - dev_err(&client->dev, "invalid rows\n"); + dev_err(dev, "invalid rows\n"); return -EINVAL; } if (!cols || cols > TCA8418_MAX_COLS) { - dev_err(&client->dev, "invalid columns\n"); + dev_err(dev, "invalid columns\n"); return -EINVAL; } /* Check i2c driver capabilities */ if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_BYTE)) { - dev_err(&client->dev, "%s adapter not supported\n", + dev_err(dev, "%s adapter not supported\n", dev_driver_string(&client->adapter->dev)); return -ENODEV; } @@ -362,7 +363,7 @@ static int tca8418_keypad_probe(struct i2c_client *client, error = matrix_keypad_build_keymap(keymap_data, NULL, rows, cols, keypad_data->keymap, input); if (error) { - dev_dbg(&client->dev, "Failed to build keymap\n"); + dev_dbg(dev, "Failed to build keymap\n"); goto fail2; } @@ -381,16 +382,15 @@ static int tca8418_keypad_probe(struct i2c_client *client, IRQF_ONESHOT, client->name, keypad_data); if (error) { - dev_dbg(&client->dev, - "Unable to claim irq %d; error %d\n", + dev_dbg(dev, "Unable to claim irq %d; error %d\n", client->irq, error); goto fail2; } error = input_register_device(input); if (error) { - dev_dbg(&client->dev, - "Unable to register input device, error: %d\n", error); + dev_dbg(dev, "Unable to register input device, error: %d\n", + error); goto fail3; } -- cgit v1.2.3 From cdbe8a86379b9002598a4d14791dc8e790b1f5f5 Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Wed, 14 Nov 2012 08:12:05 -0800 Subject: Input: tca8418_keypad - use dev_get_platdata() to retrieve platform data We need to use proper accessor functions instead of directly poking into various structures. Reviewed-by: Alban Bedel Signed-off-by: Dmitry Torokhov --- drivers/input/keyboard/tca8418_keypad.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/input/keyboard') diff --git a/drivers/input/keyboard/tca8418_keypad.c b/drivers/input/keyboard/tca8418_keypad.c index 3bb981af8ac..ab41a2ea305 100644 --- a/drivers/input/keyboard/tca8418_keypad.c +++ b/drivers/input/keyboard/tca8418_keypad.c @@ -283,7 +283,7 @@ static int tca8418_keypad_probe(struct i2c_client *client, { struct device *dev = &client->dev; const struct tca8418_keypad_platform_data *pdata = - client->dev.platform_data; + dev_get_platdata(dev); struct tca8418_keypad *keypad_data; struct input_dev *input; const struct matrix_keymap_data *keymap_data = NULL; -- cgit v1.2.3 From 5cc0dfe043f84a777bf9d66dc48cc2b83709c9ef Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Wed, 14 Nov 2012 08:16:15 -0800 Subject: Input: tca8418_keypad - move device ID tables closer to where they are used This matches structure of most other input drivers. Reviewed-by: Alban Bedel Signed-off-by: Dmitry Torokhov --- drivers/input/keyboard/tca8418_keypad.c | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) (limited to 'drivers/input/keyboard') diff --git a/drivers/input/keyboard/tca8418_keypad.c b/drivers/input/keyboard/tca8418_keypad.c index ab41a2ea305..9084327efb3 100644 --- a/drivers/input/keyboard/tca8418_keypad.c +++ b/drivers/input/keyboard/tca8418_keypad.c @@ -110,21 +110,6 @@ #define KEY_EVENT_CODE 0x7f #define KEY_EVENT_VALUE 0x80 - -static const struct i2c_device_id tca8418_id[] = { - { TCA8418_NAME, 8418, }, - { } -}; -MODULE_DEVICE_TABLE(i2c, tca8418_id); - -#ifdef CONFIG_OF -static const struct of_device_id tca8418_dt_ids[] __devinitconst = { - { .compatible = "ti,tca8418", }, - { } -}; -MODULE_DEVICE_TABLE(of, tca8418_dt_ids); -#endif - struct tca8418_keypad { unsigned int irq; unsigned int row_shift; @@ -419,6 +404,20 @@ static int tca8418_keypad_remove(struct i2c_client *client) return 0; } +static const struct i2c_device_id tca8418_id[] = { + { TCA8418_NAME, 8418, }, + { } +}; +MODULE_DEVICE_TABLE(i2c, tca8418_id); + +#ifdef CONFIG_OF +static const struct of_device_id tca8418_dt_ids[] __devinitconst = { + { .compatible = "ti,tca8418", }, + { } +}; +MODULE_DEVICE_TABLE(of, tca8418_dt_ids); +#endif + static struct i2c_driver tca8418_keypad_driver = { .driver = { .name = TCA8418_NAME, -- cgit v1.2.3 From 91c5d67f17784078169bdcce4c21df82ac6c234c Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Wed, 14 Nov 2012 08:20:21 -0800 Subject: Input: tca8418_keypad - increase severity of failures in probe() Failures to build a keymap, request an IRQ, or register input device are fatal for the driver, therefore the messages should have "error" severity instead of "debug". Reviewed-by: Alban Bedel Signed-off-by: Dmitry Torokhov --- drivers/input/keyboard/tca8418_keypad.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'drivers/input/keyboard') diff --git a/drivers/input/keyboard/tca8418_keypad.c b/drivers/input/keyboard/tca8418_keypad.c index 9084327efb3..8fcce37b089 100644 --- a/drivers/input/keyboard/tca8418_keypad.c +++ b/drivers/input/keyboard/tca8418_keypad.c @@ -348,7 +348,7 @@ static int tca8418_keypad_probe(struct i2c_client *client, error = matrix_keypad_build_keymap(keymap_data, NULL, rows, cols, keypad_data->keymap, input); if (error) { - dev_dbg(dev, "Failed to build keymap\n"); + dev_err(dev, "Failed to build keymap\n"); goto fail2; } @@ -367,14 +367,14 @@ static int tca8418_keypad_probe(struct i2c_client *client, IRQF_ONESHOT, client->name, keypad_data); if (error) { - dev_dbg(dev, "Unable to claim irq %d; error %d\n", + dev_err(dev, "Unable to claim irq %d; error %d\n", client->irq, error); goto fail2; } error = input_register_device(input); if (error) { - dev_dbg(dev, "Unable to register input device, error: %d\n", + dev_err(dev, "Unable to register input device, error: %d\n", error); goto fail3; } -- cgit v1.2.3 From 16ff7cb1848a8898ff19f77b4a9632a73ff98457 Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Mon, 5 Nov 2012 11:13:11 -0800 Subject: Input: tca8418-keypad - switch to using managed resources Let's switch to using devm_*() interfaces to manage our resources, thus will simplify error unwinding a bit. Reviewed-by: Alban Bedel Signed-off-by: Dmitry Torokhov --- drivers/input/keyboard/tca8418_keypad.c | 78 +++++++++++---------------------- 1 file changed, 25 insertions(+), 53 deletions(-) (limited to 'drivers/input/keyboard') diff --git a/drivers/input/keyboard/tca8418_keypad.c b/drivers/input/keyboard/tca8418_keypad.c index 8fcce37b089..50e9c5e195e 100644 --- a/drivers/input/keyboard/tca8418_keypad.c +++ b/drivers/input/keyboard/tca8418_keypad.c @@ -111,14 +111,10 @@ #define KEY_EVENT_VALUE 0x80 struct tca8418_keypad { - unsigned int irq; - unsigned int row_shift; - struct i2c_client *client; struct input_dev *input; - /* Flexible array member, must be at end of struct */ - unsigned short keymap[]; + unsigned int row_shift; }; /* @@ -163,6 +159,8 @@ static int tca8418_read_byte(struct tca8418_keypad *keypad_data, static void tca8418_read_keypad(struct tca8418_keypad *keypad_data) { + struct input_dev *input = keypad_data->input; + unsigned short *keymap = input->keycode; int error, col, row; u8 reg, state, code; @@ -181,9 +179,8 @@ static void tca8418_read_keypad(struct tca8418_keypad *keypad_data) col = (col) ? col - 1 : TCA8418_MAX_COLS - 1; code = MATRIX_SCAN_CODE(row, col, keypad_data->row_shift); - input_event(keypad_data->input, EV_MSC, MSC_SCAN, code); - input_report_key(keypad_data->input, - keypad_data->keymap[code], state); + input_event(input, EV_MSC, MSC_SCAN, code); + input_report_key(input, keymap[code], state); /* Read for next loop */ error = tca8418_read_byte(keypad_data, REG_KEY_EVENT_A, ®); @@ -193,7 +190,7 @@ static void tca8418_read_keypad(struct tca8418_keypad *keypad_data) dev_err(&keypad_data->client->dev, "unable to read REG_KEY_EVENT_A\n"); - input_sync(keypad_data->input); + input_sync(input); } /* @@ -275,6 +272,7 @@ static int tca8418_keypad_probe(struct i2c_client *client, u32 rows = 0, cols = 0; bool rep = false; bool irq_is_gpio = false; + int irq; int error, row_shift, max_keys; /* Copy the platform data */ @@ -315,9 +313,8 @@ static int tca8418_keypad_probe(struct i2c_client *client, row_shift = get_count_order(cols); max_keys = rows << row_shift; - /* Allocate memory for keypad_data, keymap and input device */ - keypad_data = kzalloc(sizeof(*keypad_data) + - max_keys * sizeof(keypad_data->keymap[0]), GFP_KERNEL); + /* Allocate memory for keypad_data and input device */ + keypad_data = devm_kzalloc(dev, sizeof(*keypad_data), GFP_KERNEL); if (!keypad_data) return -ENOMEM; @@ -327,29 +324,26 @@ static int tca8418_keypad_probe(struct i2c_client *client, /* Initialize the chip or fail if chip isn't present */ error = tca8418_configure(keypad_data, rows, cols); if (error < 0) - goto fail1; + return error; /* Configure input device */ - input = input_allocate_device(); - if (!input) { - error = -ENOMEM; - goto fail1; - } + input = devm_input_allocate_device(dev); + if (!input) + return -ENOMEM; + keypad_data->input = input; input->name = client->name; - input->dev.parent = &client->dev; - input->id.bustype = BUS_I2C; input->id.vendor = 0x0001; input->id.product = 0x001; input->id.version = 0x0001; error = matrix_keypad_build_keymap(keymap_data, NULL, rows, cols, - keypad_data->keymap, input); + NULL, input); if (error) { dev_err(dev, "Failed to build keymap\n"); - goto fail2; + return error; } if (rep) @@ -358,49 +352,28 @@ static int tca8418_keypad_probe(struct i2c_client *client, input_set_drvdata(input, keypad_data); + irq = client->irq; if (irq_is_gpio) - client->irq = gpio_to_irq(client->irq); + irq = gpio_to_irq(irq); - error = request_threaded_irq(client->irq, NULL, tca8418_irq_handler, - IRQF_TRIGGER_FALLING | - IRQF_SHARED | - IRQF_ONESHOT, - client->name, keypad_data); + error = devm_request_threaded_irq(dev, irq, NULL, tca8418_irq_handler, + IRQF_TRIGGER_FALLING | + IRQF_SHARED | + IRQF_ONESHOT, + client->name, keypad_data); if (error) { dev_err(dev, "Unable to claim irq %d; error %d\n", client->irq, error); - goto fail2; + return error; } error = input_register_device(input); if (error) { dev_err(dev, "Unable to register input device, error: %d\n", error); - goto fail3; + return error; } - i2c_set_clientdata(client, keypad_data); - return 0; - -fail3: - free_irq(client->irq, keypad_data); -fail2: - input_free_device(input); -fail1: - kfree(keypad_data); - return error; -} - -static int tca8418_keypad_remove(struct i2c_client *client) -{ - struct tca8418_keypad *keypad_data = i2c_get_clientdata(client); - - free_irq(keypad_data->client->irq, keypad_data); - - input_unregister_device(keypad_data->input); - - kfree(keypad_data); - return 0; } @@ -425,7 +398,6 @@ static struct i2c_driver tca8418_keypad_driver = { .of_match_table = of_match_ptr(tca8418_dt_ids), }, .probe = tca8418_keypad_probe, - .remove = tca8418_keypad_remove, .id_table = tca8418_id, }; -- cgit v1.2.3 From 1a22e16fc3d6abc8d6323cc0973435439932fe5f Mon Sep 17 00:00:00 2001 From: Alexander Shiyan Date: Thu, 29 Nov 2012 08:57:17 -0800 Subject: Input: gpio-keys-polled - honor 'autorepeat' setting in platform data Signed-off-by: Alexander Shiyan Signed-off-by: Dmitry Torokhov --- drivers/input/keyboard/gpio_keys_polled.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'drivers/input/keyboard') diff --git a/drivers/input/keyboard/gpio_keys_polled.c b/drivers/input/keyboard/gpio_keys_polled.c index 32e508781dd..d72d0e5ebb8 100644 --- a/drivers/input/keyboard/gpio_keys_polled.c +++ b/drivers/input/keyboard/gpio_keys_polled.c @@ -245,7 +245,6 @@ static int gpio_keys_polled_probe(struct platform_device *pdev) input = poll_dev->input; - input->evbit[0] = BIT(EV_KEY); input->name = pdev->name; input->phys = DRV_NAME"/input0"; input->dev.parent = &pdev->dev; @@ -255,6 +254,10 @@ static int gpio_keys_polled_probe(struct platform_device *pdev) input->id.product = 0x0001; input->id.version = 0x0100; + __set_bit(EV_KEY, input->evbit); + if (pdata->rep) + __set_bit(EV_REP, input->evbit); + for (i = 0; i < pdata->nbuttons; i++) { struct gpio_keys_button *button = &pdata->buttons[i]; struct gpio_keys_button_data *bdata = &bdev->data[i]; -- cgit v1.2.3 From 333e34bfe2149e634fb0613b4936fd838c36fafb Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Thu, 29 Nov 2012 09:00:19 -0800 Subject: Input: gpio_keys - switch to using gpio_request_one() This saves us a few lines of code. Signed-off-by: Dmitry Torokhov --- drivers/input/keyboard/gpio_keys.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'drivers/input/keyboard') diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gpio_keys.c index 79435de0caa..d327f5a2bb0 100644 --- a/drivers/input/keyboard/gpio_keys.c +++ b/drivers/input/keyboard/gpio_keys.c @@ -440,21 +440,13 @@ static int gpio_keys_setup_key(struct platform_device *pdev, if (gpio_is_valid(button->gpio)) { - error = gpio_request(button->gpio, desc); + error = gpio_request_one(button->gpio, GPIOF_IN, desc); if (error < 0) { dev_err(dev, "Failed to request GPIO %d, error %d\n", button->gpio, error); return error; } - error = gpio_direction_input(button->gpio); - if (error < 0) { - dev_err(dev, - "Failed to configure direction for GPIO %d, error %d\n", - button->gpio, error); - goto fail; - } - if (button->debounce_interval) { error = gpio_set_debounce(button->gpio, button->debounce_interval * 1000); -- cgit v1.2.3 From da5ee074ce8e07b9a91596de3576b59990c0c8c6 Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Thu, 29 Nov 2012 09:24:08 -0800 Subject: Input: gpio_keys_polled - switch to using gpio_request_one() This saves us a few lines of code. Signed-off-by: Dmitry Torokhov --- drivers/input/keyboard/gpio_keys_polled.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'drivers/input/keyboard') diff --git a/drivers/input/keyboard/gpio_keys_polled.c b/drivers/input/keyboard/gpio_keys_polled.c index d72d0e5ebb8..f686fd97055 100644 --- a/drivers/input/keyboard/gpio_keys_polled.c +++ b/drivers/input/keyboard/gpio_keys_polled.c @@ -270,22 +270,14 @@ static int gpio_keys_polled_probe(struct platform_device *pdev) goto err_free_gpio; } - error = gpio_request(gpio, - button->desc ? button->desc : DRV_NAME); + error = gpio_request_one(gpio, GPIOF_IN, + button->desc ?: DRV_NAME); if (error) { dev_err(dev, "unable to claim gpio %u, err=%d\n", gpio, error); goto err_free_gpio; } - error = gpio_direction_input(gpio); - if (error) { - dev_err(dev, - "unable to set direction on gpio %u, err=%d\n", - gpio, error); - goto err_free_gpio; - } - bdata->can_sleep = gpio_cansleep(gpio); bdata->last_state = -1; bdata->threshold = DIV_ROUND_UP(button->debounce_interval, -- cgit v1.2.3