Commit 6a99ad4a authored by Jon Povey's avatar Jon Povey Committed by Linus Torvalds
Browse files

gpio: fix spurious printk when freeing a gpio

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: default avatarJon Povey <>
Cc: David Brownell <>
Acked-by: default avatarUwe Kleine-K?nig <>
Cc: Gregory Bean <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent 952e1c66
......@@ -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;
......@@ -911,7 +913,6 @@ void gpio_unexport(unsigned gpio)
clear_bit(FLAG_EXPORT, &desc->flags);
status = 0;
} else
status = -ENODEV;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment