diff --git a/drivers/input/keyboard/imx_keypad.c b/drivers/input/keyboard/imx_keypad.c
index 6ee7421..87540a4 100644
--- a/drivers/input/keyboard/imx_keypad.c
+++ b/drivers/input/keyboard/imx_keypad.c
@@ -378,7 +378,7 @@ static void imx_keypad_close(struct input_dev *dev)
imx_keypad_inhibit(keypad);
/* Disable clock unit */
- clk_disable(keypad->clk);
+ clk_disable_unprepare(keypad->clk);
}
static int imx_keypad_open(struct input_dev *dev)
@@ -391,7 +391,7 @@ static int imx_keypad_open(struct input_dev *dev)
keypad->enabled = true;
/* Enable the kpp clock */
- clk_enable(keypad->clk);
+ clk_prepare_enable(keypad->clk);
imx_keypad_config(keypad);
/* Sanity control, not all the rows must be actived now. */
@@ -467,7 +467,7 @@ static int __devinit imx_keypad_probe(struct platform_device *pdev)
goto failed_free_priv;
}
- keypad->clk = clk_get(&pdev->dev, "kpp");
+ keypad->clk = devm_clk_get(&pdev->dev, NULL);
if (IS_ERR(keypad->clk)) {
dev_err(&pdev->dev, "failed to get keypad clock\n");
error = PTR_ERR(keypad->clk);@@ -485,7 +485,7 @@ static int __devinit imx_keypad_probe(struct platform_device *pdev)
dev_err(&pdev->dev,
"invalid key data (too many rows or colums)\n");
error = -EINVAL;
- goto failed_clock_put;
+ goto failed_unmap;
}
dev_dbg(&pdev->dev, "enabled rows mask: %x\n", keypad->rows_en_mask);
dev_dbg(&pdev->dev, "enabled cols mask: %x\n", keypad->cols_en_mask);
@@ -503,7 +503,7 @@ static int __devinit imx_keypad_probe(struct platform_device *pdev)
keypad->keycodes, input_dev);
if (error) {
dev_err(&pdev->dev, "failed to build keymap\n");
- goto failed_clock_put;
+ goto failed_unmap;
}
__set_bit(EV_REP, input_dev->evbit);@@ -517,7 +517,7 @@ static int __devinit imx_keypad_probe(struct platform_device *pdev)
pdev->name, keypad);
if (error) {
dev_err(&pdev->dev, "failed to request IRQ\n");
- goto failed_clock_put;
+ goto failed_unmap;
}
/* Register the input device */@@ -534,8 +534,6 @@ static int __devinit imx_keypad_probe(struct platform_device *pdev)
failed_free_irq:
free_irq(irq, pdev);
-failed_clock_put:
- clk_put(keypad->clk);
failed_unmap:
iounmap(keypad->mmio_base);
failed_free_priv:
@@ -581,7 +579,7 @@ static int imx_kbd_suspend(struct device *dev)
mutex_lock(&input_dev->mutex);
if (input_dev->users)
- clk_disable(kbd->clk);
+ clk_disable_unprepare(kbd->clk);
mutex_unlock(&input_dev->mutex);
@@ -603,7 +601,7 @@ static int imx_kbd_resume(struct device *dev)
mutex_lock(&input_dev->mutex);
if (input_dev->users)
- clk_enable(kbd->clk);
+ clk_prepare_enable(kbd->clk);
mutex_unlock(&input_dev->mutex);
--
1.7.1