mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Arvind Yadav <arvind.yadav.cs@gmail.com>
To: arnd@arndb.de, gregkh@linuxfoundation.org
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH 2/2 v2] misc: enclosure: Remove unnecessary error check
Date: Wed, 29 Nov 2017 18:38:32 +0530	[thread overview]
Message-ID: <2303e49e483dedad1faa0989c56e8f74a0a8d5ed.1511960503.git.arvind.yadav.cs@gmail.com> (raw)
In-Reply-To: <0220d514bcec188234edd53ac55c5c43e8cd2df0.1511960503.git.arvind.yadav.cs@gmail.com>
In-Reply-To: <0220d514bcec188234edd53ac55c5c43e8cd2df0.1511960503.git.arvind.yadav.cs@gmail.com>

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>
---
changes in v2:
             subject was incorrect. subsystem/driver was wrong.

 drivers/misc/enclosure.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/drivers/misc/enclosure.c b/drivers/misc/enclosure.c
index c4c5552..5a17bfe 100644
--- a/drivers/misc/enclosure.c
+++ b/drivers/misc/enclosure.c
@@ -680,13 +680,7 @@ static DEVICE_ATTR(power_status, S_IRUGO | S_IWUSR, get_component_power_status,
 
 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)
-- 
1.9.1

      reply	other threads:[~2017-11-29 13:09 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-29 13:08 [PATCH 1/2 v2] misc: enclosure: Fix space before '[' error Arvind Yadav
2017-11-29 13:08 ` Arvind Yadav [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2303e49e483dedad1faa0989c56e8f74a0a8d5ed.1511960503.git.arvind.yadav.cs@gmail.com \
    --to=arvind.yadav.cs@gmail.com \
    --cc=arnd@arndb.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®