Skip to content

Commit

Permalink
misc: enclosure: Remove unnecessary error check
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Arvind Yadav authored and Greg Kroah-Hartman committed Dec 7, 2017
1 parent 367ef84 commit 750b54d
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions drivers/misc/enclosure.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 750b54d

Please sign in to comment.