Commit bccdb12c authored by William Stinson's avatar William Stinson Committed by Christoph Hellwig

[PATCH] small region change for boardergo.c

this is a small patch for boardergo.c linux driver for isdn HYSDN cards to
    1) remove call to check_region using request_region instead
    2) check the status of call to request_region
    3) release allocated region resource in case of error.

I don't have this hardware so compilation checked only.
parent 087822f2
......@@ -424,16 +424,19 @@ ergo_releasehardware(hysdn_card * card)
int
ergo_inithardware(hysdn_card * card)
{
if (check_region(card->iobase + PCI9050_INTR_REG, 1) ||
check_region(card->iobase + PCI9050_USER_IO, 1))
if (!request_region(card->iobase + PCI9050_INTR_REG, 1, "HYSDN"))
return (-1);
if (!request_region(card->iobase + PCI9050_USER_IO, 1, "HYSDN")) {
release_region(card->iobase + PCI9050_INTR_REG, 1);
return (-1); /* ports already in use */
}
card->memend = card->membase + ERG_DPRAM_PAGE_SIZE - 1;
if (!(card->dpram = ioremap(card->membase, ERG_DPRAM_PAGE_SIZE)))
if (!(card->dpram = ioremap(card->membase, ERG_DPRAM_PAGE_SIZE))) {
release_region(card->iobase + PCI9050_INTR_REG, 1);
release_region(card->iobase + PCI9050_USER_IO, 1);
return (-1);
}
request_region(card->iobase + PCI9050_INTR_REG, 1, "HYSDN");
request_region(card->iobase + PCI9050_USER_IO, 1, "HYSDN");
ergo_stopcard(card); /* disable interrupts */
if (request_irq(card->irq, ergo_interrupt, SA_SHIRQ, "HYSDN", card)) {
ergo_releasehardware(card); /* return the acquired hardware */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment