diff options
Diffstat (limited to 'arch/sparc64/kernel/power.c')
-rw-r--r-- | arch/sparc64/kernel/power.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/arch/sparc64/kernel/power.c b/arch/sparc64/kernel/power.c index 30bcaf58e3ab..75159a7843f1 100644 --- a/arch/sparc64/kernel/power.c +++ b/arch/sparc64/kernel/power.c | |||
@@ -105,24 +105,24 @@ again: | |||
105 | return 0; | 105 | return 0; |
106 | } | 106 | } |
107 | 107 | ||
108 | static int __init has_button_interrupt(unsigned int irq, int prom_node) | 108 | static int __init has_button_interrupt(unsigned int irq, struct device_node *dp) |
109 | { | 109 | { |
110 | if (irq == PCI_IRQ_NONE) | 110 | if (irq == PCI_IRQ_NONE) |
111 | return 0; | 111 | return 0; |
112 | if (!prom_node_has_property(prom_node, "button")) | 112 | if (!of_find_property(dp, "button", NULL)) |
113 | return 0; | 113 | return 0; |
114 | 114 | ||
115 | return 1; | 115 | return 1; |
116 | } | 116 | } |
117 | 117 | ||
118 | static int __init power_probe_ebus(struct resource **resp, unsigned int *irq_p, int *prom_node_p) | 118 | static int __init power_probe_ebus(struct resource **resp, unsigned int *irq_p, struct device_node **prom_node_p) |
119 | { | 119 | { |
120 | struct linux_ebus *ebus; | 120 | struct linux_ebus *ebus; |
121 | struct linux_ebus_device *edev; | 121 | struct linux_ebus_device *edev; |
122 | 122 | ||
123 | for_each_ebus(ebus) { | 123 | for_each_ebus(ebus) { |
124 | for_each_ebusdev(edev, ebus) { | 124 | for_each_ebusdev(edev, ebus) { |
125 | if (!strcmp(edev->prom_name, "power")) { | 125 | if (!strcmp(edev->prom_node->name, "power")) { |
126 | *resp = &edev->resource[0]; | 126 | *resp = &edev->resource[0]; |
127 | *irq_p = edev->irqs[0]; | 127 | *irq_p = edev->irqs[0]; |
128 | *prom_node_p = edev->prom_node; | 128 | *prom_node_p = edev->prom_node; |
@@ -133,14 +133,14 @@ static int __init power_probe_ebus(struct resource **resp, unsigned int *irq_p, | |||
133 | return -ENODEV; | 133 | return -ENODEV; |
134 | } | 134 | } |
135 | 135 | ||
136 | static int __init power_probe_isa(struct resource **resp, unsigned int *irq_p, int *prom_node_p) | 136 | static int __init power_probe_isa(struct resource **resp, unsigned int *irq_p, struct device_node **prom_node_p) |
137 | { | 137 | { |
138 | struct sparc_isa_bridge *isa_bus; | 138 | struct sparc_isa_bridge *isa_bus; |
139 | struct sparc_isa_device *isa_dev; | 139 | struct sparc_isa_device *isa_dev; |
140 | 140 | ||
141 | for_each_isa(isa_bus) { | 141 | for_each_isa(isa_bus) { |
142 | for_each_isadev(isa_dev, isa_bus) { | 142 | for_each_isadev(isa_dev, isa_bus) { |
143 | if (!strcmp(isa_dev->prom_name, "power")) { | 143 | if (!strcmp(isa_dev->prom_node->name, "power")) { |
144 | *resp = &isa_dev->resource; | 144 | *resp = &isa_dev->resource; |
145 | *irq_p = isa_dev->irq; | 145 | *irq_p = isa_dev->irq; |
146 | *prom_node_p = isa_dev->prom_node; | 146 | *prom_node_p = isa_dev->prom_node; |
@@ -155,17 +155,17 @@ void __init power_init(void) | |||
155 | { | 155 | { |
156 | struct resource *res = NULL; | 156 | struct resource *res = NULL; |
157 | unsigned int irq; | 157 | unsigned int irq; |
158 | int prom_node; | 158 | struct device_node *dp; |
159 | static int invoked; | 159 | static int invoked; |
160 | 160 | ||
161 | if (invoked) | 161 | if (invoked) |
162 | return; | 162 | return; |
163 | invoked = 1; | 163 | invoked = 1; |
164 | 164 | ||
165 | if (!power_probe_ebus(&res, &irq, &prom_node)) | 165 | if (!power_probe_ebus(&res, &irq, &dp)) |
166 | goto found; | 166 | goto found; |
167 | 167 | ||
168 | if (!power_probe_isa(&res, &irq, &prom_node)) | 168 | if (!power_probe_isa(&res, &irq, &dp)) |
169 | goto found; | 169 | goto found; |
170 | 170 | ||
171 | return; | 171 | return; |
@@ -174,7 +174,7 @@ found: | |||
174 | power_reg = ioremap(res->start, 0x4); | 174 | power_reg = ioremap(res->start, 0x4); |
175 | printk("power: Control reg at %p ... ", power_reg); | 175 | printk("power: Control reg at %p ... ", power_reg); |
176 | poweroff_method = machine_halt; /* able to use the standard halt */ | 176 | poweroff_method = machine_halt; /* able to use the standard halt */ |
177 | if (has_button_interrupt(irq, prom_node)) { | 177 | if (has_button_interrupt(irq, dp)) { |
178 | if (kernel_thread(powerd, NULL, CLONE_FS) < 0) { | 178 | if (kernel_thread(powerd, NULL, CLONE_FS) < 0) { |
179 | printk("Failed to start power daemon.\n"); | 179 | printk("Failed to start power daemon.\n"); |
180 | return; | 180 | return; |