diff options
Diffstat (limited to 'drivers/gpio/gpiolib.c')
-rw-r--r-- | drivers/gpio/gpiolib.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c index 24f60d28f0c0..58d822d7e8da 100644 --- a/drivers/gpio/gpiolib.c +++ b/drivers/gpio/gpiolib.c | |||
@@ -449,7 +449,6 @@ static void gpiodevice_release(struct device *dev) | |||
449 | { | 449 | { |
450 | struct gpio_device *gdev = dev_get_drvdata(dev); | 450 | struct gpio_device *gdev = dev_get_drvdata(dev); |
451 | 451 | ||
452 | cdev_del(&gdev->chrdev); | ||
453 | list_del(&gdev->list); | 452 | list_del(&gdev->list); |
454 | ida_simple_remove(&gpio_ida, gdev->id); | 453 | ida_simple_remove(&gpio_ida, gdev->id); |
455 | kfree(gdev->label); | 454 | kfree(gdev->label); |
@@ -482,7 +481,6 @@ static int gpiochip_setup_dev(struct gpio_device *gdev) | |||
482 | 481 | ||
483 | /* From this point, the .release() function cleans up gpio_device */ | 482 | /* From this point, the .release() function cleans up gpio_device */ |
484 | gdev->dev.release = gpiodevice_release; | 483 | gdev->dev.release = gpiodevice_release; |
485 | get_device(&gdev->dev); | ||
486 | pr_debug("%s: registered GPIOs %d to %d on device: %s (%s)\n", | 484 | pr_debug("%s: registered GPIOs %d to %d on device: %s (%s)\n", |
487 | __func__, gdev->base, gdev->base + gdev->ngpio - 1, | 485 | __func__, gdev->base, gdev->base + gdev->ngpio - 1, |
488 | dev_name(&gdev->dev), gdev->chip->label ? : "generic"); | 486 | dev_name(&gdev->dev), gdev->chip->label ? : "generic"); |
@@ -770,6 +768,8 @@ void gpiochip_remove(struct gpio_chip *chip) | |||
770 | * be removed, else it will be dangling until the last user is | 768 | * be removed, else it will be dangling until the last user is |
771 | * gone. | 769 | * gone. |
772 | */ | 770 | */ |
771 | cdev_del(&gdev->chrdev); | ||
772 | device_del(&gdev->dev); | ||
773 | put_device(&gdev->dev); | 773 | put_device(&gdev->dev); |
774 | } | 774 | } |
775 | EXPORT_SYMBOL_GPL(gpiochip_remove); | 775 | EXPORT_SYMBOL_GPL(gpiochip_remove); |
@@ -869,7 +869,7 @@ struct gpio_chip *gpiochip_find(void *data, | |||
869 | 869 | ||
870 | spin_lock_irqsave(&gpio_lock, flags); | 870 | spin_lock_irqsave(&gpio_lock, flags); |
871 | list_for_each_entry(gdev, &gpio_devices, list) | 871 | list_for_each_entry(gdev, &gpio_devices, list) |
872 | if (match(gdev->chip, data)) | 872 | if (gdev->chip && match(gdev->chip, data)) |
873 | break; | 873 | break; |
874 | 874 | ||
875 | /* No match? */ | 875 | /* No match? */ |