From: Arvind Yadav Date: Wed, 29 Nov 2017 13:08:32 +0000 (+0530) Subject: misc: enclosure: Remove unnecessary error check X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=750b54deb569369f8cd808c9f7afd1348bde96ed;p=openwrt%2Fstaging%2Fblogic.git misc: enclosure: Remove unnecessary error check It is not necessary to check return value of class_register. enclosure_init returns both successful and error value. Signed-off-by: Arvind Yadav Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/misc/enclosure.c b/drivers/misc/enclosure.c index c4c5552abf14..5a17bfeb80d3 100644 --- a/drivers/misc/enclosure.c +++ b/drivers/misc/enclosure.c @@ -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)