ide-mpc8xx: fix resources reservation

* Tell IDE layer to not manage resources by setting
  hwif->mmio flag and request resources in m8xx_ide_init_ports().

* Use request_mem_region() for resources reservation.

* Use driver name for resources reservation.

Cc: Vitaly Bordug <vitb@kernel.crashing.org>
Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
parent cb7500db
...@@ -36,6 +36,8 @@ ...@@ -36,6 +36,8 @@
#include <asm/machdep.h> #include <asm/machdep.h>
#include <asm/irq.h> #include <asm/irq.h>
#define DRV_NAME "ide-mpc8xx"
static int identify (volatile u8 *p); static int identify (volatile u8 *p);
static void print_fixed (volatile u8 *p); static void print_fixed (volatile u8 *p);
static void print_funcid (int func); static void print_funcid (int func);
...@@ -182,6 +184,13 @@ static int __init m8xx_ide_init_ports(hw_regs_t *hw, unsigned long data_port) ...@@ -182,6 +184,13 @@ static int __init m8xx_ide_init_ports(hw_regs_t *hw, unsigned long data_port)
pcmcia_phy_base, pcmcia_phy_end, pcmcia_phy_base, pcmcia_phy_end,
pcmcia_phy_end - pcmcia_phy_base); pcmcia_phy_end - pcmcia_phy_base);
if (!request_mem_region(pcmcia_phy_base,
pcmcia_phy_end - pcmcia_phy_base,
DRV_NAME)) {
printk(KERN_ERR "%s: resources busy\n", DRV_NAME);
return -EBUSY;
}
pcmcia_base=(unsigned long)ioremap(pcmcia_phy_base, pcmcia_base=(unsigned long)ioremap(pcmcia_phy_base,
pcmcia_phy_end-pcmcia_phy_base); pcmcia_phy_end-pcmcia_phy_base);
...@@ -327,6 +336,11 @@ static int __init m8xx_ide_init_ports(hw_regs_t *hw, unsigned long data_port) ...@@ -327,6 +336,11 @@ static int __init m8xx_ide_init_ports(hw_regs_t *hw, unsigned long data_port)
ide_phy_base, ide_phy_end, ide_phy_base, ide_phy_end,
ide_phy_end - ide_phy_base); ide_phy_end - ide_phy_base);
if (!request_mem_region(ide_phy_base, 0x200, DRV_NAME)) {
printk(KERN_ERR "%s: resources busy\n", DRV_NAME);
return -EBUSY;
}
ide_base=(unsigned long)ioremap(ide_phy_base, ide_base=(unsigned long)ioremap(ide_phy_base,
ide_phy_end-ide_phy_base); ide_phy_end-ide_phy_base);
...@@ -796,6 +810,7 @@ static int __init mpc8xx_ide_probe(void) ...@@ -796,6 +810,7 @@ static int __init mpc8xx_ide_probe(void)
ide_hwif_t *hwif = &ide_hwifs[0]; ide_hwif_t *hwif = &ide_hwifs[0];
ide_init_port_hw(hwif, &hw); ide_init_port_hw(hwif, &hw);
hwif->mmio = 1;
hwif->pio_mask = ATA_PIO4; hwif->pio_mask = ATA_PIO4;
hwif->set_pio_mode = m8xx_ide_set_pio_mode; hwif->set_pio_mode = m8xx_ide_set_pio_mode;
...@@ -807,6 +822,7 @@ static int __init mpc8xx_ide_probe(void) ...@@ -807,6 +822,7 @@ static int __init mpc8xx_ide_probe(void)
ide_hwif_t *mate = &ide_hwifs[1]; ide_hwif_t *mate = &ide_hwifs[1];
ide_init_port_hw(mate, &hw); ide_init_port_hw(mate, &hw);
mate->mmio = 1;
mate->pio_mask = ATA_PIO4; mate->pio_mask = ATA_PIO4;
mate->set_pio_mode = m8xx_ide_set_pio_mode; mate->set_pio_mode = m8xx_ide_set_pio_mode;
......
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