Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 296905
b: refs/heads/master
c: 864533c
h: refs/heads/master
i:
  296903: 9caf460
v: v3
  • Loading branch information
Ming Lei authored and Grant Likely committed Feb 15, 2012
1 parent 7434515 commit e8fc467
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ff64abefb6680dfc2aca7ecaa5e695949e7335c9
refs/heads/master: 864533ceb6db336dead389577c102a8b792a121a
8 changes: 5 additions & 3 deletions trunk/drivers/gpio/gpiolib.c
Original file line number Diff line number Diff line change
Expand Up @@ -873,6 +873,7 @@ void gpio_unexport(unsigned gpio)
{
struct gpio_desc *desc;
int status = 0;
struct device *dev = NULL;

if (!gpio_is_valid(gpio)) {
status = -EINVAL;
Expand All @@ -884,19 +885,20 @@ void gpio_unexport(unsigned gpio)
desc = &gpio_desc[gpio];

if (test_bit(FLAG_EXPORT, &desc->flags)) {
struct device *dev = NULL;

dev = class_find_device(&gpio_class, NULL, desc, match_export);
if (dev) {
gpio_setup_irq(desc, dev, 0);
clear_bit(FLAG_EXPORT, &desc->flags);
put_device(dev);
device_unregister(dev);
} else
status = -ENODEV;
}

mutex_unlock(&sysfs_lock);
if (dev) {
device_unregister(dev);
put_device(dev);
}
done:
if (status)
pr_debug("%s: gpio%d status %d\n", __func__, gpio, status);
Expand Down

0 comments on commit e8fc467

Please sign in to comment.