Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: 5ae4cb94b3133 (gpio: aspeed: Add debounce support)
Signed-off-by: Joel Stanley <joel@jms.id.au>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>

authored by

Joel Stanley and committed by
Linus Walleij
df563c85 08332893

+3
+3
drivers/gpio/gpio-aspeed.c
··· 646 646 int rc; 647 647 int i; 648 648 649 + if (!gpio->clk) 650 + return -EINVAL; 651 + 649 652 rc = usecs_to_cycles(gpio, usecs, &requested_cycles); 650 653 if (rc < 0) { 651 654 dev_warn(chip->parent, "Failed to convert %luus to cycles at %luHz: %d\n",