Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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: Jon Povey <jon.povey@racelogic.co.uk>
Cc: David Brownell <david-b@pacbell.net>
Acked-by: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>
Cc: Gregory Bean <gbean@codeaurora.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Jon Povey and committed by
Linus Torvalds
6a99ad4a 952e1c66

+4 -3
+4 -3
drivers/gpio/gpiolib.c
··· 893 893 void gpio_unexport(unsigned gpio) 894 894 { 895 895 struct gpio_desc *desc; 896 - int status = -EINVAL; 896 + int status = 0; 897 897 898 - if (!gpio_is_valid(gpio)) 898 + if (!gpio_is_valid(gpio)) { 899 + status = -EINVAL; 899 900 goto done; 901 + } 900 902 901 903 mutex_lock(&sysfs_lock); 902 904 ··· 913 911 clear_bit(FLAG_EXPORT, &desc->flags); 914 912 put_device(dev); 915 913 device_unregister(dev); 916 - status = 0; 917 914 } else 918 915 status = -ENODEV; 919 916 }