diff options
author | Linus Walleij <linus.walleij@linaro.org> | 2013-10-19 17:24:03 -0400 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2013-10-19 17:24:03 -0400 |
commit | b41fb43911b4cb864812adec88d028cc6219f23e (patch) | |
tree | f383de554dc3640ec3081ad41fa34f7cab68de82 /drivers/gpio/gpiolib.c | |
parent | 0963d59bc0bbed48b06733950f5eb167e9b9a8fa (diff) | |
parent | 31d141e3a666269a3b6fcccddb0351caf7454240 (diff) |
Merge tag 'v3.12-rc6' into devel
Linux 3.12-rc6
Conflicts:
drivers/gpio/gpio-lynxpoint.c
Diffstat (limited to 'drivers/gpio/gpiolib.c')
-rw-r--r-- | drivers/gpio/gpiolib.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c index 1014cb5e10b0..d66139dc410d 100644 --- a/drivers/gpio/gpiolib.c +++ b/drivers/gpio/gpiolib.c | |||
@@ -183,7 +183,7 @@ static struct gpio_desc *gpiochip_offset_to_desc(struct gpio_chip *chip, | |||
183 | */ | 183 | */ |
184 | static int desc_to_gpio(const struct gpio_desc *desc) | 184 | static int desc_to_gpio(const struct gpio_desc *desc) |
185 | { | 185 | { |
186 | return desc->chip->base + gpio_chip_hwgpio(desc); | 186 | return desc - &gpio_desc[0]; |
187 | } | 187 | } |
188 | 188 | ||
189 | 189 | ||
@@ -1452,7 +1452,7 @@ static int gpiod_request(struct gpio_desc *desc, const char *label) | |||
1452 | int status = -EPROBE_DEFER; | 1452 | int status = -EPROBE_DEFER; |
1453 | unsigned long flags; | 1453 | unsigned long flags; |
1454 | 1454 | ||
1455 | if (!desc || !desc->chip) { | 1455 | if (!desc) { |
1456 | pr_warn("%s: invalid GPIO\n", __func__); | 1456 | pr_warn("%s: invalid GPIO\n", __func__); |
1457 | return -EINVAL; | 1457 | return -EINVAL; |
1458 | } | 1458 | } |
@@ -1460,6 +1460,8 @@ static int gpiod_request(struct gpio_desc *desc, const char *label) | |||
1460 | spin_lock_irqsave(&gpio_lock, flags); | 1460 | spin_lock_irqsave(&gpio_lock, flags); |
1461 | 1461 | ||
1462 | chip = desc->chip; | 1462 | chip = desc->chip; |
1463 | if (chip == NULL) | ||
1464 | goto done; | ||
1463 | 1465 | ||
1464 | if (!try_module_get(chip->owner)) | 1466 | if (!try_module_get(chip->owner)) |
1465 | goto done; | 1467 | goto done; |