diff options
author | Tejun Heo <tj@kernel.org> | 2013-12-10 08:40:48 -0500 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2013-12-10 08:44:37 -0500 |
commit | 13ccb93f4127baf53961a9497780a0f52e3c24e7 (patch) | |
tree | fcfcca99d9d9c49a03d825ddaecabe0163c924eb /drivers/gpio/gpiolib.c | |
parent | bbc780f8bab52fef1784151d3c4982cb1143edd2 (diff) | |
parent | a8b14744429f90763f258ad0f69601cdcad610aa (diff) |
Merge branch 'driver-core-linus' into driver-core-next
a8b14744429f ("sysfs: give different locking key to regular and bin
files") in driver-core-linus modifies sysfs_open_file() so that it
gives out different locking classes to sysfs_open_files depending on
whether the file is bin or not. Due to the massive kernfs
reorganization in driver-core-next, this naturally causes merge
conflict in fs/sysfs/file.c.
Due to the way things are split between kernfs and sysfs in
driver-core-next, the same fix can't easily be applied to
driver-core-next. This merge simply ignores the offending commit. A
following patch will implement a separate fix for the issue.
Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'drivers/gpio/gpiolib.c')
-rw-r--r-- | drivers/gpio/gpiolib.c | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c index ac53a9593662..85f772c0b26a 100644 --- a/drivers/gpio/gpiolib.c +++ b/drivers/gpio/gpiolib.c | |||
@@ -2368,7 +2368,7 @@ static struct gpio_desc *gpiod_find(struct device *dev, const char *con_id, | |||
2368 | continue; | 2368 | continue; |
2369 | } | 2369 | } |
2370 | 2370 | ||
2371 | if (chip->ngpio >= p->chip_hwnum) { | 2371 | if (chip->ngpio <= p->chip_hwnum) { |
2372 | dev_warn(dev, "GPIO chip %s has %d GPIOs\n", | 2372 | dev_warn(dev, "GPIO chip %s has %d GPIOs\n", |
2373 | chip->label, chip->ngpio); | 2373 | chip->label, chip->ngpio); |
2374 | continue; | 2374 | continue; |
@@ -2418,7 +2418,7 @@ struct gpio_desc *__must_check gpiod_get_index(struct device *dev, | |||
2418 | const char *con_id, | 2418 | const char *con_id, |
2419 | unsigned int idx) | 2419 | unsigned int idx) |
2420 | { | 2420 | { |
2421 | struct gpio_desc *desc; | 2421 | struct gpio_desc *desc = NULL; |
2422 | int status; | 2422 | int status; |
2423 | enum gpio_lookup_flags flags = 0; | 2423 | enum gpio_lookup_flags flags = 0; |
2424 | 2424 | ||
@@ -2431,13 +2431,23 @@ struct gpio_desc *__must_check gpiod_get_index(struct device *dev, | |||
2431 | } else if (IS_ENABLED(CONFIG_ACPI) && dev && ACPI_HANDLE(dev)) { | 2431 | } else if (IS_ENABLED(CONFIG_ACPI) && dev && ACPI_HANDLE(dev)) { |
2432 | dev_dbg(dev, "using ACPI for GPIO lookup\n"); | 2432 | dev_dbg(dev, "using ACPI for GPIO lookup\n"); |
2433 | desc = acpi_find_gpio(dev, con_id, idx, &flags); | 2433 | desc = acpi_find_gpio(dev, con_id, idx, &flags); |
2434 | } else { | 2434 | } |
2435 | |||
2436 | /* | ||
2437 | * Either we are not using DT or ACPI, or their lookup did not return | ||
2438 | * a result. In that case, use platform lookup as a fallback. | ||
2439 | */ | ||
2440 | if (!desc || IS_ERR(desc)) { | ||
2441 | struct gpio_desc *pdesc; | ||
2435 | dev_dbg(dev, "using lookup tables for GPIO lookup"); | 2442 | dev_dbg(dev, "using lookup tables for GPIO lookup"); |
2436 | desc = gpiod_find(dev, con_id, idx, &flags); | 2443 | pdesc = gpiod_find(dev, con_id, idx, &flags); |
2444 | /* If used as fallback, do not replace the previous error */ | ||
2445 | if (!IS_ERR(pdesc) || !desc) | ||
2446 | desc = pdesc; | ||
2437 | } | 2447 | } |
2438 | 2448 | ||
2439 | if (IS_ERR(desc)) { | 2449 | if (IS_ERR(desc)) { |
2440 | dev_warn(dev, "lookup for GPIO %s failed\n", con_id); | 2450 | dev_dbg(dev, "lookup for GPIO %s failed\n", con_id); |
2441 | return desc; | 2451 | return desc; |
2442 | } | 2452 | } |
2443 | 2453 | ||