aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc64/kernel/isa.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@sunset.davemloft.net>2006-06-23 04:44:10 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2006-06-24 02:15:43 -0400
commita2bd4fd17926d715a470fbe0ebe05128ba410984 (patch)
tree3e39a2f6aaf3a628b955067ef3668cae3456de03 /arch/sparc64/kernel/isa.c
parent8cd24ed4f8031636fb5dacb04adee9e02556ecd5 (diff)
[SPARC64]: Add of_device layer and make ebus/isa use it.
Sparcspkr and power drivers are converted, to make sure it works. Eventually the SBUS device layer will use this as a sub-class. I really cannot cut loose on that bit until sparc32 is given the same infrastructure. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc64/kernel/isa.c')
-rw-r--r--arch/sparc64/kernel/isa.c37
1 files changed, 33 insertions, 4 deletions
diff --git a/arch/sparc64/kernel/isa.c b/arch/sparc64/kernel/isa.c
index 2693f2de549c..6f16dee280a8 100644
--- a/arch/sparc64/kernel/isa.c
+++ b/arch/sparc64/kernel/isa.c
@@ -195,12 +195,25 @@ static void __init isa_fill_devices(struct sparc_isa_bridge *isa_br)
195 195
196 isa_dev = kmalloc(sizeof(*isa_dev), GFP_KERNEL); 196 isa_dev = kmalloc(sizeof(*isa_dev), GFP_KERNEL);
197 if (!isa_dev) { 197 if (!isa_dev) {
198 fatal_err("cannot allocate isa_dev"); 198 printk(KERN_DEBUG "ISA: cannot allocate isa_dev");
199 prom_halt(); 199 return;
200 } 200 }
201 201
202 memset(isa_dev, 0, sizeof(*isa_dev)); 202 memset(isa_dev, 0, sizeof(*isa_dev));
203 203
204 isa_dev->ofdev.node = dp;
205 isa_dev->ofdev.dev.parent = &isa_br->ofdev.dev;
206 isa_dev->ofdev.dev.bus = &isa_bus_type;
207 strcpy(isa_dev->ofdev.dev.bus_id, dp->path_component_name);
208
209 /* Register with core */
210 if (of_device_register(&isa_dev->ofdev) != 0) {
211 printk(KERN_DEBUG "isa: device registration error for %s!\n",
212 isa_dev->ofdev.dev.bus_id);
213 kfree(isa_dev);
214 goto next_sibling;
215 }
216
204 /* Link it in. */ 217 /* Link it in. */
205 isa_dev->next = NULL; 218 isa_dev->next = NULL;
206 if (isa_br->devices == NULL) { 219 if (isa_br->devices == NULL) {
@@ -226,6 +239,7 @@ static void __init isa_fill_devices(struct sparc_isa_bridge *isa_br)
226 239
227 printk("]"); 240 printk("]");
228 241
242 next_sibling:
229 dp = dp->sibling; 243 dp = dp->sibling;
230 } 244 }
231} 245}
@@ -244,6 +258,7 @@ void __init isa_init(void)
244 struct pcidev_cookie *pdev_cookie; 258 struct pcidev_cookie *pdev_cookie;
245 struct pci_pbm_info *pbm; 259 struct pci_pbm_info *pbm;
246 struct sparc_isa_bridge *isa_br; 260 struct sparc_isa_bridge *isa_br;
261 struct device_node *dp;
247 262
248 pdev_cookie = pdev->sysdata; 263 pdev_cookie = pdev->sysdata;
249 if (!pdev_cookie) { 264 if (!pdev_cookie) {
@@ -252,15 +267,29 @@ void __init isa_init(void)
252 continue; 267 continue;
253 } 268 }
254 pbm = pdev_cookie->pbm; 269 pbm = pdev_cookie->pbm;
270 dp = pdev_cookie->prom_node;
255 271
256 isa_br = kmalloc(sizeof(*isa_br), GFP_KERNEL); 272 isa_br = kmalloc(sizeof(*isa_br), GFP_KERNEL);
257 if (!isa_br) { 273 if (!isa_br) {
258 fatal_err("cannot allocate sparc_isa_bridge"); 274 printk(KERN_DEBUG "isa: cannot allocate sparc_isa_bridge");
259 prom_halt(); 275 return;
260 } 276 }
261 277
262 memset(isa_br, 0, sizeof(*isa_br)); 278 memset(isa_br, 0, sizeof(*isa_br));
263 279
280 isa_br->ofdev.node = dp;
281 isa_br->ofdev.dev.parent = &pdev->dev;
282 isa_br->ofdev.dev.bus = &isa_bus_type;
283 strcpy(isa_br->ofdev.dev.bus_id, dp->path_component_name);
284
285 /* Register with core */
286 if (of_device_register(&isa_br->ofdev) != 0) {
287 printk(KERN_DEBUG "isa: device registration error for %s!\n",
288 isa_br->ofdev.dev.bus_id);
289 kfree(isa_br);
290 return;
291 }
292
264 /* Link it in. */ 293 /* Link it in. */
265 isa_br->next = isa_chain; 294 isa_br->next = isa_chain;
266 isa_chain = isa_br; 295 isa_chain = isa_br;