Skip to content

Commit

Permalink
drivers/pcmcia/m32r_pcc.c: check return from request_irq
Browse files Browse the repository at this point in the history
While building m32r allmodconfig we were getting warning:

  drivers/pcmcia/m32r_pcc.c:331:2: warning: ignoring return value of 'request_irq', declared with attribute warn_unused_result

request_irq() can fail and we should always be checking the result from
it. Check the result and return it to the caller.

Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Sudip Mukherjee <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
sudipm-mukherjee authored and torvalds committed Dec 13, 2016
1 parent 17e9623 commit 4170a20
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions drivers/pcmcia/m32r_pcc.c
Original file line number Diff line number Diff line change
Expand Up @@ -296,10 +296,11 @@ static int __init is_alive(u_short sock)
return 0;
}

static void add_pcc_socket(ulong base, int irq, ulong mapaddr,
unsigned int ioaddr)
static int add_pcc_socket(ulong base, int irq, ulong mapaddr,
unsigned int ioaddr)
{
pcc_socket_t *t = &socket[pcc_sockets];
int err;

/* add sockets */
t->ioaddr = ioaddr;
Expand Down Expand Up @@ -328,11 +329,16 @@ static void add_pcc_socket(ulong base, int irq, ulong mapaddr,
t->socket.irq_mask = 0;
t->socket.pci_irq = 2 + pcc_sockets; /* XXX */

request_irq(irq, pcc_interrupt, 0, "m32r-pcc", pcc_interrupt);
err = request_irq(irq, pcc_interrupt, 0, "m32r-pcc", pcc_interrupt);
if (err) {
if (t->base > 0)
release_region(t->base, 0x20);
return err;
}

pcc_sockets++;

return;
return 0;
}


Expand Down

0 comments on commit 4170a20

Please sign in to comment.