]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/gpio/gpiolib.c
PCI hotplug: rpaphp: make debug var unique
[linux-2.6-omap-h63xx.git] / drivers / gpio / gpiolib.c
index 9112830107a53d4c208b5a8cbf1934026549bac1..22edc4273ef68cd46eceabe2ec249cca93faf0a5 100644 (file)
@@ -248,7 +248,7 @@ static ssize_t gpio_value_show(struct device *dev,
        if (!test_bit(FLAG_EXPORT, &desc->flags))
                status = -EIO;
        else
-               status = sprintf(buf, "%d\n", gpio_get_value_cansleep(gpio));
+               status = sprintf(buf, "%d\n", !!gpio_get_value_cansleep(gpio));
 
        mutex_unlock(&sysfs_lock);
        return status;
@@ -1105,7 +1105,7 @@ int gpio_get_value_cansleep(unsigned gpio)
 
        might_sleep_if(extra_checks);
        chip = gpio_to_chip(gpio);
-       return chip->get(chip, gpio - chip->base);
+       return chip->get ? chip->get(chip, gpio - chip->base) : 0;
 }
 EXPORT_SYMBOL_GPL(gpio_get_value_cansleep);