Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam Stinson <wstinson@infonie.fr>2002-07-31 22:24:03 -0700
committerChristoph Hellwig <hch@sb.bsdonline.org>2002-07-31 22:24:03 -0700
commit691e21bada51a526bc38d3f8ce23b2d696f410ae (patch)
tree88eeb1f064dc9f8d143c7d5e6c98fba817e602b6
parentb547fa90cd6a18b5081efb28cff168eb73202a23 (diff)
[PATCH] small region change for baycom_ser_hdx.c
this is a small patch for baycom_ser_hdx.c -- baycom ser12 halfduplex radio modem driver 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/net/hamradio/baycom_ser_hdx.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/net/hamradio/baycom_ser_hdx.c b/drivers/net/hamradio/baycom_ser_hdx.c
index 9c860f1e5ef3..14e18b0b1df0 100644
--- a/drivers/net/hamradio/baycom_ser_hdx.c
+++ b/drivers/net/hamradio/baycom_ser_hdx.c
@@ -476,19 +476,22 @@ static int ser12_open(struct net_device *dev)
if (!dev->base_addr || dev->base_addr > 0x1000-SER12_EXTENT ||
dev->irq < 2 || dev->irq > 15)
return -ENXIO;
- if (check_region(dev->base_addr, SER12_EXTENT))
+ if (!request_region(dev->base_addr, SER12_EXTENT, "baycom_ser12"))
return -EACCES;
memset(&bc->modem, 0, sizeof(bc->modem));
bc->hdrv.par.bitrate = 1200;
- if ((u = ser12_check_uart(dev->base_addr)) == c_uart_unknown)
+ if ((u = ser12_check_uart(dev->base_addr)) == c_uart_unknown) {
+ release_region(dev->base_addr, SER12_EXTENT);
return -EIO;
+ }
outb(0, FCR(dev->base_addr)); /* disable FIFOs */
outb(0x0d, MCR(dev->base_addr));
outb(0, IER(dev->base_addr));
if (request_irq(dev->irq, ser12_interrupt, SA_INTERRUPT | SA_SHIRQ,
- "baycom_ser12", dev))
+ "baycom_ser12", dev)) {
+ release_region(dev->base_addr, SER12_EXTENT);
return -EBUSY;
- request_region(dev->base_addr, SER12_EXTENT, "baycom_ser12");
+ }
/*
* enable transmitter empty interrupt
*/