Commit 4e99aab7 authored by Ulf Hansson's avatar Ulf Hansson Committed by Dmitry Torokhov

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: default avatarUlf Hansson <ulf.hansson@linaro.org>
Acked-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
parent 6afdc289
...@@ -287,14 +287,19 @@ static int __init ske_keypad_probe(struct platform_device *pdev) ...@@ -287,14 +287,19 @@ static int __init ske_keypad_probe(struct platform_device *pdev)
keypad->keymap, input); keypad->keymap, input);
if (error) { if (error) {
dev_err(&pdev->dev, "Failed to build keymap\n"); dev_err(&pdev->dev, "Failed to build keymap\n");
goto err_iounmap; goto err_clk;
} }
input_set_capability(input, EV_MSC, MSC_SCAN); input_set_capability(input, EV_MSC, MSC_SCAN);
if (!plat->no_autorepeat) if (!plat->no_autorepeat)
__set_bit(EV_REP, input->evbit); __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 */ /* go through board initialization helpers */
if (keypad->board->init) if (keypad->board->init)
...@@ -330,7 +335,8 @@ static int __init ske_keypad_probe(struct platform_device *pdev) ...@@ -330,7 +335,8 @@ static int __init ske_keypad_probe(struct platform_device *pdev)
err_free_irq: err_free_irq:
free_irq(keypad->irq, keypad); free_irq(keypad->irq, keypad);
err_clk_disable: err_clk_disable:
clk_disable(keypad->clk); clk_disable_unprepare(keypad->clk);
err_clk:
clk_put(keypad->clk); clk_put(keypad->clk);
err_iounmap: err_iounmap:
iounmap(keypad->reg_base); iounmap(keypad->reg_base);
...@@ -351,7 +357,7 @@ static int __devexit ske_keypad_remove(struct platform_device *pdev) ...@@ -351,7 +357,7 @@ static int __devexit ske_keypad_remove(struct platform_device *pdev)
input_unregister_device(keypad->input); input_unregister_device(keypad->input);
clk_disable(keypad->clk); clk_disable_unprepare(keypad->clk);
clk_put(keypad->clk); clk_put(keypad->clk);
if (keypad->board->exit) if (keypad->board->exit)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment