misc: enclosure: Remove unnecessary error check
authorArvind Yadav <arvind.yadav.cs@gmail.com>
Wed, 29 Nov 2017 13:08:32 +0000 (18:38 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 7 Dec 2017 17:45:31 +0000 (18:45 +0100)
It is not necessary to check return value of class_register.
enclosure_init returns both successful and error value.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/misc/enclosure.c

index c4c5552abf145ad22a4802748cea0e8e200a5755..5a17bfeb80d398c023278ff9f0ed691d6785ef53 100644 (file)
@@ -680,13 +680,7 @@ ATTRIBUTE_GROUPS(enclosure_component);
 
 static int __init enclosure_init(void)
 {
-       int err;
-
-       err = class_register(&enclosure_class);
-       if (err)
-               return err;
-
-       return 0;
+       return class_register(&enclosure_class);
 }
 
 static void __exit enclosure_exit(void)