Input: use input_device_enabled()
Use the newly added helper in relevant input drivers. Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@collabora.com> Link: https://lore.kernel.org/r/20200608112211.12125-3-andrzej.p@collabora.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
This commit is contained in:
committed by
Dmitry Torokhov
parent
39be39ceff
commit
d69f0a43c6
@@ -318,7 +318,7 @@ static int __maybe_unused spear_kbd_suspend(struct device *dev)
|
||||
writel_relaxed(val, kbd->io_base + MODE_CTL_REG);
|
||||
|
||||
} else {
|
||||
if (input_dev->users) {
|
||||
if (input_device_enabled(input_dev)) {
|
||||
writel_relaxed(mode_ctl_reg & ~MODE_CTL_START_SCAN,
|
||||
kbd->io_base + MODE_CTL_REG);
|
||||
clk_disable(kbd->clk);
|
||||
@@ -326,7 +326,7 @@ static int __maybe_unused spear_kbd_suspend(struct device *dev)
|
||||
}
|
||||
|
||||
/* store current configuration */
|
||||
if (input_dev->users)
|
||||
if (input_device_enabled(input_dev))
|
||||
kbd->mode_ctl_reg = mode_ctl_reg;
|
||||
|
||||
/* restore previous clk state */
|
||||
@@ -351,12 +351,12 @@ static int __maybe_unused spear_kbd_resume(struct device *dev)
|
||||
disable_irq_wake(kbd->irq);
|
||||
}
|
||||
} else {
|
||||
if (input_dev->users)
|
||||
if (input_device_enabled(input_dev))
|
||||
clk_enable(kbd->clk);
|
||||
}
|
||||
|
||||
/* restore current configuration */
|
||||
if (input_dev->users)
|
||||
if (input_device_enabled(input_dev))
|
||||
writel_relaxed(kbd->mode_ctl_reg, kbd->io_base + MODE_CTL_REG);
|
||||
|
||||
mutex_unlock(&input_dev->mutex);
|
||||
|
||||
Reference in New Issue
Block a user