[PATCH] chardev: GPIO for SCx200 & PC-8736x: use dev_dbg in common module
[firefly-linux-kernel-4.4.55.git] / drivers / char / cs5535_gpio.c
index 5d72f50de1ac97c6e377fb6c5e0d0d4192016983..46d66037b917c5851222b56af77f4b158ce793aa 100644 (file)
@@ -241,9 +241,10 @@ static int __init cs5535_gpio_init(void)
 static void __exit cs5535_gpio_cleanup(void)
 {
        dev_t dev_id = MKDEV(major, 0);
+
+       cdev_del(&cs5535_gpio_cdev);
        unregister_chrdev_region(dev_id, CS5535_GPIO_COUNT);
-       if (gpio_base != 0)
-               release_region(gpio_base, CS5535_GPIO_SIZE);
+       release_region(gpio_base, CS5535_GPIO_SIZE);
 }
 
 module_init(cs5535_gpio_init);