Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam Stinson <wstinson@infonie.fr>2002-07-31 22:25:55 -0700
committerChristoph Hellwig <hch@sb.bsdonline.org>2002-07-31 22:25:55 -0700
commitbccdb12ca468f698fc7b61a00d1b8b225399c5e7 (patch)
tree67dc45083063a7b29566807b1ac6f2b0261c4e8e
parent087822f2431136b1f3be5e0d9fa65eebfea3cf1a (diff)
[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.
-rw-r--r--drivers/isdn/hysdn/boardergo.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/drivers/isdn/hysdn/boardergo.c b/drivers/isdn/hysdn/boardergo.c
index 67c245a886c3..aae47971c5f0 100644
--- a/drivers/isdn/hysdn/boardergo.c
+++ b/drivers/isdn/hysdn/boardergo.c
@@ -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 */