Commit 4246fcb1 authored by Dave Jones's avatar Dave Jones

[PATCH] region handling cleanups for tpqic02

parent 79a4c583
...@@ -2748,7 +2748,9 @@ static int qic02_get_resources(void) ...@@ -2748,7 +2748,9 @@ static int qic02_get_resources(void)
* the config parameters have been set using MTSETCONFIG. * the config parameters have been set using MTSETCONFIG.
*/ */
if (check_region(QIC02_TAPE_PORT, QIC02_TAPE_PORT_RANGE)) { /* Grab the IO region. */
if (!request_region(QIC02_TAPE_PORT, QIC02_TAPE_PORT_RANGE,
TPQIC02_NAME)) {
printk(TPQIC02_NAME printk(TPQIC02_NAME
": IO space at 0x%x [%d ports] already reserved\n", ": IO space at 0x%x [%d ports] already reserved\n",
QIC02_TAPE_PORT, QIC02_TAPE_PORT_RANGE); QIC02_TAPE_PORT, QIC02_TAPE_PORT_RANGE);
...@@ -2762,6 +2764,7 @@ static int qic02_get_resources(void) ...@@ -2762,6 +2764,7 @@ static int qic02_get_resources(void)
printk(TPQIC02_NAME printk(TPQIC02_NAME
": can't allocate IRQ%d for QIC-02 tape\n", ": can't allocate IRQ%d for QIC-02 tape\n",
QIC02_TAPE_IRQ); QIC02_TAPE_IRQ);
release_region(QIC02_TAPE_PORT, QIC02_TAPE_PORT_RANGE);
return -EBUSY; return -EBUSY;
} }
...@@ -2771,13 +2774,10 @@ static int qic02_get_resources(void) ...@@ -2771,13 +2774,10 @@ static int qic02_get_resources(void)
": can't allocate DMA%d for QIC-02 tape\n", ": can't allocate DMA%d for QIC-02 tape\n",
QIC02_TAPE_DMA); QIC02_TAPE_DMA);
free_irq(QIC02_TAPE_IRQ, NULL); free_irq(QIC02_TAPE_IRQ, NULL);
release_region(QIC02_TAPE_PORT, QIC02_TAPE_PORT_RANGE);
return -EBUSY; return -EBUSY;
} }
/* Grab the IO region. We already made sure it's available. */
request_region(QIC02_TAPE_PORT, QIC02_TAPE_PORT_RANGE,
TPQIC02_NAME);
/* Setup the page-address for the dma transfer. */ /* Setup the page-address for the dma transfer. */
buffaddr = buffaddr =
(void *) __get_dma_pages(GFP_KERNEL, get_order(TPQBUF_SIZE)); (void *) __get_dma_pages(GFP_KERNEL, get_order(TPQBUF_SIZE));
......
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