diff --git a/target/linux/generic/files/drivers/char/gpio_dev.c b/target/linux/generic/files/drivers/char/gpio_dev.c index 0f428bd38b..c741573026 100644 --- a/target/linux/generic/files/drivers/char/gpio_dev.c +++ b/target/linux/generic/files/drivers/char/gpio_dev.c @@ -141,6 +141,8 @@ out: static int gpio_remove(struct platform_device *dev) { + device_destroy(gpiodev_class, MKDEV(dev_major, 0)); + class_destroy(gpiodev_class); unregister_chrdev(dev_major, DEVNAME); return 0; }