diff options
author | J. Bruce Fields <bfields@citi.umich.edu> | 2009-11-23 18:34:58 +0100 |
---|---|---|
committer | J. Bruce Fields <bfields@citi.umich.edu> | 2009-11-23 18:34:58 +0100 |
commit | 9b8b317d58084b9a44f6f33b355c4278d9f841fb (patch) | |
tree | e0df89800bf4301c4017db3cdf04a2056ec1a852 /drivers/gpio/gpiolib.c | |
parent | Revert "knfsd: avoid overloading the CPU scheduler with enormous load averages" (diff) | |
parent | Linux 2.6.32-rc8 (diff) | |
download | linux-9b8b317d58084b9a44f6f33b355c4278d9f841fb.tar.xz linux-9b8b317d58084b9a44f6f33b355c4278d9f841fb.zip |
Merge commit 'v2.6.32-rc8' into HEAD
Diffstat (limited to 'drivers/gpio/gpiolib.c')
-rw-r--r-- | drivers/gpio/gpiolib.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c index 662ed923d9eb..50de0f5750d8 100644 --- a/drivers/gpio/gpiolib.c +++ b/drivers/gpio/gpiolib.c @@ -661,7 +661,7 @@ int gpio_export(unsigned gpio, bool direction_may_change) dev = device_create(&gpio_class, desc->chip->dev, MKDEV(0, 0), desc, ioname ? ioname : "gpio%d", gpio); - if (dev) { + if (!IS_ERR(dev)) { if (direction_may_change) status = sysfs_create_group(&dev->kobj, &gpio_attr_group); @@ -679,7 +679,7 @@ int gpio_export(unsigned gpio, bool direction_may_change) if (status != 0) device_unregister(dev); } else - status = -ENODEV; + status = PTR_ERR(dev); if (status == 0) set_bit(FLAG_EXPORT, &desc->flags); } @@ -800,11 +800,11 @@ static int gpiochip_export(struct gpio_chip *chip) mutex_lock(&sysfs_lock); dev = device_create(&gpio_class, chip->dev, MKDEV(0, 0), chip, "gpiochip%d", chip->base); - if (dev) { + if (!IS_ERR(dev)) { status = sysfs_create_group(&dev->kobj, &gpiochip_attr_group); } else - status = -ENODEV; + status = PTR_ERR(dev); chip->exported = (status == 0); mutex_unlock(&sysfs_lock); |