mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-01 22:54:01 +00:00
gpio: aspeed: Don't attempt to debounce if disabled
We warn the user at driver probe time that debouncing is disabled.
However, if they request debouncing later on we print a confusing error
message:
gpio_aspeed 1e780000.gpio: Failed to convert 5000us to cycles at 0Hz: -524
Instead bail out when the clock is not present.
Fixes: 5ae4cb94b3
(gpio: aspeed: Add debounce support)
Signed-off-by: Joel Stanley <joel@jms.id.au>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
This commit is contained in:
parent
08332893e3
commit
df563c85de
1 changed files with 3 additions and 0 deletions
|
@ -646,6 +646,9 @@ static int enable_debounce(struct gpio_chip *chip, unsigned int offset,
|
|||
int rc;
|
||||
int i;
|
||||
|
||||
if (!gpio->clk)
|
||||
return -EINVAL;
|
||||
|
||||
rc = usecs_to_cycles(gpio, usecs, &requested_cycles);
|
||||
if (rc < 0) {
|
||||
dev_warn(chip->parent, "Failed to convert %luus to cycles at %luHz: %d\n",
|
||||
|
|
Loading…
Reference in a new issue