aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpio/gpiolib.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpio/gpiolib.c')
-rw-r--r--drivers/gpio/gpiolib.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
index 9112830107a5..faa1cc66e9cf 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -248,7 +248,7 @@ static ssize_t gpio_value_show(struct device *dev,
248 if (!test_bit(FLAG_EXPORT, &desc->flags)) 248 if (!test_bit(FLAG_EXPORT, &desc->flags))
249 status = -EIO; 249 status = -EIO;
250 else 250 else
251 status = sprintf(buf, "%d\n", gpio_get_value_cansleep(gpio)); 251 status = sprintf(buf, "%d\n", !!gpio_get_value_cansleep(gpio));
252 252
253 mutex_unlock(&sysfs_lock); 253 mutex_unlock(&sysfs_lock);
254 return status; 254 return status;
@@ -1105,7 +1105,7 @@ int gpio_get_value_cansleep(unsigned gpio)
1105 1105
1106 might_sleep_if(extra_checks); 1106 might_sleep_if(extra_checks);
1107 chip = gpio_to_chip(gpio); 1107 chip = gpio_to_chip(gpio);
1108 return chip->get(chip, gpio - chip->base); 1108 return chip->get ? chip->get(chip, gpio - chip->base) : 0;
1109} 1109}
1110EXPORT_SYMBOL_GPL(gpio_get_value_cansleep); 1110EXPORT_SYMBOL_GPL(gpio_get_value_cansleep);
1111 1111
@@ -1143,7 +1143,7 @@ static void gpiolib_dbg_show(struct seq_file *s, struct gpio_chip *chip)
1143 1143
1144 if (!is_out) { 1144 if (!is_out) {
1145 int irq = gpio_to_irq(gpio); 1145 int irq = gpio_to_irq(gpio);
1146 struct irq_desc *desc = irq_desc + irq; 1146 struct irq_desc *desc = irq_to_desc(irq);
1147 1147
1148 /* This races with request_irq(), set_irq_type(), 1148 /* This races with request_irq(), set_irq_type(),
1149 * and set_irq_wake() ... but those are "rare". 1149 * and set_irq_wake() ... but those are "rare".