mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
To: Willy Tarreau <willy@meta-x.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Sudip Mukherjee <sudipm.mukherjee@gmail.com>,
	devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org
Subject: [PATCH v2 2/3] staging: panel: return register value
Date: Mon,  9 Mar 2015 20:08:24 +0530	[thread overview]
Message-ID: <1425911905-14780-2-git-send-email-sudipm.mukherjee@gmail.com> (raw)
In-Reply-To: <1425911905-14780-1-git-send-email-sudipm.mukherjee@gmail.com>

we were returning success even if the module failed to register.
now we are returning the actual return value, success or error.

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
---

v2: added the error message if parport_register_driver() fails.

 drivers/staging/panel/panel.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/panel/panel.c b/drivers/staging/panel/panel.c
index 3ef3dcf..65872fa 100644
--- a/drivers/staging/panel/panel.c
+++ b/drivers/staging/panel/panel.c
@@ -2254,7 +2254,7 @@ static struct parport_driver panel_driver = {
 /* init function */
 static int __init panel_init_module(void)
 {
-	int selected_keypad_type = NOT_SET;
+	int selected_keypad_type = NOT_SET, err;
 
 	/* take care of an eventual profile */
 	switch (profile) {
@@ -2360,9 +2360,10 @@ static int __init panel_init_module(void)
 		return -ENODEV;
 	}
 
-	if (parport_register_driver(&panel_driver)) {
+	err = parport_register_driver(&panel_driver);
+	if (err) {
 		pr_err("could not register with parport. Aborting.\n");
-		return -EIO;
+		return err;
 	}
 
 	if (pprt)
-- 
1.8.1.2


  reply	other threads:[~2015-03-09 14:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-09 14:38 [PATCH v2 1/3] staging: panel: register reboot Sudip Mukherjee
2015-03-09 14:38 ` Sudip Mukherjee [this message]
2015-03-09 20:30   ` [PATCH v2 2/3] staging: panel: return register value Willy Tarreau
2015-03-09 14:38 ` [PATCH v2 3/3] staging: panel: remove initialization check Sudip Mukherjee

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=1425911905-14780-2-git-send-email-sudipm.mukherjee@gmail.com \
    --to=sudipm.mukherjee@gmail.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=willy@meta-x.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®