aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/macintosh/macio_asic.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/drivers/macintosh/macio_asic.c b/drivers/macintosh/macio_asic.c
index f14c744a94ef..0137ff239f13 100644
--- a/drivers/macintosh/macio_asic.c
+++ b/drivers/macintosh/macio_asic.c
@@ -332,18 +332,14 @@ static void macio_setup_resources(struct macio_dev *dev,
332 struct resource *parent_res) 332 struct resource *parent_res)
333{ 333{
334 struct device_node *np = dev->ofdev.node; 334 struct device_node *np = dev->ofdev.node;
335 u32 *addr; 335 struct resource r;
336 u64 size;
337 int index; 336 int index;
338 337
339 for (index = 0; (addr = of_get_address(np, index, &size)) != NULL; 338 for (index = 0; of_address_to_resource(np, index, &r) == 0; index++) {
340 index++) {
341 struct resource *res = &dev->resource[index]; 339 struct resource *res = &dev->resource[index];
342 if (index >= MACIO_DEV_COUNT_RESOURCES) 340 if (index >= MACIO_DEV_COUNT_RESOURCES)
343 break; 341 break;
344 res->start = of_translate_address(np, addr); 342 *res = r;
345 res->end = res->start + (unsigned long)size - 1;
346 res->flags = IORESOURCE_MEM;
347 res->name = dev->ofdev.dev.bus_id; 343 res->name = dev->ofdev.dev.bus_id;
348 344
349 if (macio_resource_quirks(np, res, index)) { 345 if (macio_resource_quirks(np, res, index)) {
@@ -353,7 +349,7 @@ static void macio_setup_resources(struct macio_dev *dev,
353 /* Currently, we consider failure as harmless, this may 349 /* Currently, we consider failure as harmless, this may
354 * change in the future, once I've found all the device 350 * change in the future, once I've found all the device
355 * tree bugs in older machines & worked around them 351 * tree bugs in older machines & worked around them
356 */ 352l */
357 if (insert_resource(parent_res, res)) { 353 if (insert_resource(parent_res, res)) {
358 printk(KERN_WARNING "Can't request resource " 354 printk(KERN_WARNING "Can't request resource "
359 "%d for MacIO device %s\n", 355 "%d for MacIO device %s\n",