Commit cb264eb8 authored by Rusty Russell's avatar Rusty Russell Committed by Linus Torvalds

[PATCH] remove check_region from drivers_net_irda_irport.c

From:  william stinson <wstinson@wanadoo.fr>

  this patch for drivers/net/irda/irport.c IRDA driver removes one call
  to check_region using request_region instead.  The patch also moves
  the call to request_region to before the allocation of the driver
  instance.
parent ebeb4267
...@@ -102,9 +102,6 @@ int __init irport_init(void) ...@@ -102,9 +102,6 @@ int __init irport_init(void)
int i; int i;
for (i=0; (io[i] < 2000) && (i < 4); i++) { for (i=0; (io[i] < 2000) && (i < 4); i++) {
int ioaddr = io[i];
if (check_region(ioaddr, IO_EXTENT))
continue;
if (irport_open(i, io[i], irq[i]) != NULL) if (irport_open(i, io[i], irq[i]) != NULL)
return 0; return 0;
} }
...@@ -142,6 +139,14 @@ irport_open(int i, unsigned int iobase, unsigned int irq) ...@@ -142,6 +139,14 @@ irport_open(int i, unsigned int iobase, unsigned int irq)
IRDA_DEBUG(1, "%s()\n", __FUNCTION__); IRDA_DEBUG(1, "%s()\n", __FUNCTION__);
/* Lock the port that we need */
ret = request_region(iobase, IO_EXTENT, driver_name);
if (!ret) {
IRDA_DEBUG(0, "%s(), can't get iobase of 0x%03x\n",
__FUNCTION__, iobase);
return NULL;
}
/* /*
* Allocate new instance of the driver * Allocate new instance of the driver
*/ */
...@@ -149,6 +154,7 @@ irport_open(int i, unsigned int iobase, unsigned int irq) ...@@ -149,6 +154,7 @@ irport_open(int i, unsigned int iobase, unsigned int irq)
if (!self) { if (!self) {
ERROR("%s(), can't allocate memory for " ERROR("%s(), can't allocate memory for "
"control block!\n", __FUNCTION__); "control block!\n", __FUNCTION__);
release_region(iobase, IO_EXTENT);
return NULL; return NULL;
} }
memset(self, 0, sizeof(struct irport_cb)); memset(self, 0, sizeof(struct irport_cb));
...@@ -165,14 +171,6 @@ irport_open(int i, unsigned int iobase, unsigned int irq) ...@@ -165,14 +171,6 @@ irport_open(int i, unsigned int iobase, unsigned int irq)
self->io.irq = irq; self->io.irq = irq;
self->io.fifo_size = 16; self->io.fifo_size = 16;
/* Lock the port that we need */
ret = request_region(self->io.sir_base, self->io.sir_ext, driver_name);
if (!ret) {
IRDA_DEBUG(0, "%s(), can't get iobase of 0x%03x\n",
__FUNCTION__, self->io.sir_base);
return NULL;
}
/* Initialize QoS for this device */ /* Initialize QoS for this device */
irda_init_max_qos_capabilies(&self->qos); irda_init_max_qos_capabilies(&self->qos);
......
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