diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-04-26 22:25:18 +0200 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-04-26 22:25:18 +0200 |
commit | d92f1a2829dbe29c644569a3b64a021e4d90005d (patch) | |
tree | 8390de547df80777f575f633d9a6d2512e4478db /drivers/ide/ide-probe.c | |
parent | d9b819a025ca1b09dafbe90b5d25ba57a639f048 (diff) |
ide: manage I/O resources in ide_legacy_init_one()
* Tell IDE layer to not manage resources by setting hwif->mmio flag.
* Use {request,release}_region() for resources management.
* Set ->name field of 'struct ide_port_info' instances in legacy VLB
host drivers and use driver name for resources management.
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/ide-probe.c')
-rw-r--r-- | drivers/ide/ide-probe.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c index e299c80c6a57..670d7f9ccf0e 100644 --- a/drivers/ide/ide-probe.c +++ b/drivers/ide/ide-probe.c @@ -1648,12 +1648,26 @@ static void ide_legacy_init_one(u8 *idx, hw_regs_t *hw, u8 port_no, irq = 15; } + if (!request_region(base, 8, d->name)) { + printk(KERN_ERR "%s: I/O resource 0x%lX-0x%lX not free.\n", + d->name, base, base + 7); + return; + } + + if (!request_region(ctl, 1, d->name)) { + printk(KERN_ERR "%s: I/O resource 0x%lX not free.\n", + d->name, ctl); + release_region(base, 8); + return; + } + ide_std_init_ports(hw, base, ctl); hw->irq = irq; hwif = ide_find_port_slot(d); if (hwif) { ide_init_port_hw(hwif, hw); + hwif->mmio = 1; if (config) hwif->config_data = config; idx[port_no] = hwif->index; |