aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input
diff options
context:
space:
mode:
authorUlf Hansson <ulf.hansson@linaro.org>2012-11-03 15:16:51 -0400
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2012-11-08 12:13:06 -0500
commit4e99aab78ab2adf7645b7f58b2b549e6ea205dd7 (patch)
treee8af020f731ad00b8cdc530414ca18625b79b423 /drivers/input
parent6afdc289c984451a6202a687fe6af727e051a784 (diff)
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 <ulf.hansson@linaro.org> Acked-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers/input')
-rw-r--r--drivers/input/keyboard/nomadik-ske-keypad.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/drivers/input/keyboard/nomadik-ske-keypad.c b/drivers/input/keyboard/nomadik-ske-keypad.c
index 49f5fa64e0b1..95dcc9bdeec3 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)
287 keypad->keymap, input); 287 keypad->keymap, input);
288 if (error) { 288 if (error) {
289 dev_err(&pdev->dev, "Failed to build keymap\n"); 289 dev_err(&pdev->dev, "Failed to build keymap\n");
290 goto err_iounmap; 290 goto err_clk;
291 } 291 }
292 292
293 input_set_capability(input, EV_MSC, MSC_SCAN); 293 input_set_capability(input, EV_MSC, MSC_SCAN);
294 if (!plat->no_autorepeat) 294 if (!plat->no_autorepeat)
295 __set_bit(EV_REP, input->evbit); 295 __set_bit(EV_REP, input->evbit);
296 296
297 clk_enable(keypad->clk); 297 error = clk_prepare_enable(keypad->clk);
298 if (error) {
299 dev_err(&pdev->dev, "Failed to prepare/enable clk\n");
300 goto err_clk;
301 }
302
298 303
299 /* go through board initialization helpers */ 304 /* go through board initialization helpers */
300 if (keypad->board->init) 305 if (keypad->board->init)
@@ -330,7 +335,8 @@ static int __init ske_keypad_probe(struct platform_device *pdev)
330err_free_irq: 335err_free_irq:
331 free_irq(keypad->irq, keypad); 336 free_irq(keypad->irq, keypad);
332err_clk_disable: 337err_clk_disable:
333 clk_disable(keypad->clk); 338 clk_disable_unprepare(keypad->clk);
339err_clk:
334 clk_put(keypad->clk); 340 clk_put(keypad->clk);
335err_iounmap: 341err_iounmap:
336 iounmap(keypad->reg_base); 342 iounmap(keypad->reg_base);
@@ -351,7 +357,7 @@ static int __devexit ske_keypad_remove(struct platform_device *pdev)
351 357
352 input_unregister_device(keypad->input); 358 input_unregister_device(keypad->input);
353 359
354 clk_disable(keypad->clk); 360 clk_disable_unprepare(keypad->clk);
355 clk_put(keypad->clk); 361 clk_put(keypad->clk);
356 362
357 if (keypad->board->exit) 363 if (keypad->board->exit)