aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/swim3.c
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2005-12-13 02:01:21 -0500
committerPaul Mackerras <paulus@samba.org>2006-01-08 22:53:55 -0500
commitcc5d0189b9ba95260857a5018a1c2fef90008507 (patch)
tree1202c94b6b3cb81a96d0a0e54424cad10eef68bb /drivers/block/swim3.c
parent9cf84d7c97992dbe5360b241327341c07ce30fc9 (diff)
[PATCH] powerpc: Remove device_node addrs/n_addr
The pre-parsed addrs/n_addrs fields in struct device_node are finally gone. Remove the dodgy heuristics that did that parsing at boot and remove the fields themselves since we now have a good replacement with the new OF parsing code. This patch also fixes a bunch of drivers to use the new code instead, so that at least pmac32, pseries, iseries and g5 defconfigs build. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'drivers/block/swim3.c')
-rw-r--r--drivers/block/swim3.c38
1 files changed, 23 insertions, 15 deletions
diff --git a/drivers/block/swim3.c b/drivers/block/swim3.c
index af7cb2bfd670..01f042f6f1c4 100644
--- a/drivers/block/swim3.c
+++ b/drivers/block/swim3.c
@@ -1083,23 +1083,33 @@ static int swim3_add_device(struct device_node *swim)
1083{ 1083{
1084 struct device_node *mediabay; 1084 struct device_node *mediabay;
1085 struct floppy_state *fs = &floppy_states[floppy_count]; 1085 struct floppy_state *fs = &floppy_states[floppy_count];
1086 struct resource res_reg, res_dma;
1086 1087
1087 if (swim->n_addrs < 2) 1088 if (of_address_to_resource(swim, 0, &res_reg) ||
1088 { 1089 of_address_to_resource(swim, 1, &res_dma)) {
1089 printk(KERN_INFO "swim3: expecting 2 addrs (n_addrs:%d, n_intrs:%d)\n", 1090 printk(KERN_ERR "swim3: Can't get addresses\n");
1090 swim->n_addrs, swim->n_intrs);
1091 return -EINVAL; 1091 return -EINVAL;
1092 } 1092 }
1093 1093 if (request_mem_region(res_reg.start, res_reg.end - res_reg.start + 1,
1094 if (swim->n_intrs < 2) 1094 " (reg)") == NULL) {
1095 { 1095 printk(KERN_ERR "swim3: Can't request register space\n");
1096 printk(KERN_INFO "swim3: expecting 2 intrs (n_addrs:%d, n_intrs:%d)\n", 1096 return -EINVAL;
1097 swim->n_addrs, swim->n_intrs); 1097 }
1098 if (request_mem_region(res_dma.start, res_dma.end - res_dma.start + 1,
1099 " (dma)") == NULL) {
1100 release_mem_region(res_reg.start,
1101 res_reg.end - res_reg.start + 1);
1102 printk(KERN_ERR "swim3: Can't request DMA space\n");
1098 return -EINVAL; 1103 return -EINVAL;
1099 } 1104 }
1100 1105
1101 if (!request_OF_resource(swim, 0, NULL)) { 1106 if (swim->n_intrs < 2) {
1102 printk(KERN_INFO "swim3: can't request IO resource !\n"); 1107 printk(KERN_INFO "swim3: expecting 2 intrs (n_intrs:%d)\n",
1108 swim->n_intrs);
1109 release_mem_region(res_reg.start,
1110 res_reg.end - res_reg.start + 1);
1111 release_mem_region(res_dma.start,
1112 res_dma.end - res_dma.start + 1);
1103 return -EINVAL; 1113 return -EINVAL;
1104 } 1114 }
1105 1115
@@ -1110,10 +1120,8 @@ static int swim3_add_device(struct device_node *swim)
1110 memset(fs, 0, sizeof(*fs)); 1120 memset(fs, 0, sizeof(*fs));
1111 spin_lock_init(&fs->lock); 1121 spin_lock_init(&fs->lock);
1112 fs->state = idle; 1122 fs->state = idle;
1113 fs->swim3 = (struct swim3 __iomem *) 1123 fs->swim3 = (struct swim3 __iomem *)ioremap(res_reg.start, 0x200);
1114 ioremap(swim->addrs[0].address, 0x200); 1124 fs->dma = (struct dbdma_regs __iomem *)ioremap(res_dma.start, 0x200);
1115 fs->dma = (struct dbdma_regs __iomem *)
1116 ioremap(swim->addrs[1].address, 0x200);
1117 fs->swim3_intr = swim->intrs[0].line; 1125 fs->swim3_intr = swim->intrs[0].line;
1118 fs->dma_intr = swim->intrs[1].line; 1126 fs->dma_intr = swim->intrs[1].line;
1119 fs->cur_cyl = -1; 1127 fs->cur_cyl = -1;