* [PATCH] input: ct82710c: return proper error code for ct82c710_open
@ 2011-01-13 17:35 Davidlohr Bueso
2011-01-17 8:22 ` Dmitry Torokhov
0 siblings, 1 reply; 3+ messages in thread
From: Davidlohr Bueso @ 2011-01-13 17:35 UTC (permalink / raw)
To: Dmitry Torokhov; +Cc: LKML, linux-serial@vger.kernel.org
From: Davidlohr Bueso <dave@gnu.org>
If request_irq() fails we should return the proper error instead of -1.
Signed-off-by: Davidlohr Bueso <dave@gnu.org>
---
drivers/input/serio/ct82c710.c | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/drivers/input/serio/ct82c710.c b/drivers/input/serio/ct82c710.c
index 448c772..ee0edd0 100644
--- a/drivers/input/serio/ct82c710.c
+++ b/drivers/input/serio/ct82c710.c
@@ -111,9 +111,11 @@ static void ct82c710_close(struct serio *serio)
static int ct82c710_open(struct serio *serio)
{
unsigned char status;
+ int err = 0;
- if (request_irq(CT82C710_IRQ, ct82c710_interrupt, 0, "ct82c710", NULL))
- return -1;
+ err = request_irq(CT82C710_IRQ, ct82c710_interrupt, 0, "ct82c710", NULL);
+ if (err)
+ goto out;
status = inb_p(CT82C710_STATUS);
@@ -133,8 +135,8 @@ static int ct82c710_open(struct serio *serio)
free_irq(CT82C710_IRQ, NULL);
return -1;
}
-
- return 0;
+out:
+ return err;
}
/*
--
1.7.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] input: ct82710c: return proper error code for ct82c710_open
2011-01-13 17:35 [PATCH] input: ct82710c: return proper error code for ct82c710_open Davidlohr Bueso
@ 2011-01-17 8:22 ` Dmitry Torokhov
2011-01-17 12:43 ` Davidlohr Bueso
0 siblings, 1 reply; 3+ messages in thread
From: Dmitry Torokhov @ 2011-01-17 8:22 UTC (permalink / raw)
To: Davidlohr Bueso; +Cc: LKML, linux-serial@vger.kernel.org
On Thu, Jan 13, 2011 at 02:35:50PM -0300, Davidlohr Bueso wrote:
> From: Davidlohr Bueso <dave@gnu.org>
>
> If request_irq() fails we should return the proper error instead of -1.
>
> Signed-off-by: Davidlohr Bueso <dave@gnu.org>
Will apply, thank you. You don't really have the device, do you?
Thanks.
--
Dmitry
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] input: ct82710c: return proper error code for ct82c710_open
2011-01-17 8:22 ` Dmitry Torokhov
@ 2011-01-17 12:43 ` Davidlohr Bueso
0 siblings, 0 replies; 3+ messages in thread
From: Davidlohr Bueso @ 2011-01-17 12:43 UTC (permalink / raw)
To: Dmitry Torokhov; +Cc: LKML, linux-serial@vger.kernel.org
On Mon, 2011-01-17 at 00:22 -0800, Dmitry Torokhov wrote:
> On Thu, Jan 13, 2011 at 02:35:50PM -0300, Davidlohr Bueso wrote:
> > From: Davidlohr Bueso <dave@gnu.org>
> >
> > If request_irq() fails we should return the proper error instead of -1.
> >
> > Signed-off-by: Davidlohr Bueso <dave@gnu.org>
>
> Will apply, thank you. You don't really have the device, do you?
>
No, I don't have that device, but looks trivial enough to be
compile-tested only.
Thanks.
> Thanks.
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-01-17 14:53 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-13 17:35 [PATCH] input: ct82710c: return proper error code for ct82c710_open Davidlohr Bueso
2011-01-17 8:22 ` Dmitry Torokhov
2011-01-17 12:43 ` Davidlohr Bueso
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).