summaryrefslogtreecommitdiffstats
path: root/drivers/gpio/gpio-aspeed.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2017-06-11 11:34:27 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2017-06-11 11:34:27 -0700
commitf986e31bb4d0dba0a10adc51308bf9de2d0e7e4a (patch)
tree30afcec573b5e0145136bb126834c08096ed8cd2 /drivers/gpio/gpio-aspeed.c
parent9cd9cb0ba3e9e55120d25be3a45ffafd299b1b14 (diff)
parentfc7a90686777e7d2da7a08cf0202c21f3b96febb (diff)
downloadop-kernel-dev-f986e31bb4d0dba0a10adc51308bf9de2d0e7e4a.zip
op-kernel-dev-f986e31bb4d0dba0a10adc51308bf9de2d0e7e4a.tar.gz
Merge tag 'gpio-v4.12-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio
Pull GPIO fixes from Linus Walleij: "A few overdue GPIO patches for the v4.12 kernel. - Fix debounce logic on the Aspeed platform. - Fix the "virtual gpio" things on the Intel Crystal Cove. - Fix the blink counter selection on the MVEBU platform" * tag 'gpio-v4.12-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio: gpio: mvebu: fix gpio bank registration when pwm is used gpio: mvebu: fix blink counter register selection MAINTAINERS: remove self from GPIO maintainers gpio: crystalcove: Do not write regular gpio registers for virtual GPIOs gpio: aspeed: Don't attempt to debounce if disabled
Diffstat (limited to 'drivers/gpio/gpio-aspeed.c')
-rw-r--r--drivers/gpio/gpio-aspeed.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/gpio/gpio-aspeed.c b/drivers/gpio/gpio-aspeed.c
index ccea609..4ca436e 100644
--- a/drivers/gpio/gpio-aspeed.c
+++ b/drivers/gpio/gpio-aspeed.c
@@ -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",
OpenPOWER on IntegriCloud