Commit ebfdbb01 authored by Dave Jones's avatar Dave Jones Committed by Linus Torvalds

[PATCH] region handling cleanup

Done by William Stinson.
Adds error handling to request_region() calls,
and converts some old check_region() calls too.
parent fcb58746
...@@ -1346,9 +1346,6 @@ static struct expansion_card *ecs; ...@@ -1346,9 +1346,6 @@ static struct expansion_card *ecs;
*/ */
static int mfm_probecontroller (unsigned int mfm_addr) static int mfm_probecontroller (unsigned int mfm_addr)
{ {
if (check_region (mfm_addr, 10))
return 0;
if (inw (MFM_STATUS) & STAT_BSY) { if (inw (MFM_STATUS) & STAT_BSY) {
outw (CMD_ABT, MFM_COMMAND); outw (CMD_ABT, MFM_COMMAND);
udelay (50); udelay (50);
...@@ -1406,15 +1403,19 @@ int mfm_init (void) ...@@ -1406,15 +1403,19 @@ int mfm_init (void)
ecard_claim(ecs); ecard_claim(ecs);
} }
printk("mfm: found at address %08X, interrupt %d\n", mfm_addr, mfm_irq);
if (!request_region (mfm_addr, 10, "mfm")) {
ecard_release(ecs);
return -1;
}
if (register_blkdev(MAJOR_NR, "mfm", &mfm_fops)) { if (register_blkdev(MAJOR_NR, "mfm", &mfm_fops)) {
printk("mfm_init: unable to get major number %d\n", MAJOR_NR); printk("mfm_init: unable to get major number %d\n", MAJOR_NR);
ecard_release(ecs); ecard_release(ecs);
release_region(mfm_addr, 10);
return -1; return -1;
} }
printk("mfm: found at address %08X, interrupt %d\n", mfm_addr, mfm_irq);
request_region (mfm_addr, 10, "mfm");
/* Stuff for the assembler routines to get to */ /* Stuff for the assembler routines to get to */
hdc63463_baseaddress = ioaddr(mfm_addr); hdc63463_baseaddress = ioaddr(mfm_addr);
hdc63463_irqpolladdress = mfm_IRQPollLoc; hdc63463_irqpolladdress = mfm_IRQPollLoc;
......
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