diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-04-26 11:36:38 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-04-26 11:36:38 -0400 |
commit | 54c05395273678fe23e9169a435fdc15ee17535e (patch) | |
tree | f9b0aba2db2532dc6fedbae8d19171932d1785e8 /drivers | |
parent | cb7500db0e94c61b79712bc081dd90da68a4a40c (diff) |
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: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/ide/ppc/mpc8xx.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/drivers/ide/ppc/mpc8xx.c b/drivers/ide/ppc/mpc8xx.c index 3f8539f1ccd3..467656f06ccc 100644 --- a/drivers/ide/ppc/mpc8xx.c +++ b/drivers/ide/ppc/mpc8xx.c | |||
@@ -36,6 +36,8 @@ | |||
36 | #include <asm/machdep.h> | 36 | #include <asm/machdep.h> |
37 | #include <asm/irq.h> | 37 | #include <asm/irq.h> |
38 | 38 | ||
39 | #define DRV_NAME "ide-mpc8xx" | ||
40 | |||
39 | static int identify (volatile u8 *p); | 41 | static int identify (volatile u8 *p); |
40 | static void print_fixed (volatile u8 *p); | 42 | static void print_fixed (volatile u8 *p); |
41 | static void print_funcid (int func); | 43 | 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 | pcmcia_phy_base, pcmcia_phy_end, | 184 | pcmcia_phy_base, pcmcia_phy_end, |
183 | pcmcia_phy_end - pcmcia_phy_base); | 185 | pcmcia_phy_end - pcmcia_phy_base); |
184 | 186 | ||
187 | if (!request_mem_region(pcmcia_phy_base, | ||
188 | pcmcia_phy_end - pcmcia_phy_base, | ||
189 | DRV_NAME)) { | ||
190 | printk(KERN_ERR "%s: resources busy\n", DRV_NAME); | ||
191 | return -EBUSY; | ||
192 | } | ||
193 | |||
185 | pcmcia_base=(unsigned long)ioremap(pcmcia_phy_base, | 194 | pcmcia_base=(unsigned long)ioremap(pcmcia_phy_base, |
186 | pcmcia_phy_end-pcmcia_phy_base); | 195 | pcmcia_phy_end-pcmcia_phy_base); |
187 | 196 | ||
@@ -326,7 +335,12 @@ static int __init m8xx_ide_init_ports(hw_regs_t *hw, unsigned long data_port) | |||
326 | printk ("IDE phys mem : %08x...%08x (size %08x)\n", | 335 | printk ("IDE phys mem : %08x...%08x (size %08x)\n", |
327 | ide_phy_base, ide_phy_end, | 336 | ide_phy_base, ide_phy_end, |
328 | ide_phy_end - ide_phy_base); | 337 | ide_phy_end - ide_phy_base); |
329 | 338 | ||
339 | if (!request_mem_region(ide_phy_base, 0x200, DRV_NAME)) { | ||
340 | printk(KERN_ERR "%s: resources busy\n", DRV_NAME); | ||
341 | return -EBUSY; | ||
342 | } | ||
343 | |||
330 | ide_base=(unsigned long)ioremap(ide_phy_base, | 344 | ide_base=(unsigned long)ioremap(ide_phy_base, |
331 | ide_phy_end-ide_phy_base); | 345 | ide_phy_end-ide_phy_base); |
332 | 346 | ||
@@ -796,6 +810,7 @@ static int __init mpc8xx_ide_probe(void) | |||
796 | ide_hwif_t *hwif = &ide_hwifs[0]; | 810 | ide_hwif_t *hwif = &ide_hwifs[0]; |
797 | 811 | ||
798 | ide_init_port_hw(hwif, &hw); | 812 | ide_init_port_hw(hwif, &hw); |
813 | hwif->mmio = 1; | ||
799 | hwif->pio_mask = ATA_PIO4; | 814 | hwif->pio_mask = ATA_PIO4; |
800 | hwif->set_pio_mode = m8xx_ide_set_pio_mode; | 815 | hwif->set_pio_mode = m8xx_ide_set_pio_mode; |
801 | 816 | ||
@@ -807,6 +822,7 @@ static int __init mpc8xx_ide_probe(void) | |||
807 | ide_hwif_t *mate = &ide_hwifs[1]; | 822 | ide_hwif_t *mate = &ide_hwifs[1]; |
808 | 823 | ||
809 | ide_init_port_hw(mate, &hw); | 824 | ide_init_port_hw(mate, &hw); |
825 | mate->mmio = 1; | ||
810 | mate->pio_mask = ATA_PIO4; | 826 | mate->pio_mask = ATA_PIO4; |
811 | mate->set_pio_mode = m8xx_ide_set_pio_mode; | 827 | mate->set_pio_mode = m8xx_ide_set_pio_mode; |
812 | 828 | ||