aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/macintosh
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/macintosh')
-rw-r--r--drivers/macintosh/ans-lcd.c9
-rw-r--r--drivers/macintosh/via-pmu.c4
2 files changed, 8 insertions, 5 deletions
diff --git a/drivers/macintosh/ans-lcd.c b/drivers/macintosh/ans-lcd.c
index cdd5a0f72e3c..e54c4d9f6365 100644
--- a/drivers/macintosh/ans-lcd.c
+++ b/drivers/macintosh/ans-lcd.c
@@ -145,11 +145,12 @@ anslcd_init(void)
145 int retval; 145 int retval;
146 struct device_node* node; 146 struct device_node* node;
147 147
148 node = find_devices("lcd"); 148 node = of_find_node_by_name(NULL, "lcd");
149 if (!node || !node->parent) 149 if (!node || !node->parent || strcmp(node->parent->name, "gc")) {
150 return -ENODEV; 150 of_node_put(node);
151 if (strcmp(node->parent->name, "gc"))
152 return -ENODEV; 151 return -ENODEV;
152 }
153 of_node_put(node);
153 154
154 anslcd_ptr = ioremap(ANSLCD_ADDR, 0x20); 155 anslcd_ptr = ioremap(ANSLCD_ADDR, 0x20);
155 156
diff --git a/drivers/macintosh/via-pmu.c b/drivers/macintosh/via-pmu.c
index 7b7db5db50dc..e31cb1e7a47b 100644
--- a/drivers/macintosh/via-pmu.c
+++ b/drivers/macintosh/via-pmu.c
@@ -487,7 +487,8 @@ static int __init via_pmu_dev_init(void)
487 pmu_batteries[0].flags |= PMU_BATT_TYPE_SMART; 487 pmu_batteries[0].flags |= PMU_BATT_TYPE_SMART;
488 pmu_batteries[1].flags |= PMU_BATT_TYPE_SMART; 488 pmu_batteries[1].flags |= PMU_BATT_TYPE_SMART;
489 } else { 489 } else {
490 struct device_node* prim = find_devices("power-mgt"); 490 struct device_node* prim =
491 of_find_node_by_name(NULL, "power-mgt");
491 const u32 *prim_info = NULL; 492 const u32 *prim_info = NULL;
492 if (prim) 493 if (prim)
493 prim_info = of_get_property(prim, "prim-info", NULL); 494 prim_info = of_get_property(prim, "prim-info", NULL);
@@ -498,6 +499,7 @@ static int __init via_pmu_dev_init(void)
498 if (pmu_battery_count > 1) 499 if (pmu_battery_count > 1)
499 pmu_batteries[1].flags |= PMU_BATT_TYPE_SMART; 500 pmu_batteries[1].flags |= PMU_BATT_TYPE_SMART;
500 } 501 }
502 of_node_put(prim);
501 } 503 }
502#endif /* CONFIG_PPC32 */ 504#endif /* CONFIG_PPC32 */
503 505