aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/macintosh
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/macintosh')
-rw-r--r--drivers/macintosh/macio_asic.c24
-rw-r--r--drivers/macintosh/therm_adt746x.c8
2 files changed, 16 insertions, 16 deletions
diff --git a/drivers/macintosh/macio_asic.c b/drivers/macintosh/macio_asic.c
index ec9e5f32f0ae..6e149f4a1fff 100644
--- a/drivers/macintosh/macio_asic.c
+++ b/drivers/macintosh/macio_asic.c
@@ -33,7 +33,7 @@
33 33
34#undef DEBUG 34#undef DEBUG
35 35
36#define MAX_NODE_NAME_SIZE (BUS_ID_SIZE - 12) 36#define MAX_NODE_NAME_SIZE (20 - 12)
37 37
38static struct macio_chip *macio_on_hold; 38static struct macio_chip *macio_on_hold;
39 39
@@ -240,7 +240,7 @@ static void macio_create_fixup_irq(struct macio_dev *dev, int index,
240 if (irq != NO_IRQ) { 240 if (irq != NO_IRQ) {
241 dev->interrupt[index].start = irq; 241 dev->interrupt[index].start = irq;
242 dev->interrupt[index].flags = IORESOURCE_IRQ; 242 dev->interrupt[index].flags = IORESOURCE_IRQ;
243 dev->interrupt[index].name = dev->ofdev.dev.bus_id; 243 dev->interrupt[index].name = dev_name(&dev->ofdev.dev);
244 } 244 }
245 if (dev->n_interrupts <= index) 245 if (dev->n_interrupts <= index)
246 dev->n_interrupts = index + 1; 246 dev->n_interrupts = index + 1;
@@ -303,7 +303,7 @@ static void macio_setup_interrupts(struct macio_dev *dev)
303 break; 303 break;
304 res->start = irq; 304 res->start = irq;
305 res->flags = IORESOURCE_IRQ; 305 res->flags = IORESOURCE_IRQ;
306 res->name = dev->ofdev.dev.bus_id; 306 res->name = dev_name(&dev->ofdev.dev);
307 if (macio_resource_quirks(np, res, i - 1)) { 307 if (macio_resource_quirks(np, res, i - 1)) {
308 memset(res, 0, sizeof(struct resource)); 308 memset(res, 0, sizeof(struct resource));
309 continue; 309 continue;
@@ -325,7 +325,7 @@ static void macio_setup_resources(struct macio_dev *dev,
325 if (index >= MACIO_DEV_COUNT_RESOURCES) 325 if (index >= MACIO_DEV_COUNT_RESOURCES)
326 break; 326 break;
327 *res = r; 327 *res = r;
328 res->name = dev->ofdev.dev.bus_id; 328 res->name = dev_name(&dev->ofdev.dev);
329 329
330 if (macio_resource_quirks(np, res, index)) { 330 if (macio_resource_quirks(np, res, index)) {
331 memset(res, 0, sizeof(struct resource)); 331 memset(res, 0, sizeof(struct resource));
@@ -338,7 +338,7 @@ static void macio_setup_resources(struct macio_dev *dev,
338 if (insert_resource(parent_res, res)) { 338 if (insert_resource(parent_res, res)) {
339 printk(KERN_WARNING "Can't request resource " 339 printk(KERN_WARNING "Can't request resource "
340 "%d for MacIO device %s\n", 340 "%d for MacIO device %s\n",
341 index, dev->ofdev.dev.bus_id); 341 index, dev_name(&dev->ofdev.dev));
342 } 342 }
343 } 343 }
344 dev->n_resources = index; 344 dev->n_resources = index;
@@ -385,8 +385,8 @@ static struct macio_dev * macio_add_one_device(struct macio_chip *chip,
385 385
386 /* MacIO itself has a different reg, we use it's PCI base */ 386 /* MacIO itself has a different reg, we use it's PCI base */
387 if (np == chip->of_node) { 387 if (np == chip->of_node) {
388 sprintf(dev->ofdev.dev.bus_id, "%1d.%08x:%.*s", 388 dev_set_name(&dev->ofdev.dev, "%1d.%08x:%.*s",
389 chip->lbus.index, 389 chip->lbus.index,
390#ifdef CONFIG_PCI 390#ifdef CONFIG_PCI
391 (unsigned int)pci_resource_start(chip->lbus.pdev, 0), 391 (unsigned int)pci_resource_start(chip->lbus.pdev, 0),
392#else 392#else
@@ -395,9 +395,9 @@ static struct macio_dev * macio_add_one_device(struct macio_chip *chip,
395 MAX_NODE_NAME_SIZE, np->name); 395 MAX_NODE_NAME_SIZE, np->name);
396 } else { 396 } else {
397 reg = of_get_property(np, "reg", NULL); 397 reg = of_get_property(np, "reg", NULL);
398 sprintf(dev->ofdev.dev.bus_id, "%1d.%08x:%.*s", 398 dev_set_name(&dev->ofdev.dev, "%1d.%08x:%.*s",
399 chip->lbus.index, 399 chip->lbus.index,
400 reg ? *reg : 0, MAX_NODE_NAME_SIZE, np->name); 400 reg ? *reg : 0, MAX_NODE_NAME_SIZE, np->name);
401 } 401 }
402 402
403 /* Setup interrupts & resources */ 403 /* Setup interrupts & resources */
@@ -408,7 +408,7 @@ static struct macio_dev * macio_add_one_device(struct macio_chip *chip,
408 /* Register with core */ 408 /* Register with core */
409 if (of_device_register(&dev->ofdev) != 0) { 409 if (of_device_register(&dev->ofdev) != 0) {
410 printk(KERN_DEBUG"macio: device registration error for %s!\n", 410 printk(KERN_DEBUG"macio: device registration error for %s!\n",
411 dev->ofdev.dev.bus_id); 411 dev_name(&dev->ofdev.dev));
412 kfree(dev); 412 kfree(dev);
413 return NULL; 413 return NULL;
414 } 414 }
@@ -558,7 +558,7 @@ err_out:
558 resource_no, 558 resource_no,
559 macio_resource_len(dev, resource_no), 559 macio_resource_len(dev, resource_no),
560 macio_resource_start(dev, resource_no), 560 macio_resource_start(dev, resource_no),
561 dev->ofdev.dev.bus_id); 561 dev_name(&dev->ofdev.dev));
562 return -EBUSY; 562 return -EBUSY;
563} 563}
564 564
diff --git a/drivers/macintosh/therm_adt746x.c b/drivers/macintosh/therm_adt746x.c
index 22bf981d393b..82607add69a9 100644
--- a/drivers/macintosh/therm_adt746x.c
+++ b/drivers/macintosh/therm_adt746x.c
@@ -554,7 +554,7 @@ thermostat_init(void)
554 const u32 *prop; 554 const u32 *prop;
555 int i = 0, offset = 0; 555 int i = 0, offset = 0;
556 int err; 556 int err;
557 557
558 np = of_find_node_by_name(NULL, "fan"); 558 np = of_find_node_by_name(NULL, "fan");
559 if (!np) 559 if (!np)
560 return -ENODEV; 560 return -ENODEV;
@@ -613,13 +613,13 @@ thermostat_init(void)
613 } 613 }
614 614
615 of_dev = of_platform_device_create(np, "temperatures", NULL); 615 of_dev = of_platform_device_create(np, "temperatures", NULL);
616 616 of_node_put(np);
617
617 if (of_dev == NULL) { 618 if (of_dev == NULL) {
618 printk(KERN_ERR "Can't register temperatures device !\n"); 619 printk(KERN_ERR "Can't register temperatures device !\n");
619 of_node_put(np);
620 return -ENODEV; 620 return -ENODEV;
621 } 621 }
622 622
623 err = device_create_file(&of_dev->dev, &dev_attr_sensor1_temperature); 623 err = device_create_file(&of_dev->dev, &dev_attr_sensor1_temperature);
624 err |= device_create_file(&of_dev->dev, &dev_attr_sensor2_temperature); 624 err |= device_create_file(&of_dev->dev, &dev_attr_sensor2_temperature);
625 err |= device_create_file(&of_dev->dev, &dev_attr_sensor1_limit); 625 err |= device_create_file(&of_dev->dev, &dev_attr_sensor1_limit);