projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
952e1c6
)
gpio: fix spurious printk when freeing a gpio
author
Jon Povey
<
[email protected]
>
Tue, 27 Jul 2010 20:18:06 +0000
(13:18 -0700)
committer
Linus Torvalds
<
[email protected]
>
Tue, 27 Jul 2010 21:32:07 +0000
(14:32 -0700)
When freeing a gpio that has not been exported, gpio_unexport() prints a
debug message when it should just fall through silently.
Example spurious message:
gpio_unexport: gpio0 status -22
Signed-off-by: Jon Povey <
[email protected]
>
Cc: David Brownell <
[email protected]
>
Acked-by: Uwe Kleine-K?nig <
[email protected]
>
Cc: Gregory Bean <
[email protected]
>
Signed-off-by: Andrew Morton <
[email protected]
>
Signed-off-by: Linus Torvalds <
[email protected]
>
drivers/gpio/gpiolib.c
patch
|
blob
|
history
diff --git
a/drivers/gpio/gpiolib.c
b/drivers/gpio/gpiolib.c
index 3ca36542e3385b0c62a33b703e637fac31884c93..4e51fe3c1fc4f97594d96fcb9a4e719fa40b8edc 100644
(file)
--- a/
drivers/gpio/gpiolib.c
+++ b/
drivers/gpio/gpiolib.c
@@
-893,10
+893,12
@@
EXPORT_SYMBOL_GPL(gpio_sysfs_set_active_low);
void gpio_unexport(unsigned gpio)
{
struct gpio_desc *desc;
- int status =
-EINVAL
;
+ int status =
0
;
- if (!gpio_is_valid(gpio))
+ if (!gpio_is_valid(gpio)) {
+ status = -EINVAL;
goto done;
+ }
mutex_lock(&sysfs_lock);
@@
-911,7
+913,6
@@
void gpio_unexport(unsigned gpio)
clear_bit(FLAG_EXPORT, &desc->flags);
put_device(dev);
device_unregister(dev);
- status = 0;
} else
status = -ENODEV;
}