Skip to content

Commit

Permalink
Input: ct82710c - return proper error code for ct82c710_open
Browse files Browse the repository at this point in the history
If request_irq() fails we should return the proper error instead of -1.

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
  • Loading branch information
Davidlohr Bueso authored and Dmitry Torokhov committed Jan 18, 2011
1 parent 81e78de commit b0f05aa
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions drivers/input/serio/ct82c710.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,11 @@ static void ct82c710_close(struct serio *serio)
static int ct82c710_open(struct serio *serio)
{
unsigned char status;
int err;

if (request_irq(CT82C710_IRQ, ct82c710_interrupt, 0, "ct82c710", NULL))
return -1;
err = request_irq(CT82C710_IRQ, ct82c710_interrupt, 0, "ct82c710", NULL);
if (err)
return err;

status = inb_p(CT82C710_STATUS);

Expand All @@ -131,7 +133,7 @@ static int ct82c710_open(struct serio *serio)
status &= ~(CT82C710_ENABLE | CT82C710_INTS_ON);
outb_p(status, CT82C710_STATUS);
free_irq(CT82C710_IRQ, NULL);
return -1;
return -EBUSY;
}

return 0;
Expand Down

0 comments on commit b0f05aa

Please sign in to comment.