Remove uneeded calls to class_unregister
authorPete Batard <pete@akeo.ie>
Sat, 7 Nov 2015 18:14:21 +0000 (18:14 +0000)
committerPete Batard <pete@akeo.ie>
Sat, 7 Nov 2015 18:14:21 +0000 (18:14 +0000)
* As shown by http://lxr.free-electrons.com/source/drivers/base/class.c?v=3.16#L273
  class_destroy() does call class_unregister()

parrot_driver.c

index 4a937a6..4451289 100644 (file)
@@ -217,7 +217,6 @@ static int __init parrot_module_init(void)
        return 0;
 
 failed_devreg:
-       class_unregister(parrot_class);
        class_destroy(parrot_class);
 failed_classreg:
        unregister_chrdev(parrot_major, DEVICE_NAME);
@@ -231,7 +230,6 @@ static void __exit parrot_module_exit(void)
        device_remove_file(parrot_device, &dev_attr_fifo);
        device_remove_file(parrot_device, &dev_attr_reset);
        device_destroy(parrot_class, MKDEV(parrot_major, 0));
-       class_unregister(parrot_class);
        class_destroy(parrot_class);
        unregister_chrdev(parrot_major, DEVICE_NAME);
 }