mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-04 09:34:12 +08:00
Input: imx_keypad - check error returned by clk_prepare_enable()
Check error returned by clk_prepare_enable(). Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
This commit is contained in:
parent
a40ec72d54
commit
333fbe8409
@ -384,14 +384,18 @@ static void imx_keypad_close(struct input_dev *dev)
|
|||||||
static int imx_keypad_open(struct input_dev *dev)
|
static int imx_keypad_open(struct input_dev *dev)
|
||||||
{
|
{
|
||||||
struct imx_keypad *keypad = input_get_drvdata(dev);
|
struct imx_keypad *keypad = input_get_drvdata(dev);
|
||||||
|
int error;
|
||||||
|
|
||||||
dev_dbg(&dev->dev, ">%s\n", __func__);
|
dev_dbg(&dev->dev, ">%s\n", __func__);
|
||||||
|
|
||||||
|
/* Enable the kpp clock */
|
||||||
|
error = clk_prepare_enable(keypad->clk);
|
||||||
|
if (error)
|
||||||
|
return error;
|
||||||
|
|
||||||
/* We became active from now */
|
/* We became active from now */
|
||||||
keypad->enabled = true;
|
keypad->enabled = true;
|
||||||
|
|
||||||
/* Enable the kpp clock */
|
|
||||||
clk_prepare_enable(keypad->clk);
|
|
||||||
imx_keypad_config(keypad);
|
imx_keypad_config(keypad);
|
||||||
|
|
||||||
/* Sanity control, not all the rows must be actived now. */
|
/* Sanity control, not all the rows must be actived now. */
|
||||||
@ -596,18 +600,23 @@ static int imx_kbd_resume(struct device *dev)
|
|||||||
struct platform_device *pdev = to_platform_device(dev);
|
struct platform_device *pdev = to_platform_device(dev);
|
||||||
struct imx_keypad *kbd = platform_get_drvdata(pdev);
|
struct imx_keypad *kbd = platform_get_drvdata(pdev);
|
||||||
struct input_dev *input_dev = kbd->input_dev;
|
struct input_dev *input_dev = kbd->input_dev;
|
||||||
|
int ret = 0;
|
||||||
|
|
||||||
if (device_may_wakeup(&pdev->dev))
|
if (device_may_wakeup(&pdev->dev))
|
||||||
disable_irq_wake(kbd->irq);
|
disable_irq_wake(kbd->irq);
|
||||||
|
|
||||||
mutex_lock(&input_dev->mutex);
|
mutex_lock(&input_dev->mutex);
|
||||||
|
|
||||||
if (input_dev->users)
|
if (input_dev->users) {
|
||||||
clk_prepare_enable(kbd->clk);
|
ret = clk_prepare_enable(kbd->clk);
|
||||||
|
if (ret)
|
||||||
|
goto err_clk;
|
||||||
|
}
|
||||||
|
|
||||||
|
err_clk:
|
||||||
mutex_unlock(&input_dev->mutex);
|
mutex_unlock(&input_dev->mutex);
|
||||||
|
|
||||||
return 0;
|
return ret;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user