aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-04-26 16:25:18 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-04-26 16:25:18 -0400
commitd92f1a2829dbe29c644569a3b64a021e4d90005d (patch)
tree8390de547df80777f575f633d9a6d2512e4478db /drivers/ide
parentd9b819a025ca1b09dafbe90b5d25ba57a639f048 (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')
-rw-r--r--drivers/ide/ide-probe.c14
-rw-r--r--drivers/ide/legacy/ali14xx.c3
-rw-r--r--drivers/ide/legacy/dtc2278.c3
-rw-r--r--drivers/ide/legacy/ht6560b.c1
-rw-r--r--drivers/ide/legacy/qd65xx.c3
-rw-r--r--drivers/ide/legacy/umc8672.c3
6 files changed, 27 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,
1648 irq = 15; 1648 irq = 15;
1649 } 1649 }
1650 1650
1651 if (!request_region(base, 8, d->name)) {
1652 printk(KERN_ERR "%s: I/O resource 0x%lX-0x%lX not free.\n",
1653 d->name, base, base + 7);
1654 return;
1655 }
1656
1657 if (!request_region(ctl, 1, d->name)) {
1658 printk(KERN_ERR "%s: I/O resource 0x%lX not free.\n",
1659 d->name, ctl);
1660 release_region(base, 8);
1661 return;
1662 }
1663
1651 ide_std_init_ports(hw, base, ctl); 1664 ide_std_init_ports(hw, base, ctl);
1652 hw->irq = irq; 1665 hw->irq = irq;
1653 1666
1654 hwif = ide_find_port_slot(d); 1667 hwif = ide_find_port_slot(d);
1655 if (hwif) { 1668 if (hwif) {
1656 ide_init_port_hw(hwif, hw); 1669 ide_init_port_hw(hwif, hw);
1670 hwif->mmio = 1;
1657 if (config) 1671 if (config)
1658 hwif->config_data = config; 1672 hwif->config_data = config;
1659 idx[port_no] = hwif->index; 1673 idx[port_no] = hwif->index;
diff --git a/drivers/ide/legacy/ali14xx.c b/drivers/ide/legacy/ali14xx.c
index 7bfb28edf511..6efbf947c6db 100644
--- a/drivers/ide/legacy/ali14xx.c
+++ b/drivers/ide/legacy/ali14xx.c
@@ -49,6 +49,8 @@
49 49
50#include <asm/io.h> 50#include <asm/io.h>
51 51
52#define DRV_NAME "ali14xx"
53
52/* port addresses for auto-detection */ 54/* port addresses for auto-detection */
53#define ALI_NUM_PORTS 4 55#define ALI_NUM_PORTS 4
54static const int ports[ALI_NUM_PORTS] __initdata = 56static const int ports[ALI_NUM_PORTS] __initdata =
@@ -197,6 +199,7 @@ static const struct ide_port_ops ali14xx_port_ops = {
197}; 199};
198 200
199static const struct ide_port_info ali14xx_port_info = { 201static const struct ide_port_info ali14xx_port_info = {
202 .name = DRV_NAME,
200 .chipset = ide_ali14xx, 203 .chipset = ide_ali14xx,
201 .port_ops = &ali14xx_port_ops, 204 .port_ops = &ali14xx_port_ops,
202 .host_flags = IDE_HFLAG_NO_DMA | IDE_HFLAG_NO_AUTOTUNE, 205 .host_flags = IDE_HFLAG_NO_DMA | IDE_HFLAG_NO_AUTOTUNE,
diff --git a/drivers/ide/legacy/dtc2278.c b/drivers/ide/legacy/dtc2278.c
index 7b5585c1c4c0..f7c4ad1c57c0 100644
--- a/drivers/ide/legacy/dtc2278.c
+++ b/drivers/ide/legacy/dtc2278.c
@@ -16,6 +16,8 @@
16 16
17#include <asm/io.h> 17#include <asm/io.h>
18 18
19#define DRV_NAME "dtc2278"
20
19/* 21/*
20 * Changing this #undef to #define may solve start up problems in some systems. 22 * Changing this #undef to #define may solve start up problems in some systems.
21 */ 23 */
@@ -91,6 +93,7 @@ static const struct ide_port_ops dtc2278_port_ops = {
91}; 93};
92 94
93static const struct ide_port_info dtc2278_port_info __initdata = { 95static const struct ide_port_info dtc2278_port_info __initdata = {
96 .name = DRV_NAME,
94 .chipset = ide_dtc2278, 97 .chipset = ide_dtc2278,
95 .port_ops = &dtc2278_port_ops, 98 .port_ops = &dtc2278_port_ops,
96 .host_flags = IDE_HFLAG_SERIALIZE | 99 .host_flags = IDE_HFLAG_SERIALIZE |
diff --git a/drivers/ide/legacy/ht6560b.c b/drivers/ide/legacy/ht6560b.c
index 558964fc994e..971960ee7c03 100644
--- a/drivers/ide/legacy/ht6560b.c
+++ b/drivers/ide/legacy/ht6560b.c
@@ -335,6 +335,7 @@ static const struct ide_port_ops ht6560b_port_ops = {
335}; 335};
336 336
337static const struct ide_port_info ht6560b_port_info __initdata = { 337static const struct ide_port_info ht6560b_port_info __initdata = {
338 .name = DRV_NAME,
338 .chipset = ide_ht6560b, 339 .chipset = ide_ht6560b,
339 .port_ops = &ht6560b_port_ops, 340 .port_ops = &ht6560b_port_ops,
340 .host_flags = IDE_HFLAG_SERIALIZE | /* is this needed? */ 341 .host_flags = IDE_HFLAG_SERIALIZE | /* is this needed? */
diff --git a/drivers/ide/legacy/qd65xx.c b/drivers/ide/legacy/qd65xx.c
index 336ef20407f4..15a99aae0cf9 100644
--- a/drivers/ide/legacy/qd65xx.c
+++ b/drivers/ide/legacy/qd65xx.c
@@ -37,6 +37,8 @@
37#include <asm/system.h> 37#include <asm/system.h>
38#include <asm/io.h> 38#include <asm/io.h>
39 39
40#define DRV_NAME "qd65xx"
41
40#include "qd65xx.h" 42#include "qd65xx.h"
41 43
42/* 44/*
@@ -317,6 +319,7 @@ static const struct ide_port_ops qd6580_port_ops = {
317}; 319};
318 320
319static const struct ide_port_info qd65xx_port_info __initdata = { 321static const struct ide_port_info qd65xx_port_info __initdata = {
322 .name = DRV_NAME,
320 .chipset = ide_qd65xx, 323 .chipset = ide_qd65xx,
321 .host_flags = IDE_HFLAG_IO_32BIT | 324 .host_flags = IDE_HFLAG_IO_32BIT |
322 IDE_HFLAG_NO_DMA | 325 IDE_HFLAG_NO_DMA |
diff --git a/drivers/ide/legacy/umc8672.c b/drivers/ide/legacy/umc8672.c
index 95c643a2228a..17d515329fe0 100644
--- a/drivers/ide/legacy/umc8672.c
+++ b/drivers/ide/legacy/umc8672.c
@@ -51,6 +51,8 @@
51 51
52#include <asm/io.h> 52#include <asm/io.h>
53 53
54#define DRV_NAME "umc8672"
55
54/* 56/*
55 * Default speeds. These can be changed with "auto-tune" and/or hdparm. 57 * Default speeds. These can be changed with "auto-tune" and/or hdparm.
56 */ 58 */
@@ -125,6 +127,7 @@ static const struct ide_port_ops umc8672_port_ops = {
125}; 127};
126 128
127static const struct ide_port_info umc8672_port_info __initdata = { 129static const struct ide_port_info umc8672_port_info __initdata = {
130 .name = DRV_NAME,
128 .chipset = ide_umc8672, 131 .chipset = ide_umc8672,
129 .port_ops = &umc8672_port_ops, 132 .port_ops = &umc8672_port_ops,
130 .host_flags = IDE_HFLAG_NO_DMA | IDE_HFLAG_NO_AUTOTUNE, 133 .host_flags = IDE_HFLAG_NO_DMA | IDE_HFLAG_NO_AUTOTUNE,