diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-04-30 11:10:12 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-04-30 11:10:12 -0400 |
commit | 24a77daf3d80bddcece044e6dc3675e427eef3f3 (patch) | |
tree | 2c5e0b0bea394d6fe62c5d5857c252e83e48ac48 /drivers | |
parent | e389f9aec689209724105ae80a6c91fd2e747bc9 (diff) | |
parent | f900e9777fc9b65140cb9570438597bc8fae56ab (diff) |
Merge branch 'for-2.6.22' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc
* 'for-2.6.22' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc: (255 commits)
[POWERPC] Remove dev_dbg redefinition in drivers/ps3/vuart.c
[POWERPC] remove kernel module option for booke wdt
[POWERPC] Avoid putting cpu node twice
[POWERPC] Spinlock initializer cleanup
[POWERPC] ppc4xx_sgdma needs dma-mapping.h
[POWERPC] arch/powerpc/sysdev/timer.c build fix
[POWERPC] get_property cleanups
[POWERPC] Remove the unused HTDMSOUND driver
[POWERPC] cell: cbe_cpufreq cleanup and crash fix
[POWERPC] Declare enable_kernel_spe in a header
[POWERPC] Add dt_xlate_addr() to bootwrapper
[POWERPC] bootwrapper: CONFIG_ -> CONFIG_DEVICE_TREE
[POWERPC] Don't define a custom bd_t for Xilixn Virtex based boards.
[POWERPC] Add sane defaults for Xilinx EDK generated xparameters files
[POWERPC] Add uartlite boot console driver for the zImage wrapper
[POWERPC] Stop using ppc_sys for Xilinx Virtex boards
[POWERPC] New registration for common Xilinx Virtex ppc405 platform devices
[POWERPC] Merge common virtex header files
[POWERPC] Rework Kconfig dependancies for Xilinx Virtex ppc405 platform
[POWERPC] Clean up cpufreq Kconfig dependencies
...
Diffstat (limited to 'drivers')
40 files changed, 175 insertions, 280 deletions
diff --git a/drivers/char/briq_panel.c b/drivers/char/briq_panel.c index 8dcf9d20f449..c70d52ace8b2 100644 --- a/drivers/char/briq_panel.c +++ b/drivers/char/briq_panel.c | |||
@@ -202,13 +202,16 @@ static struct miscdevice briq_panel_miscdev = { | |||
202 | 202 | ||
203 | static int __init briq_panel_init(void) | 203 | static int __init briq_panel_init(void) |
204 | { | 204 | { |
205 | struct device_node *root = find_path_device("/"); | 205 | struct device_node *root = of_find_node_by_path("/"); |
206 | const char *machine; | 206 | const char *machine; |
207 | int i; | 207 | int i; |
208 | 208 | ||
209 | machine = get_property(root, "model", NULL); | 209 | machine = get_property(root, "model", NULL); |
210 | if (!machine || strncmp(machine, "TotalImpact,BRIQ-1", 18) != 0) | 210 | if (!machine || strncmp(machine, "TotalImpact,BRIQ-1", 18) != 0) { |
211 | of_node_put(root); | ||
211 | return -ENODEV; | 212 | return -ENODEV; |
213 | } | ||
214 | of_node_put(root); | ||
212 | 215 | ||
213 | printk(KERN_INFO | 216 | printk(KERN_INFO |
214 | "briq_panel: v%s Dr. Karsten Jeppesen (kj@totalimpact.com)\n", | 217 | "briq_panel: v%s Dr. Karsten Jeppesen (kj@totalimpact.com)\n", |
diff --git a/drivers/char/hvc_console.c b/drivers/char/hvc_console.c index a0a88aa23f5b..0f9ed7b46a6d 100644 --- a/drivers/char/hvc_console.c +++ b/drivers/char/hvc_console.c | |||
@@ -47,8 +47,6 @@ | |||
47 | #define HVC_MAJOR 229 | 47 | #define HVC_MAJOR 229 |
48 | #define HVC_MINOR 0 | 48 | #define HVC_MINOR 0 |
49 | 49 | ||
50 | #define TIMEOUT (10) | ||
51 | |||
52 | /* | 50 | /* |
53 | * Wait this long per iteration while trying to push buffered data to the | 51 | * Wait this long per iteration while trying to push buffered data to the |
54 | * hypervisor before allowing the tty to complete a close operation. | 52 | * hypervisor before allowing the tty to complete a close operation. |
@@ -104,12 +102,12 @@ static DEFINE_SPINLOCK(hvc_structs_lock); | |||
104 | /* | 102 | /* |
105 | * This value is used to assign a tty->index value to a hvc_struct based | 103 | * This value is used to assign a tty->index value to a hvc_struct based |
106 | * upon order of exposure via hvc_probe(), when we can not match it to | 104 | * upon order of exposure via hvc_probe(), when we can not match it to |
107 | * a console canidate registered with hvc_instantiate(). | 105 | * a console candidate registered with hvc_instantiate(). |
108 | */ | 106 | */ |
109 | static int last_hvc = -1; | 107 | static int last_hvc = -1; |
110 | 108 | ||
111 | /* | 109 | /* |
112 | * Do not call this function with either the hvc_strucst_lock or the hvc_struct | 110 | * Do not call this function with either the hvc_structs_lock or the hvc_struct |
113 | * lock held. If successful, this function increments the kobject reference | 111 | * lock held. If successful, this function increments the kobject reference |
114 | * count against the target hvc_struct so it should be released when finished. | 112 | * count against the target hvc_struct so it should be released when finished. |
115 | */ | 113 | */ |
@@ -162,7 +160,7 @@ void hvc_console_print(struct console *co, const char *b, unsigned count) | |||
162 | if (index >= MAX_NR_HVC_CONSOLES) | 160 | if (index >= MAX_NR_HVC_CONSOLES) |
163 | return; | 161 | return; |
164 | 162 | ||
165 | /* This console adapter was removed so it is not useable. */ | 163 | /* This console adapter was removed so it is not usable. */ |
166 | if (vtermnos[index] < 0) | 164 | if (vtermnos[index] < 0) |
167 | return; | 165 | return; |
168 | 166 | ||
@@ -220,7 +218,7 @@ struct console hvc_con_driver = { | |||
220 | }; | 218 | }; |
221 | 219 | ||
222 | /* | 220 | /* |
223 | * Early console initialization. Preceeds driver initialization. | 221 | * Early console initialization. Precedes driver initialization. |
224 | * | 222 | * |
225 | * (1) we are first, and the user specified another driver | 223 | * (1) we are first, and the user specified another driver |
226 | * -- index will remain -1 | 224 | * -- index will remain -1 |
@@ -257,7 +255,7 @@ int hvc_instantiate(uint32_t vtermno, int index, struct hv_ops *ops) | |||
257 | if (vtermnos[index] != -1) | 255 | if (vtermnos[index] != -1) |
258 | return -1; | 256 | return -1; |
259 | 257 | ||
260 | /* make sure no no tty has been registerd in this index */ | 258 | /* make sure no no tty has been registered in this index */ |
261 | hp = hvc_get_by_index(index); | 259 | hp = hvc_get_by_index(index); |
262 | if (hp) { | 260 | if (hp) { |
263 | kobject_put(&hp->kobj); | 261 | kobject_put(&hp->kobj); |
@@ -267,7 +265,7 @@ int hvc_instantiate(uint32_t vtermno, int index, struct hv_ops *ops) | |||
267 | vtermnos[index] = vtermno; | 265 | vtermnos[index] = vtermno; |
268 | cons_ops[index] = ops; | 266 | cons_ops[index] = ops; |
269 | 267 | ||
270 | /* reserve all indices upto and including this index */ | 268 | /* reserve all indices up to and including this index */ |
271 | if (last_hvc < index) | 269 | if (last_hvc < index) |
272 | last_hvc = index; | 270 | last_hvc = index; |
273 | 271 | ||
@@ -528,7 +526,7 @@ static int hvc_write(struct tty_struct *tty, const unsigned char *buf, int count | |||
528 | 526 | ||
529 | /* | 527 | /* |
530 | * This is actually a contract between the driver and the tty layer outlining | 528 | * This is actually a contract between the driver and the tty layer outlining |
531 | * how much write room the driver can guarentee will be sent OR BUFFERED. This | 529 | * how much write room the driver can guarantee will be sent OR BUFFERED. This |
532 | * driver MUST honor the return value. | 530 | * driver MUST honor the return value. |
533 | */ | 531 | */ |
534 | static int hvc_write_room(struct tty_struct *tty) | 532 | static int hvc_write_room(struct tty_struct *tty) |
@@ -550,6 +548,18 @@ static int hvc_chars_in_buffer(struct tty_struct *tty) | |||
550 | return hp->n_outbuf; | 548 | return hp->n_outbuf; |
551 | } | 549 | } |
552 | 550 | ||
551 | /* | ||
552 | * timeout will vary between the MIN and MAX values defined here. By default | ||
553 | * and during console activity we will use a default MIN_TIMEOUT of 10. When | ||
554 | * the console is idle, we increase the timeout value on each pass through | ||
555 | * msleep until we reach the max. This may be noticeable as a brief (average | ||
556 | * one second) delay on the console before the console responds to input when | ||
557 | * there has been no input for some time. | ||
558 | */ | ||
559 | #define MIN_TIMEOUT (10) | ||
560 | #define MAX_TIMEOUT (2000) | ||
561 | static u32 timeout = MIN_TIMEOUT; | ||
562 | |||
553 | #define HVC_POLL_READ 0x00000001 | 563 | #define HVC_POLL_READ 0x00000001 |
554 | #define HVC_POLL_WRITE 0x00000002 | 564 | #define HVC_POLL_WRITE 0x00000002 |
555 | 565 | ||
@@ -642,9 +652,14 @@ static int hvc_poll(struct hvc_struct *hp) | |||
642 | bail: | 652 | bail: |
643 | spin_unlock_irqrestore(&hp->lock, flags); | 653 | spin_unlock_irqrestore(&hp->lock, flags); |
644 | 654 | ||
645 | if (read_total) | 655 | if (read_total) { |
656 | /* Activity is occurring, so reset the polling backoff value to | ||
657 | a minimum for performance. */ | ||
658 | timeout = MIN_TIMEOUT; | ||
659 | |||
646 | tty_flip_buffer_push(tty); | 660 | tty_flip_buffer_push(tty); |
647 | 661 | } | |
662 | |||
648 | return poll_mask; | 663 | return poll_mask; |
649 | } | 664 | } |
650 | 665 | ||
@@ -688,8 +703,12 @@ int khvcd(void *unused) | |||
688 | if (!hvc_kicked) { | 703 | if (!hvc_kicked) { |
689 | if (poll_mask == 0) | 704 | if (poll_mask == 0) |
690 | schedule(); | 705 | schedule(); |
691 | else | 706 | else { |
692 | msleep_interruptible(TIMEOUT); | 707 | if (timeout < MAX_TIMEOUT) |
708 | timeout += (timeout >> 6) + 1; | ||
709 | |||
710 | msleep_interruptible(timeout); | ||
711 | } | ||
693 | } | 712 | } |
694 | __set_current_state(TASK_RUNNING); | 713 | __set_current_state(TASK_RUNNING); |
695 | } while (!kthread_should_stop()); | 714 | } while (!kthread_should_stop()); |
@@ -794,7 +813,7 @@ int __devexit hvc_remove(struct hvc_struct *hp) | |||
794 | 813 | ||
795 | /* | 814 | /* |
796 | * We 'put' the instance that was grabbed when the kobject instance | 815 | * We 'put' the instance that was grabbed when the kobject instance |
797 | * was intialized using kobject_init(). Let the last holder of this | 816 | * was initialized using kobject_init(). Let the last holder of this |
798 | * kobject cause it to be removed, which will probably be the tty_hangup | 817 | * kobject cause it to be removed, which will probably be the tty_hangup |
799 | * below. | 818 | * below. |
800 | */ | 819 | */ |
@@ -850,7 +869,7 @@ int __init hvc_init(void) | |||
850 | } | 869 | } |
851 | module_init(hvc_init); | 870 | module_init(hvc_init); |
852 | 871 | ||
853 | /* This isn't particularily necessary due to this being a console driver | 872 | /* This isn't particularly necessary due to this being a console driver |
854 | * but it is nice to be thorough. | 873 | * but it is nice to be thorough. |
855 | */ | 874 | */ |
856 | static void __exit hvc_exit(void) | 875 | static void __exit hvc_exit(void) |
diff --git a/drivers/char/hvc_iseries.c b/drivers/char/hvc_iseries.c index f144a947bd17..ec420fe8a908 100644 --- a/drivers/char/hvc_iseries.c +++ b/drivers/char/hvc_iseries.c | |||
@@ -575,7 +575,7 @@ static int hvc_find_vtys(void) | |||
575 | (num_found >= VTTY_PORTS)) | 575 | (num_found >= VTTY_PORTS)) |
576 | break; | 576 | break; |
577 | 577 | ||
578 | vtermno = get_property(vty, "reg", NULL); | 578 | vtermno = of_get_property(vty, "reg", NULL); |
579 | if (!vtermno) | 579 | if (!vtermno) |
580 | continue; | 580 | continue; |
581 | 581 | ||
diff --git a/drivers/char/hvc_vio.c b/drivers/char/hvc_vio.c index f9c00844d2bf..94a542e20efb 100644 --- a/drivers/char/hvc_vio.c +++ b/drivers/char/hvc_vio.c | |||
@@ -153,7 +153,7 @@ static int hvc_find_vtys(void) | |||
153 | if (num_found >= MAX_NR_HVC_CONSOLES) | 153 | if (num_found >= MAX_NR_HVC_CONSOLES) |
154 | break; | 154 | break; |
155 | 155 | ||
156 | vtermno = get_property(vty, "reg", NULL); | 156 | vtermno = of_get_property(vty, "reg", NULL); |
157 | if (!vtermno) | 157 | if (!vtermno) |
158 | continue; | 158 | continue; |
159 | 159 | ||
diff --git a/drivers/char/hvsi.c b/drivers/char/hvsi.c index 50315d6364fd..d5a752da322f 100644 --- a/drivers/char/hvsi.c +++ b/drivers/char/hvsi.c | |||
@@ -1279,8 +1279,8 @@ static int __init hvsi_console_init(void) | |||
1279 | struct hvsi_struct *hp; | 1279 | struct hvsi_struct *hp; |
1280 | const uint32_t *vtermno, *irq; | 1280 | const uint32_t *vtermno, *irq; |
1281 | 1281 | ||
1282 | vtermno = get_property(vty, "reg", NULL); | 1282 | vtermno = of_get_property(vty, "reg", NULL); |
1283 | irq = get_property(vty, "interrupts", NULL); | 1283 | irq = of_get_property(vty, "interrupts", NULL); |
1284 | if (!vtermno || !irq) | 1284 | if (!vtermno || !irq) |
1285 | continue; | 1285 | continue; |
1286 | 1286 | ||
diff --git a/drivers/char/tpm/tpm_atmel.h b/drivers/char/tpm/tpm_atmel.h index aefd683c60b7..3c852009196e 100644 --- a/drivers/char/tpm/tpm_atmel.h +++ b/drivers/char/tpm/tpm_atmel.h | |||
@@ -53,8 +53,8 @@ static void __iomem * atmel_get_base_addr(unsigned long *base, int *region_size) | |||
53 | } | 53 | } |
54 | 54 | ||
55 | reg = get_property(dn, "reg", ®len); | 55 | reg = get_property(dn, "reg", ®len); |
56 | naddrc = prom_n_addr_cells(dn); | 56 | naddrc = of_n_addr_cells(dn); |
57 | nsizec = prom_n_size_cells(dn); | 57 | nsizec = of_n_size_cells(dn); |
58 | 58 | ||
59 | of_node_put(dn); | 59 | of_node_put(dn); |
60 | 60 | ||
diff --git a/drivers/char/watchdog/Kconfig b/drivers/char/watchdog/Kconfig index e812aa129e28..60198a78974c 100644 --- a/drivers/char/watchdog/Kconfig +++ b/drivers/char/watchdog/Kconfig | |||
@@ -548,7 +548,7 @@ config MV64X60_WDT | |||
548 | depends on WATCHDOG && MV64X60 | 548 | depends on WATCHDOG && MV64X60 |
549 | 549 | ||
550 | config BOOKE_WDT | 550 | config BOOKE_WDT |
551 | tristate "PowerPC Book-E Watchdog Timer" | 551 | bool "PowerPC Book-E Watchdog Timer" |
552 | depends on WATCHDOG && (BOOKE || 4xx) | 552 | depends on WATCHDOG && (BOOKE || 4xx) |
553 | ---help--- | 553 | ---help--- |
554 | Please see Documentation/watchdog/watchdog-api.txt for | 554 | Please see Documentation/watchdog/watchdog-api.txt for |
diff --git a/drivers/hwmon/ams/ams-core.c b/drivers/hwmon/ams/ams-core.c index f1f0f5d0442c..f5ebad561412 100644 --- a/drivers/hwmon/ams/ams-core.c +++ b/drivers/hwmon/ams/ams-core.c | |||
@@ -141,10 +141,10 @@ static void ams_worker(struct work_struct *work) | |||
141 | int ams_sensor_attach(void) | 141 | int ams_sensor_attach(void) |
142 | { | 142 | { |
143 | int result; | 143 | int result; |
144 | u32 *prop; | 144 | const u32 *prop; |
145 | 145 | ||
146 | /* Get orientation */ | 146 | /* Get orientation */ |
147 | prop = (u32*)get_property(ams_info.of_node, "orientation", NULL); | 147 | prop = get_property(ams_info.of_node, "orientation", NULL); |
148 | if (!prop) | 148 | if (!prop) |
149 | return -ENODEV; | 149 | return -ENODEV; |
150 | ams_info.orient1 = *prop; | 150 | ams_info.orient1 = *prop; |
diff --git a/drivers/hwmon/ams/ams-i2c.c b/drivers/hwmon/ams/ams-i2c.c index 0d24bdfea53e..485d333bcb3e 100644 --- a/drivers/hwmon/ams/ams-i2c.c +++ b/drivers/hwmon/ams/ams-i2c.c | |||
@@ -263,7 +263,7 @@ int __init ams_i2c_init(struct device_node *np) | |||
263 | { | 263 | { |
264 | char *tmp_bus; | 264 | char *tmp_bus; |
265 | int result; | 265 | int result; |
266 | u32 *prop; | 266 | const u32 *prop; |
267 | 267 | ||
268 | mutex_lock(&ams_info.lock); | 268 | mutex_lock(&ams_info.lock); |
269 | 269 | ||
@@ -276,7 +276,7 @@ int __init ams_i2c_init(struct device_node *np) | |||
276 | ams_info.bustype = BUS_I2C; | 276 | ams_info.bustype = BUS_I2C; |
277 | 277 | ||
278 | /* look for bus either using "reg" or by path */ | 278 | /* look for bus either using "reg" or by path */ |
279 | prop = (u32*)get_property(ams_info.of_node, "reg", NULL); | 279 | prop = get_property(ams_info.of_node, "reg", NULL); |
280 | if (!prop) { | 280 | if (!prop) { |
281 | result = -ENODEV; | 281 | result = -ENODEV; |
282 | 282 | ||
diff --git a/drivers/hwmon/ams/ams-pmu.c b/drivers/hwmon/ams/ams-pmu.c index 4636ae031a53..1b01c215bfe7 100644 --- a/drivers/hwmon/ams/ams-pmu.c +++ b/drivers/hwmon/ams/ams-pmu.c | |||
@@ -146,7 +146,7 @@ static void ams_pmu_exit(void) | |||
146 | 146 | ||
147 | int __init ams_pmu_init(struct device_node *np) | 147 | int __init ams_pmu_init(struct device_node *np) |
148 | { | 148 | { |
149 | u32 *prop; | 149 | const u32 *prop; |
150 | int result; | 150 | int result; |
151 | 151 | ||
152 | mutex_lock(&ams_info.lock); | 152 | mutex_lock(&ams_info.lock); |
@@ -160,7 +160,7 @@ int __init ams_pmu_init(struct device_node *np) | |||
160 | ams_info.bustype = BUS_HOST; | 160 | ams_info.bustype = BUS_HOST; |
161 | 161 | ||
162 | /* Get PMU command, should be 0x4e, but we can never know */ | 162 | /* Get PMU command, should be 0x4e, but we can never know */ |
163 | prop = (u32*)get_property(ams_info.of_node, "reg", NULL); | 163 | prop = get_property(ams_info.of_node, "reg", NULL); |
164 | if (!prop) { | 164 | if (!prop) { |
165 | result = -ENODEV; | 165 | result = -ENODEV; |
166 | goto exit; | 166 | goto exit; |
diff --git a/drivers/infiniband/hw/ehca/ehca_main.c b/drivers/infiniband/hw/ehca/ehca_main.c index 3b23d677cb86..4700085ba834 100644 --- a/drivers/infiniband/hw/ehca/ehca_main.c +++ b/drivers/infiniband/hw/ehca/ehca_main.c | |||
@@ -565,11 +565,11 @@ static int __devinit ehca_probe(struct ibmebus_dev *dev, | |||
565 | const struct of_device_id *id) | 565 | const struct of_device_id *id) |
566 | { | 566 | { |
567 | struct ehca_shca *shca; | 567 | struct ehca_shca *shca; |
568 | u64 *handle; | 568 | const u64 *handle; |
569 | struct ib_pd *ibpd; | 569 | struct ib_pd *ibpd; |
570 | int ret; | 570 | int ret; |
571 | 571 | ||
572 | handle = (u64 *)get_property(dev->ofdev.node, "ibm,hca-handle", NULL); | 572 | handle = get_property(dev->ofdev.node, "ibm,hca-handle", NULL); |
573 | if (!handle) { | 573 | if (!handle) { |
574 | ehca_gen_err("Cannot get eHCA handle for adapter: %s.", | 574 | ehca_gen_err("Cannot get eHCA handle for adapter: %s.", |
575 | dev->ofdev.node->full_name); | 575 | dev->ofdev.node->full_name); |
diff --git a/drivers/macintosh/adb.c b/drivers/macintosh/adb.c index f729eebf771f..adfea3c7c62a 100644 --- a/drivers/macintosh/adb.c +++ b/drivers/macintosh/adb.c | |||
@@ -90,7 +90,7 @@ static int autopoll_devs; | |||
90 | int __adb_probe_sync; | 90 | int __adb_probe_sync; |
91 | 91 | ||
92 | #ifdef CONFIG_PM | 92 | #ifdef CONFIG_PM |
93 | static int adb_notify_sleep(struct pmu_sleep_notifier *self, int when); | 93 | static void adb_notify_sleep(struct pmu_sleep_notifier *self, int when); |
94 | static struct pmu_sleep_notifier adb_sleep_notifier = { | 94 | static struct pmu_sleep_notifier adb_sleep_notifier = { |
95 | adb_notify_sleep, | 95 | adb_notify_sleep, |
96 | SLEEP_LEVEL_ADB, | 96 | SLEEP_LEVEL_ADB, |
@@ -340,11 +340,9 @@ __initcall(adb_init); | |||
340 | /* | 340 | /* |
341 | * notify clients before sleep and reset bus afterwards | 341 | * notify clients before sleep and reset bus afterwards |
342 | */ | 342 | */ |
343 | int | 343 | void |
344 | adb_notify_sleep(struct pmu_sleep_notifier *self, int when) | 344 | adb_notify_sleep(struct pmu_sleep_notifier *self, int when) |
345 | { | 345 | { |
346 | int ret; | ||
347 | |||
348 | switch (when) { | 346 | switch (when) { |
349 | case PBOOK_SLEEP_REQUEST: | 347 | case PBOOK_SLEEP_REQUEST: |
350 | adb_got_sleep = 1; | 348 | adb_got_sleep = 1; |
@@ -353,22 +351,8 @@ adb_notify_sleep(struct pmu_sleep_notifier *self, int when) | |||
353 | /* Stop autopoll */ | 351 | /* Stop autopoll */ |
354 | if (adb_controller->autopoll) | 352 | if (adb_controller->autopoll) |
355 | adb_controller->autopoll(0); | 353 | adb_controller->autopoll(0); |
356 | ret = blocking_notifier_call_chain(&adb_client_list, | 354 | blocking_notifier_call_chain(&adb_client_list, |
357 | ADB_MSG_POWERDOWN, NULL); | 355 | ADB_MSG_POWERDOWN, NULL); |
358 | if (ret & NOTIFY_STOP_MASK) { | ||
359 | up(&adb_probe_mutex); | ||
360 | return PBOOK_SLEEP_REFUSE; | ||
361 | } | ||
362 | break; | ||
363 | case PBOOK_SLEEP_REJECT: | ||
364 | if (adb_got_sleep) { | ||
365 | adb_got_sleep = 0; | ||
366 | up(&adb_probe_mutex); | ||
367 | adb_reset_bus(); | ||
368 | } | ||
369 | break; | ||
370 | |||
371 | case PBOOK_SLEEP_NOW: | ||
372 | break; | 356 | break; |
373 | case PBOOK_WAKE: | 357 | case PBOOK_WAKE: |
374 | adb_got_sleep = 0; | 358 | adb_got_sleep = 0; |
@@ -376,14 +360,13 @@ adb_notify_sleep(struct pmu_sleep_notifier *self, int when) | |||
376 | adb_reset_bus(); | 360 | adb_reset_bus(); |
377 | break; | 361 | break; |
378 | } | 362 | } |
379 | return PBOOK_SLEEP_OK; | ||
380 | } | 363 | } |
381 | #endif /* CONFIG_PM */ | 364 | #endif /* CONFIG_PM */ |
382 | 365 | ||
383 | static int | 366 | static int |
384 | do_adb_reset_bus(void) | 367 | do_adb_reset_bus(void) |
385 | { | 368 | { |
386 | int ret, nret; | 369 | int ret; |
387 | 370 | ||
388 | if (adb_controller == NULL) | 371 | if (adb_controller == NULL) |
389 | return -ENXIO; | 372 | return -ENXIO; |
@@ -391,13 +374,8 @@ do_adb_reset_bus(void) | |||
391 | if (adb_controller->autopoll) | 374 | if (adb_controller->autopoll) |
392 | adb_controller->autopoll(0); | 375 | adb_controller->autopoll(0); |
393 | 376 | ||
394 | nret = blocking_notifier_call_chain(&adb_client_list, | 377 | blocking_notifier_call_chain(&adb_client_list, |
395 | ADB_MSG_PRE_RESET, NULL); | 378 | ADB_MSG_PRE_RESET, NULL); |
396 | if (nret & NOTIFY_STOP_MASK) { | ||
397 | if (adb_controller->autopoll) | ||
398 | adb_controller->autopoll(autopoll_devs); | ||
399 | return -EBUSY; | ||
400 | } | ||
401 | 379 | ||
402 | if (sleepy_trackpad) { | 380 | if (sleepy_trackpad) { |
403 | /* Let the trackpad settle down */ | 381 | /* Let the trackpad settle down */ |
@@ -427,10 +405,8 @@ do_adb_reset_bus(void) | |||
427 | } | 405 | } |
428 | up(&adb_handler_sem); | 406 | up(&adb_handler_sem); |
429 | 407 | ||
430 | nret = blocking_notifier_call_chain(&adb_client_list, | 408 | blocking_notifier_call_chain(&adb_client_list, |
431 | ADB_MSG_POST_RESET, NULL); | 409 | ADB_MSG_POST_RESET, NULL); |
432 | if (nret & NOTIFY_STOP_MASK) | ||
433 | return -EBUSY; | ||
434 | 410 | ||
435 | return ret; | 411 | return ret; |
436 | } | 412 | } |
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/apm_emu.c b/drivers/macintosh/apm_emu.c index c5e4d43f97fc..cdb0bead9917 100644 --- a/drivers/macintosh/apm_emu.c +++ b/drivers/macintosh/apm_emu.c | |||
@@ -96,7 +96,7 @@ static DECLARE_WAIT_QUEUE_HEAD(apm_waitqueue); | |||
96 | static DECLARE_WAIT_QUEUE_HEAD(apm_suspend_waitqueue); | 96 | static DECLARE_WAIT_QUEUE_HEAD(apm_suspend_waitqueue); |
97 | static struct apm_user * user_list; | 97 | static struct apm_user * user_list; |
98 | 98 | ||
99 | static int apm_notify_sleep(struct pmu_sleep_notifier *self, int when); | 99 | static void apm_notify_sleep(struct pmu_sleep_notifier *self, int when); |
100 | static struct pmu_sleep_notifier apm_sleep_notifier = { | 100 | static struct pmu_sleep_notifier apm_sleep_notifier = { |
101 | apm_notify_sleep, | 101 | apm_notify_sleep, |
102 | SLEEP_LEVEL_USERLAND, | 102 | SLEEP_LEVEL_USERLAND, |
@@ -352,7 +352,7 @@ static int do_open(struct inode * inode, struct file * filp) | |||
352 | * doesn't provide a way to NAK, but this could be added | 352 | * doesn't provide a way to NAK, but this could be added |
353 | * here. | 353 | * here. |
354 | */ | 354 | */ |
355 | static int wait_all_suspend(void) | 355 | static void wait_all_suspend(void) |
356 | { | 356 | { |
357 | DECLARE_WAITQUEUE(wait, current); | 357 | DECLARE_WAITQUEUE(wait, current); |
358 | 358 | ||
@@ -366,24 +366,19 @@ static int wait_all_suspend(void) | |||
366 | remove_wait_queue(&apm_suspend_waitqueue, &wait); | 366 | remove_wait_queue(&apm_suspend_waitqueue, &wait); |
367 | 367 | ||
368 | DBG("apm_emu: wait_all_suspend() - complete !\n"); | 368 | DBG("apm_emu: wait_all_suspend() - complete !\n"); |
369 | |||
370 | return 1; | ||
371 | } | 369 | } |
372 | 370 | ||
373 | static int apm_notify_sleep(struct pmu_sleep_notifier *self, int when) | 371 | static void apm_notify_sleep(struct pmu_sleep_notifier *self, int when) |
374 | { | 372 | { |
375 | switch(when) { | 373 | switch(when) { |
376 | case PBOOK_SLEEP_REQUEST: | 374 | case PBOOK_SLEEP_REQUEST: |
377 | queue_event(APM_SYS_SUSPEND, NULL); | 375 | queue_event(APM_SYS_SUSPEND, NULL); |
378 | if (!wait_all_suspend()) | 376 | wait_all_suspend(); |
379 | return PBOOK_SLEEP_REFUSE; | ||
380 | break; | 377 | break; |
381 | case PBOOK_SLEEP_REJECT: | ||
382 | case PBOOK_WAKE: | 378 | case PBOOK_WAKE: |
383 | queue_event(APM_NORMAL_RESUME, NULL); | 379 | queue_event(APM_NORMAL_RESUME, NULL); |
384 | break; | 380 | break; |
385 | } | 381 | } |
386 | return PBOOK_SLEEP_OK; | ||
387 | } | 382 | } |
388 | 383 | ||
389 | #define APM_CRITICAL 10 | 384 | #define APM_CRITICAL 10 |
diff --git a/drivers/macintosh/mac_hid.c b/drivers/macintosh/mac_hid.c index c1fd816e9f09..1599dc34f15f 100644 --- a/drivers/macintosh/mac_hid.c +++ b/drivers/macintosh/mac_hid.c | |||
@@ -102,8 +102,6 @@ int mac_hid_mouse_emulate_buttons(int caller, unsigned int keycode, int down) | |||
102 | return 0; | 102 | return 0; |
103 | } | 103 | } |
104 | 104 | ||
105 | EXPORT_SYMBOL(mac_hid_mouse_emulate_buttons); | ||
106 | |||
107 | static int emumousebtn_input_register(void) | 105 | static int emumousebtn_input_register(void) |
108 | { | 106 | { |
109 | int ret; | 107 | int ret; |
diff --git a/drivers/macintosh/macio-adb.c b/drivers/macintosh/macio-adb.c index 026b67f4f659..79119f56e82d 100644 --- a/drivers/macintosh/macio-adb.c +++ b/drivers/macintosh/macio-adb.c | |||
@@ -82,7 +82,14 @@ struct adb_driver macio_adb_driver = { | |||
82 | 82 | ||
83 | int macio_probe(void) | 83 | int macio_probe(void) |
84 | { | 84 | { |
85 | return find_compatible_devices("adb", "chrp,adb0")? 0: -ENODEV; | 85 | struct device_node *np; |
86 | |||
87 | np = of_find_compatible_node(NULL, "adb", "chrp,adb0"); | ||
88 | if (np) { | ||
89 | of_node_put(np); | ||
90 | return 0; | ||
91 | } | ||
92 | return -ENODEV; | ||
86 | } | 93 | } |
87 | 94 | ||
88 | int macio_init(void) | 95 | int macio_init(void) |
@@ -91,12 +98,14 @@ int macio_init(void) | |||
91 | struct resource r; | 98 | struct resource r; |
92 | unsigned int irq; | 99 | unsigned int irq; |
93 | 100 | ||
94 | adbs = find_compatible_devices("adb", "chrp,adb0"); | 101 | adbs = of_find_compatible_node(NULL, "adb", "chrp,adb0"); |
95 | if (adbs == 0) | 102 | if (adbs == 0) |
96 | return -ENXIO; | 103 | return -ENXIO; |
97 | 104 | ||
98 | if (of_address_to_resource(adbs, 0, &r)) | 105 | if (of_address_to_resource(adbs, 0, &r)) { |
106 | of_node_put(adbs); | ||
99 | return -ENXIO; | 107 | return -ENXIO; |
108 | } | ||
100 | adb = ioremap(r.start, sizeof(struct adb_regs)); | 109 | adb = ioremap(r.start, sizeof(struct adb_regs)); |
101 | 110 | ||
102 | out_8(&adb->ctrl.r, 0); | 111 | out_8(&adb->ctrl.r, 0); |
@@ -107,6 +116,7 @@ int macio_init(void) | |||
107 | out_8(&adb->autopoll.r, APE); | 116 | out_8(&adb->autopoll.r, APE); |
108 | 117 | ||
109 | irq = irq_of_parse_and_map(adbs, 0); | 118 | irq = irq_of_parse_and_map(adbs, 0); |
119 | of_node_put(adbs); | ||
110 | if (request_irq(irq, macio_adb_interrupt, 0, "ADB", (void *)0)) { | 120 | if (request_irq(irq, macio_adb_interrupt, 0, "ADB", (void *)0)) { |
111 | printk(KERN_ERR "ADB: can't get irq %d\n", irq); | 121 | printk(KERN_ERR "ADB: can't get irq %d\n", irq); |
112 | return -EAGAIN; | 122 | return -EAGAIN; |
diff --git a/drivers/macintosh/macio_asic.c b/drivers/macintosh/macio_asic.c index d56216067549..c96b7fe882a4 100644 --- a/drivers/macintosh/macio_asic.c +++ b/drivers/macintosh/macio_asic.c | |||
@@ -134,108 +134,12 @@ static int macio_device_resume(struct device * dev) | |||
134 | return 0; | 134 | return 0; |
135 | } | 135 | } |
136 | 136 | ||
137 | static int macio_uevent(struct device *dev, char **envp, int num_envp, | ||
138 | char *buffer, int buffer_size) | ||
139 | { | ||
140 | struct macio_dev * macio_dev; | ||
141 | struct of_device * of; | ||
142 | char *scratch; | ||
143 | const char *compat, *compat2; | ||
144 | |||
145 | int i = 0; | ||
146 | int length, cplen, cplen2, seen = 0; | ||
147 | |||
148 | if (!dev) | ||
149 | return -ENODEV; | ||
150 | |||
151 | macio_dev = to_macio_device(dev); | ||
152 | if (!macio_dev) | ||
153 | return -ENODEV; | ||
154 | |||
155 | of = &macio_dev->ofdev; | ||
156 | |||
157 | /* stuff we want to pass to /sbin/hotplug */ | ||
158 | envp[i++] = scratch = buffer; | ||
159 | length = scnprintf (scratch, buffer_size, "OF_NAME=%s", of->node->name); | ||
160 | ++length; | ||
161 | buffer_size -= length; | ||
162 | if ((buffer_size <= 0) || (i >= num_envp)) | ||
163 | return -ENOMEM; | ||
164 | scratch += length; | ||
165 | |||
166 | envp[i++] = scratch; | ||
167 | length = scnprintf (scratch, buffer_size, "OF_TYPE=%s", of->node->type); | ||
168 | ++length; | ||
169 | buffer_size -= length; | ||
170 | if ((buffer_size <= 0) || (i >= num_envp)) | ||
171 | return -ENOMEM; | ||
172 | scratch += length; | ||
173 | |||
174 | /* Since the compatible field can contain pretty much anything | ||
175 | * it's not really legal to split it out with commas. We split it | ||
176 | * up using a number of environment variables instead. */ | ||
177 | |||
178 | compat = get_property(of->node, "compatible", &cplen); | ||
179 | compat2 = compat; | ||
180 | cplen2= cplen; | ||
181 | while (compat && cplen > 0) { | ||
182 | envp[i++] = scratch; | ||
183 | length = scnprintf (scratch, buffer_size, | ||
184 | "OF_COMPATIBLE_%d=%s", seen, compat); | ||
185 | ++length; | ||
186 | buffer_size -= length; | ||
187 | if ((buffer_size <= 0) || (i >= num_envp)) | ||
188 | return -ENOMEM; | ||
189 | scratch += length; | ||
190 | length = strlen (compat) + 1; | ||
191 | compat += length; | ||
192 | cplen -= length; | ||
193 | seen++; | ||
194 | } | ||
195 | |||
196 | envp[i++] = scratch; | ||
197 | length = scnprintf (scratch, buffer_size, "OF_COMPATIBLE_N=%d", seen); | ||
198 | ++length; | ||
199 | buffer_size -= length; | ||
200 | if ((buffer_size <= 0) || (i >= num_envp)) | ||
201 | return -ENOMEM; | ||
202 | scratch += length; | ||
203 | |||
204 | envp[i++] = scratch; | ||
205 | length = scnprintf (scratch, buffer_size, "MODALIAS=of:N%sT%s", | ||
206 | of->node->name, of->node->type); | ||
207 | /* overwrite '\0' */ | ||
208 | buffer_size -= length; | ||
209 | if ((buffer_size <= 0) || (i >= num_envp)) | ||
210 | return -ENOMEM; | ||
211 | scratch += length; | ||
212 | |||
213 | if (!compat2) { | ||
214 | compat2 = ""; | ||
215 | cplen2 = 1; | ||
216 | } | ||
217 | while (cplen2 > 0) { | ||
218 | length = snprintf (scratch, buffer_size, "C%s", compat2); | ||
219 | buffer_size -= length; | ||
220 | if (buffer_size <= 0) | ||
221 | return -ENOMEM; | ||
222 | scratch += length; | ||
223 | length = strlen (compat2) + 1; | ||
224 | compat2 += length; | ||
225 | cplen2 -= length; | ||
226 | } | ||
227 | |||
228 | envp[i] = NULL; | ||
229 | |||
230 | return 0; | ||
231 | } | ||
232 | |||
233 | extern struct device_attribute macio_dev_attrs[]; | 137 | extern struct device_attribute macio_dev_attrs[]; |
234 | 138 | ||
235 | struct bus_type macio_bus_type = { | 139 | struct bus_type macio_bus_type = { |
236 | .name = "macio", | 140 | .name = "macio", |
237 | .match = macio_bus_match, | 141 | .match = macio_bus_match, |
238 | .uevent = macio_uevent, | 142 | .uevent = of_device_uevent, |
239 | .probe = macio_device_probe, | 143 | .probe = macio_device_probe, |
240 | .remove = macio_device_remove, | 144 | .remove = macio_device_remove, |
241 | .shutdown = macio_device_shutdown, | 145 | .shutdown = macio_device_shutdown, |
@@ -491,7 +395,7 @@ static struct macio_dev * macio_add_one_device(struct macio_chip *chip, | |||
491 | #endif | 395 | #endif |
492 | MAX_NODE_NAME_SIZE, np->name); | 396 | MAX_NODE_NAME_SIZE, np->name); |
493 | } else { | 397 | } else { |
494 | reg = get_property(np, "reg", NULL); | 398 | reg = of_get_property(np, "reg", NULL); |
495 | sprintf(dev->ofdev.dev.bus_id, "%1d.%08x:%.*s", | 399 | sprintf(dev->ofdev.dev.bus_id, "%1d.%08x:%.*s", |
496 | chip->lbus.index, | 400 | chip->lbus.index, |
497 | reg ? *reg : 0, MAX_NODE_NAME_SIZE, np->name); | 401 | reg ? *reg : 0, MAX_NODE_NAME_SIZE, np->name); |
diff --git a/drivers/macintosh/macio_sysfs.c b/drivers/macintosh/macio_sysfs.c index 8566bdfdd4b8..cc8267912656 100644 --- a/drivers/macintosh/macio_sysfs.c +++ b/drivers/macintosh/macio_sysfs.c | |||
@@ -21,7 +21,7 @@ compatible_show (struct device *dev, struct device_attribute *attr, char *buf) | |||
21 | int length = 0; | 21 | int length = 0; |
22 | 22 | ||
23 | of = &to_macio_device (dev)->ofdev; | 23 | of = &to_macio_device (dev)->ofdev; |
24 | compat = get_property(of->node, "compatible", &cplen); | 24 | compat = of_get_property(of->node, "compatible", &cplen); |
25 | if (!compat) { | 25 | if (!compat) { |
26 | *buf = '\0'; | 26 | *buf = '\0'; |
27 | return 0; | 27 | return 0; |
@@ -47,18 +47,20 @@ static ssize_t modalias_show (struct device *dev, struct device_attribute *attr, | |||
47 | int length; | 47 | int length; |
48 | 48 | ||
49 | of = &to_macio_device (dev)->ofdev; | 49 | of = &to_macio_device (dev)->ofdev; |
50 | compat = get_property(of->node, "compatible", &cplen); | 50 | compat = of_get_property(of->node, "compatible", &cplen); |
51 | if (!compat) compat = "", cplen = 1; | 51 | if (!compat) compat = "", cplen = 1; |
52 | length = sprintf (buf, "of:N%sT%s", of->node->name, of->node->type); | 52 | length = sprintf (buf, "of:N%sT%s", of->node->name, of->node->type); |
53 | buf += length; | 53 | buf += length; |
54 | while (cplen > 0) { | 54 | while (cplen > 0) { |
55 | int l; | 55 | int l; |
56 | length += sprintf (buf, "C%s", compat); | 56 | l = sprintf (buf, "C%s", compat); |
57 | buf += length; | 57 | length += l; |
58 | buf += l; | ||
58 | l = strlen (compat) + 1; | 59 | l = strlen (compat) + 1; |
59 | compat += l; | 60 | compat += l; |
60 | cplen -= l; | 61 | cplen -= l; |
61 | } | 62 | } |
63 | length += sprintf(buf, "\n"); | ||
62 | 64 | ||
63 | return length; | 65 | return length; |
64 | } | 66 | } |
diff --git a/drivers/macintosh/rack-meter.c b/drivers/macintosh/rack-meter.c index f83fad2a3ff4..4177ff004753 100644 --- a/drivers/macintosh/rack-meter.c +++ b/drivers/macintosh/rack-meter.c | |||
@@ -387,7 +387,7 @@ static int __devinit rackmeter_probe(struct macio_dev* mdev, | |||
387 | if (strcmp(np->name, "lightshow") == 0) | 387 | if (strcmp(np->name, "lightshow") == 0) |
388 | break; | 388 | break; |
389 | if ((strcmp(np->name, "sound") == 0) && | 389 | if ((strcmp(np->name, "sound") == 0) && |
390 | get_property(np, "virtual", NULL) != NULL) | 390 | of_get_property(np, "virtual", NULL) != NULL) |
391 | break; | 391 | break; |
392 | } | 392 | } |
393 | if (np == NULL) { | 393 | if (np == NULL) { |
diff --git a/drivers/macintosh/smu.c b/drivers/macintosh/smu.c index c9f3dc4fd3ee..a98a328b1cfc 100644 --- a/drivers/macintosh/smu.c +++ b/drivers/macintosh/smu.c | |||
@@ -491,7 +491,7 @@ int __init smu_init (void) | |||
491 | printk(KERN_ERR "SMU: Can't find doorbell GPIO !\n"); | 491 | printk(KERN_ERR "SMU: Can't find doorbell GPIO !\n"); |
492 | goto fail; | 492 | goto fail; |
493 | } | 493 | } |
494 | data = get_property(smu->db_node, "reg", NULL); | 494 | data = of_get_property(smu->db_node, "reg", NULL); |
495 | if (data == NULL) { | 495 | if (data == NULL) { |
496 | of_node_put(smu->db_node); | 496 | of_node_put(smu->db_node); |
497 | smu->db_node = NULL; | 497 | smu->db_node = NULL; |
@@ -512,7 +512,7 @@ int __init smu_init (void) | |||
512 | smu->msg_node = of_find_node_by_name(NULL, "smu-interrupt"); | 512 | smu->msg_node = of_find_node_by_name(NULL, "smu-interrupt"); |
513 | if (smu->msg_node == NULL) | 513 | if (smu->msg_node == NULL) |
514 | break; | 514 | break; |
515 | data = get_property(smu->msg_node, "reg", NULL); | 515 | data = of_get_property(smu->msg_node, "reg", NULL); |
516 | if (data == NULL) { | 516 | if (data == NULL) { |
517 | of_node_put(smu->msg_node); | 517 | of_node_put(smu->msg_node); |
518 | smu->msg_node = NULL; | 518 | smu->msg_node = NULL; |
@@ -952,7 +952,7 @@ static struct smu_sdbp_header *smu_create_sdb_partition(int id) | |||
952 | prop->name = ((char *)prop) + tlen - 18; | 952 | prop->name = ((char *)prop) + tlen - 18; |
953 | sprintf(prop->name, "sdb-partition-%02x", id); | 953 | sprintf(prop->name, "sdb-partition-%02x", id); |
954 | prop->length = len; | 954 | prop->length = len; |
955 | prop->value = (unsigned char *)hdr; | 955 | prop->value = hdr; |
956 | prop->next = NULL; | 956 | prop->next = NULL; |
957 | 957 | ||
958 | /* Read the datablock */ | 958 | /* Read the datablock */ |
@@ -1004,7 +1004,7 @@ const struct smu_sdbp_header *__smu_get_sdb_partition(int id, | |||
1004 | } else | 1004 | } else |
1005 | mutex_lock(&smu_part_access); | 1005 | mutex_lock(&smu_part_access); |
1006 | 1006 | ||
1007 | part = get_property(smu->of_node, pname, size); | 1007 | part = of_get_property(smu->of_node, pname, size); |
1008 | if (part == NULL) { | 1008 | if (part == NULL) { |
1009 | DPRINTK("trying to extract from SMU ...\n"); | 1009 | DPRINTK("trying to extract from SMU ...\n"); |
1010 | part = smu_create_sdb_partition(id); | 1010 | part = smu_create_sdb_partition(id); |
diff --git a/drivers/macintosh/therm_adt746x.c b/drivers/macintosh/therm_adt746x.c index a7ce55926638..228903403cfc 100644 --- a/drivers/macintosh/therm_adt746x.c +++ b/drivers/macintosh/therm_adt746x.c | |||
@@ -567,13 +567,13 @@ thermostat_init(void) | |||
567 | else | 567 | else |
568 | return -ENODEV; | 568 | return -ENODEV; |
569 | 569 | ||
570 | prop = get_property(np, "hwsensor-params-version", NULL); | 570 | prop = of_get_property(np, "hwsensor-params-version", NULL); |
571 | printk(KERN_INFO "adt746x: version %d (%ssupported)\n", *prop, | 571 | printk(KERN_INFO "adt746x: version %d (%ssupported)\n", *prop, |
572 | (*prop == 1)?"":"un"); | 572 | (*prop == 1)?"":"un"); |
573 | if (*prop != 1) | 573 | if (*prop != 1) |
574 | return -ENODEV; | 574 | return -ENODEV; |
575 | 575 | ||
576 | prop = get_property(np, "reg", NULL); | 576 | prop = of_get_property(np, "reg", NULL); |
577 | if (!prop) | 577 | if (!prop) |
578 | return -ENODEV; | 578 | return -ENODEV; |
579 | 579 | ||
@@ -591,9 +591,9 @@ thermostat_init(void) | |||
591 | "limit_adjust: %d, fan_speed: %d\n", | 591 | "limit_adjust: %d, fan_speed: %d\n", |
592 | therm_bus, therm_address, limit_adjust, fan_speed); | 592 | therm_bus, therm_address, limit_adjust, fan_speed); |
593 | 593 | ||
594 | if (get_property(np, "hwsensor-location", NULL)) { | 594 | if (of_get_property(np, "hwsensor-location", NULL)) { |
595 | for (i = 0; i < 3; i++) { | 595 | for (i = 0; i < 3; i++) { |
596 | sensor_location[i] = get_property(np, | 596 | sensor_location[i] = of_get_property(np, |
597 | "hwsensor-location", NULL) + offset; | 597 | "hwsensor-location", NULL) + offset; |
598 | 598 | ||
599 | if (sensor_location[i] == NULL) | 599 | if (sensor_location[i] == NULL) |
diff --git a/drivers/macintosh/therm_pm72.c b/drivers/macintosh/therm_pm72.c index 2e4ad44a8636..78ff18617139 100644 --- a/drivers/macintosh/therm_pm72.c +++ b/drivers/macintosh/therm_pm72.c | |||
@@ -674,7 +674,7 @@ static int read_eeprom(int cpu, struct mpu_data *out) | |||
674 | printk(KERN_ERR "therm_pm72: Failed to retrieve cpuid node from device-tree\n"); | 674 | printk(KERN_ERR "therm_pm72: Failed to retrieve cpuid node from device-tree\n"); |
675 | return -ENODEV; | 675 | return -ENODEV; |
676 | } | 676 | } |
677 | data = get_property(np, "cpuid", &len); | 677 | data = of_get_property(np, "cpuid", &len); |
678 | if (data == NULL) { | 678 | if (data == NULL) { |
679 | printk(KERN_ERR "therm_pm72: Failed to retrieve cpuid property from device-tree\n"); | 679 | printk(KERN_ERR "therm_pm72: Failed to retrieve cpuid property from device-tree\n"); |
680 | of_node_put(np); | 680 | of_node_put(np); |
@@ -1337,7 +1337,7 @@ static int init_backside_state(struct backside_pid_state *state) | |||
1337 | */ | 1337 | */ |
1338 | u3 = of_find_node_by_path("/u3@0,f8000000"); | 1338 | u3 = of_find_node_by_path("/u3@0,f8000000"); |
1339 | if (u3 != NULL) { | 1339 | if (u3 != NULL) { |
1340 | const u32 *vers = get_property(u3, "device-rev", NULL); | 1340 | const u32 *vers = of_get_property(u3, "device-rev", NULL); |
1341 | if (vers) | 1341 | if (vers) |
1342 | if (((*vers) & 0x3f) < 0x34) | 1342 | if (((*vers) & 0x3f) < 0x34) |
1343 | u3h = 0; | 1343 | u3h = 0; |
@@ -2129,8 +2129,8 @@ static void fcu_lookup_fans(struct device_node *fcu_node) | |||
2129 | continue; | 2129 | continue; |
2130 | 2130 | ||
2131 | /* Lookup for a matching location */ | 2131 | /* Lookup for a matching location */ |
2132 | loc = get_property(np, "location", NULL); | 2132 | loc = of_get_property(np, "location", NULL); |
2133 | reg = get_property(np, "reg", NULL); | 2133 | reg = of_get_property(np, "reg", NULL); |
2134 | if (loc == NULL || reg == NULL) | 2134 | if (loc == NULL || reg == NULL) |
2135 | continue; | 2135 | continue; |
2136 | DBG(" matching location: %s, reg: 0x%08x\n", loc, *reg); | 2136 | DBG(" matching location: %s, reg: 0x%08x\n", loc, *reg); |
diff --git a/drivers/macintosh/therm_windtunnel.c b/drivers/macintosh/therm_windtunnel.c index a1d3a987cb3a..35233de460ad 100644 --- a/drivers/macintosh/therm_windtunnel.c +++ b/drivers/macintosh/therm_windtunnel.c | |||
@@ -492,7 +492,7 @@ g4fan_init( void ) | |||
492 | 492 | ||
493 | if( !(np=of_find_node_by_name(NULL, "power-mgt")) ) | 493 | if( !(np=of_find_node_by_name(NULL, "power-mgt")) ) |
494 | return -ENODEV; | 494 | return -ENODEV; |
495 | info = get_property(np, "thermal-info", NULL); | 495 | info = of_get_property(np, "thermal-info", NULL); |
496 | of_node_put(np); | 496 | of_node_put(np); |
497 | 497 | ||
498 | if( !info || !machine_is_compatible("PowerMac3,6") ) | 498 | if( !info || !machine_is_compatible("PowerMac3,6") ) |
diff --git a/drivers/macintosh/via-cuda.c b/drivers/macintosh/via-cuda.c index d58fcf6cca0a..76d21775fc35 100644 --- a/drivers/macintosh/via-cuda.c +++ b/drivers/macintosh/via-cuda.c | |||
@@ -131,7 +131,7 @@ int __init find_via_cuda(void) | |||
131 | if (vias == 0) | 131 | if (vias == 0) |
132 | return 0; | 132 | return 0; |
133 | 133 | ||
134 | reg = get_property(vias, "reg", NULL); | 134 | reg = of_get_property(vias, "reg", NULL); |
135 | if (reg == NULL) { | 135 | if (reg == NULL) { |
136 | printk(KERN_ERR "via-cuda: No \"reg\" property !\n"); | 136 | printk(KERN_ERR "via-cuda: No \"reg\" property !\n"); |
137 | goto fail; | 137 | goto fail; |
diff --git a/drivers/macintosh/via-pmu-led.c b/drivers/macintosh/via-pmu-led.c index 179af10105d9..fc89a7047cd0 100644 --- a/drivers/macintosh/via-pmu-led.c +++ b/drivers/macintosh/via-pmu-led.c | |||
@@ -81,7 +81,7 @@ static struct led_classdev pmu_led = { | |||
81 | }; | 81 | }; |
82 | 82 | ||
83 | #ifdef CONFIG_PM | 83 | #ifdef CONFIG_PM |
84 | static int pmu_led_sleep_call(struct pmu_sleep_notifier *self, int when) | 84 | static void pmu_led_sleep_call(struct pmu_sleep_notifier *self, int when) |
85 | { | 85 | { |
86 | unsigned long flags; | 86 | unsigned long flags; |
87 | 87 | ||
@@ -99,8 +99,6 @@ static int pmu_led_sleep_call(struct pmu_sleep_notifier *self, int when) | |||
99 | break; | 99 | break; |
100 | } | 100 | } |
101 | spin_unlock_irqrestore(&pmu_blink_lock, flags); | 101 | spin_unlock_irqrestore(&pmu_blink_lock, flags); |
102 | |||
103 | return PBOOK_SLEEP_OK; | ||
104 | } | 102 | } |
105 | 103 | ||
106 | static struct pmu_sleep_notifier via_pmu_led_sleep_notif = { | 104 | static struct pmu_sleep_notifier via_pmu_led_sleep_notif = { |
@@ -120,11 +118,13 @@ static int __init via_pmu_led_init(void) | |||
120 | dt = of_find_node_by_path("/"); | 118 | dt = of_find_node_by_path("/"); |
121 | if (dt == NULL) | 119 | if (dt == NULL) |
122 | return -ENODEV; | 120 | return -ENODEV; |
123 | model = get_property(dt, "model", NULL); | 121 | model = of_get_property(dt, "model", NULL); |
124 | if (model == NULL) | 122 | if (model == NULL) |
125 | return -ENODEV; | 123 | return -ENODEV; |
126 | if (strncmp(model, "PowerBook", strlen("PowerBook")) != 0 && | 124 | if (strncmp(model, "PowerBook", strlen("PowerBook")) != 0 && |
127 | strncmp(model, "iBook", strlen("iBook")) != 0) { | 125 | strncmp(model, "iBook", strlen("iBook")) != 0 && |
126 | strcmp(model, "PowerMac7,2") != 0 && | ||
127 | strcmp(model, "PowerMac7,3") != 0) { | ||
128 | of_node_put(dt); | 128 | of_node_put(dt); |
129 | /* ignore */ | 129 | /* ignore */ |
130 | return -ENODEV; | 130 | return -ENODEV; |
diff --git a/drivers/macintosh/via-pmu.c b/drivers/macintosh/via-pmu.c index b6073bdb50c3..1729d3fd7a11 100644 --- a/drivers/macintosh/via-pmu.c +++ b/drivers/macintosh/via-pmu.c | |||
@@ -289,7 +289,7 @@ int __init find_via_pmu(void) | |||
289 | if (vias == NULL) | 289 | if (vias == NULL) |
290 | return 0; | 290 | return 0; |
291 | 291 | ||
292 | reg = get_property(vias, "reg", NULL); | 292 | reg = of_get_property(vias, "reg", NULL); |
293 | if (reg == NULL) { | 293 | if (reg == NULL) { |
294 | printk(KERN_ERR "via-pmu: No \"reg\" property !\n"); | 294 | printk(KERN_ERR "via-pmu: No \"reg\" property !\n"); |
295 | goto fail; | 295 | goto fail; |
@@ -319,10 +319,13 @@ int __init find_via_pmu(void) | |||
319 | else if (device_is_compatible(vias->parent, "Keylargo") | 319 | else if (device_is_compatible(vias->parent, "Keylargo") |
320 | || device_is_compatible(vias->parent, "K2-Keylargo")) { | 320 | || device_is_compatible(vias->parent, "K2-Keylargo")) { |
321 | struct device_node *gpiop; | 321 | struct device_node *gpiop; |
322 | struct device_node *adbp; | ||
322 | u64 gaddr = OF_BAD_ADDR; | 323 | u64 gaddr = OF_BAD_ADDR; |
323 | 324 | ||
324 | pmu_kind = PMU_KEYLARGO_BASED; | 325 | pmu_kind = PMU_KEYLARGO_BASED; |
325 | pmu_has_adb = (find_type_devices("adb") != NULL); | 326 | adbp = of_find_node_by_type(NULL, "adb"); |
327 | pmu_has_adb = (adbp != NULL); | ||
328 | of_node_put(adbp); | ||
326 | pmu_intr_mask = PMU_INT_PCEJECT | | 329 | pmu_intr_mask = PMU_INT_PCEJECT | |
327 | PMU_INT_SNDBRT | | 330 | PMU_INT_SNDBRT | |
328 | PMU_INT_ADB | | 331 | PMU_INT_ADB | |
@@ -331,7 +334,7 @@ int __init find_via_pmu(void) | |||
331 | 334 | ||
332 | gpiop = of_find_node_by_name(NULL, "gpio"); | 335 | gpiop = of_find_node_by_name(NULL, "gpio"); |
333 | if (gpiop) { | 336 | if (gpiop) { |
334 | reg = get_property(gpiop, "reg", NULL); | 337 | reg = of_get_property(gpiop, "reg", NULL); |
335 | if (reg) | 338 | if (reg) |
336 | gaddr = of_translate_address(gpiop, reg); | 339 | gaddr = of_translate_address(gpiop, reg); |
337 | if (gaddr != OF_BAD_ADDR) | 340 | if (gaddr != OF_BAD_ADDR) |
@@ -484,10 +487,11 @@ static int __init via_pmu_dev_init(void) | |||
484 | pmu_batteries[0].flags |= PMU_BATT_TYPE_SMART; | 487 | pmu_batteries[0].flags |= PMU_BATT_TYPE_SMART; |
485 | pmu_batteries[1].flags |= PMU_BATT_TYPE_SMART; | 488 | pmu_batteries[1].flags |= PMU_BATT_TYPE_SMART; |
486 | } else { | 489 | } else { |
487 | struct device_node* prim = find_devices("power-mgt"); | 490 | struct device_node* prim = |
491 | of_find_node_by_name(NULL, "power-mgt"); | ||
488 | const u32 *prim_info = NULL; | 492 | const u32 *prim_info = NULL; |
489 | if (prim) | 493 | if (prim) |
490 | prim_info = get_property(prim, "prim-info", NULL); | 494 | prim_info = of_get_property(prim, "prim-info", NULL); |
491 | if (prim_info) { | 495 | if (prim_info) { |
492 | /* Other stuffs here yet unknown */ | 496 | /* Other stuffs here yet unknown */ |
493 | pmu_battery_count = (prim_info[6] >> 16) & 0xff; | 497 | pmu_battery_count = (prim_info[6] >> 16) & 0xff; |
@@ -495,6 +499,7 @@ static int __init via_pmu_dev_init(void) | |||
495 | if (pmu_battery_count > 1) | 499 | if (pmu_battery_count > 1) |
496 | pmu_batteries[1].flags |= PMU_BATT_TYPE_SMART; | 500 | pmu_batteries[1].flags |= PMU_BATT_TYPE_SMART; |
497 | } | 501 | } |
502 | of_node_put(prim); | ||
498 | } | 503 | } |
499 | #endif /* CONFIG_PPC32 */ | 504 | #endif /* CONFIG_PPC32 */ |
500 | 505 | ||
@@ -1769,35 +1774,21 @@ EXPORT_SYMBOL(pmu_unregister_sleep_notifier); | |||
1769 | #if defined(CONFIG_PM) && defined(CONFIG_PPC32) | 1774 | #if defined(CONFIG_PM) && defined(CONFIG_PPC32) |
1770 | 1775 | ||
1771 | /* Sleep is broadcast last-to-first */ | 1776 | /* Sleep is broadcast last-to-first */ |
1772 | static int | 1777 | static void broadcast_sleep(int when) |
1773 | broadcast_sleep(int when, int fallback) | ||
1774 | { | 1778 | { |
1775 | int ret = PBOOK_SLEEP_OK; | ||
1776 | struct list_head *list; | 1779 | struct list_head *list; |
1777 | struct pmu_sleep_notifier *notifier; | 1780 | struct pmu_sleep_notifier *notifier; |
1778 | 1781 | ||
1779 | for (list = sleep_notifiers.prev; list != &sleep_notifiers; | 1782 | for (list = sleep_notifiers.prev; list != &sleep_notifiers; |
1780 | list = list->prev) { | 1783 | list = list->prev) { |
1781 | notifier = list_entry(list, struct pmu_sleep_notifier, list); | 1784 | notifier = list_entry(list, struct pmu_sleep_notifier, list); |
1782 | ret = notifier->notifier_call(notifier, when); | 1785 | notifier->notifier_call(notifier, when); |
1783 | if (ret != PBOOK_SLEEP_OK) { | ||
1784 | printk(KERN_DEBUG "sleep %d rejected by %p (%p)\n", | ||
1785 | when, notifier, notifier->notifier_call); | ||
1786 | for (; list != &sleep_notifiers; list = list->next) { | ||
1787 | notifier = list_entry(list, struct pmu_sleep_notifier, list); | ||
1788 | notifier->notifier_call(notifier, fallback); | ||
1789 | } | ||
1790 | return ret; | ||
1791 | } | ||
1792 | } | 1786 | } |
1793 | return ret; | ||
1794 | } | 1787 | } |
1795 | 1788 | ||
1796 | /* Wake is broadcast first-to-last */ | 1789 | /* Wake is broadcast first-to-last */ |
1797 | static int | 1790 | static void broadcast_wake(void) |
1798 | broadcast_wake(void) | ||
1799 | { | 1791 | { |
1800 | int ret = PBOOK_SLEEP_OK; | ||
1801 | struct list_head *list; | 1792 | struct list_head *list; |
1802 | struct pmu_sleep_notifier *notifier; | 1793 | struct pmu_sleep_notifier *notifier; |
1803 | 1794 | ||
@@ -1806,7 +1797,6 @@ broadcast_wake(void) | |||
1806 | notifier = list_entry(list, struct pmu_sleep_notifier, list); | 1797 | notifier = list_entry(list, struct pmu_sleep_notifier, list); |
1807 | notifier->notifier_call(notifier, PBOOK_WAKE); | 1798 | notifier->notifier_call(notifier, PBOOK_WAKE); |
1808 | } | 1799 | } |
1809 | return ret; | ||
1810 | } | 1800 | } |
1811 | 1801 | ||
1812 | /* | 1802 | /* |
@@ -2013,12 +2003,8 @@ pmac_suspend_devices(void) | |||
2013 | 2003 | ||
2014 | pm_prepare_console(); | 2004 | pm_prepare_console(); |
2015 | 2005 | ||
2016 | /* Notify old-style device drivers & userland */ | 2006 | /* Notify old-style device drivers */ |
2017 | ret = broadcast_sleep(PBOOK_SLEEP_REQUEST, PBOOK_SLEEP_REJECT); | 2007 | broadcast_sleep(PBOOK_SLEEP_REQUEST); |
2018 | if (ret != PBOOK_SLEEP_OK) { | ||
2019 | printk(KERN_ERR "Sleep rejected by drivers\n"); | ||
2020 | return -EBUSY; | ||
2021 | } | ||
2022 | 2008 | ||
2023 | /* Sync the disks. */ | 2009 | /* Sync the disks. */ |
2024 | /* XXX It would be nice to have some way to ensure that | 2010 | /* XXX It would be nice to have some way to ensure that |
@@ -2028,12 +2014,7 @@ pmac_suspend_devices(void) | |||
2028 | */ | 2014 | */ |
2029 | sys_sync(); | 2015 | sys_sync(); |
2030 | 2016 | ||
2031 | /* Sleep can fail now. May not be very robust but useful for debugging */ | 2017 | broadcast_sleep(PBOOK_SLEEP_NOW); |
2032 | ret = broadcast_sleep(PBOOK_SLEEP_NOW, PBOOK_WAKE); | ||
2033 | if (ret != PBOOK_SLEEP_OK) { | ||
2034 | printk(KERN_ERR "Driver sleep failed\n"); | ||
2035 | return -EBUSY; | ||
2036 | } | ||
2037 | 2018 | ||
2038 | /* Send suspend call to devices, hold the device core's dpm_sem */ | 2019 | /* Send suspend call to devices, hold the device core's dpm_sem */ |
2039 | ret = device_suspend(PMSG_SUSPEND); | 2020 | ret = device_suspend(PMSG_SUSPEND); |
@@ -2154,7 +2135,7 @@ static int powerbook_sleep_grackle(void) | |||
2154 | int ret; | 2135 | int ret; |
2155 | struct pci_dev *grackle; | 2136 | struct pci_dev *grackle; |
2156 | 2137 | ||
2157 | grackle = pci_find_slot(0, 0); | 2138 | grackle = pci_get_bus_and_slot(0, 0); |
2158 | if (!grackle) | 2139 | if (!grackle) |
2159 | return -ENODEV; | 2140 | return -ENODEV; |
2160 | 2141 | ||
@@ -2202,6 +2183,8 @@ static int powerbook_sleep_grackle(void) | |||
2202 | pmcr1 &= ~(GRACKLE_PM|GRACKLE_DOZE|GRACKLE_SLEEP|GRACKLE_NAP); | 2183 | pmcr1 &= ~(GRACKLE_PM|GRACKLE_DOZE|GRACKLE_SLEEP|GRACKLE_NAP); |
2203 | pci_write_config_word(grackle, 0x70, pmcr1); | 2184 | pci_write_config_word(grackle, 0x70, pmcr1); |
2204 | 2185 | ||
2186 | pci_dev_put(grackle); | ||
2187 | |||
2205 | /* Make sure the PMU is idle */ | 2188 | /* Make sure the PMU is idle */ |
2206 | pmac_call_feature(PMAC_FTR_SLEEP_STATE,NULL,0,0); | 2189 | pmac_call_feature(PMAC_FTR_SLEEP_STATE,NULL,0,0); |
2207 | restore_via_state(); | 2190 | restore_via_state(); |
diff --git a/drivers/macintosh/windfarm_lm75_sensor.c b/drivers/macintosh/windfarm_lm75_sensor.c index 3f7967feaf5b..ab4d1b63f63e 100644 --- a/drivers/macintosh/windfarm_lm75_sensor.c +++ b/drivers/macintosh/windfarm_lm75_sensor.c | |||
@@ -176,7 +176,7 @@ static int wf_lm75_attach(struct i2c_adapter *adapter) | |||
176 | for (dev = NULL; | 176 | for (dev = NULL; |
177 | (dev = of_get_next_child(busnode, dev)) != NULL;) { | 177 | (dev = of_get_next_child(busnode, dev)) != NULL;) { |
178 | const char *loc = | 178 | const char *loc = |
179 | get_property(dev, "hwsensor-location", NULL); | 179 | of_get_property(dev, "hwsensor-location", NULL); |
180 | u8 addr; | 180 | u8 addr; |
181 | 181 | ||
182 | /* We must re-match the adapter in order to properly check | 182 | /* We must re-match the adapter in order to properly check |
diff --git a/drivers/macintosh/windfarm_max6690_sensor.c b/drivers/macintosh/windfarm_max6690_sensor.c index eae1189d6c41..eaa74afa175b 100644 --- a/drivers/macintosh/windfarm_max6690_sensor.c +++ b/drivers/macintosh/windfarm_max6690_sensor.c | |||
@@ -134,7 +134,7 @@ static int wf_max6690_attach(struct i2c_adapter *adapter) | |||
134 | if (!device_is_compatible(dev, "max6690")) | 134 | if (!device_is_compatible(dev, "max6690")) |
135 | continue; | 135 | continue; |
136 | addr = pmac_i2c_get_dev_addr(dev); | 136 | addr = pmac_i2c_get_dev_addr(dev); |
137 | loc = get_property(dev, "hwsensor-location", NULL); | 137 | loc = of_get_property(dev, "hwsensor-location", NULL); |
138 | if (loc == NULL || addr == 0) | 138 | if (loc == NULL || addr == 0) |
139 | continue; | 139 | continue; |
140 | printk("found max6690, loc=%s addr=0x%02x\n", loc, addr); | 140 | printk("found max6690, loc=%s addr=0x%02x\n", loc, addr); |
diff --git a/drivers/macintosh/windfarm_smu_controls.c b/drivers/macintosh/windfarm_smu_controls.c index 31b750d61206..ff398adc0283 100644 --- a/drivers/macintosh/windfarm_smu_controls.c +++ b/drivers/macintosh/windfarm_smu_controls.c | |||
@@ -167,7 +167,7 @@ static struct smu_fan_control *smu_fan_create(struct device_node *node, | |||
167 | if (fct == NULL) | 167 | if (fct == NULL) |
168 | return NULL; | 168 | return NULL; |
169 | fct->ctrl.ops = &smu_fan_ops; | 169 | fct->ctrl.ops = &smu_fan_ops; |
170 | l = get_property(node, "location", NULL); | 170 | l = of_get_property(node, "location", NULL); |
171 | if (l == NULL) | 171 | if (l == NULL) |
172 | goto fail; | 172 | goto fail; |
173 | 173 | ||
@@ -224,17 +224,17 @@ static struct smu_fan_control *smu_fan_create(struct device_node *node, | |||
224 | goto fail; | 224 | goto fail; |
225 | 225 | ||
226 | /* Get min & max values*/ | 226 | /* Get min & max values*/ |
227 | v = get_property(node, "min-value", NULL); | 227 | v = of_get_property(node, "min-value", NULL); |
228 | if (v == NULL) | 228 | if (v == NULL) |
229 | goto fail; | 229 | goto fail; |
230 | fct->min = *v; | 230 | fct->min = *v; |
231 | v = get_property(node, "max-value", NULL); | 231 | v = of_get_property(node, "max-value", NULL); |
232 | if (v == NULL) | 232 | if (v == NULL) |
233 | goto fail; | 233 | goto fail; |
234 | fct->max = *v; | 234 | fct->max = *v; |
235 | 235 | ||
236 | /* Get "reg" value */ | 236 | /* Get "reg" value */ |
237 | reg = get_property(node, "reg", NULL); | 237 | reg = of_get_property(node, "reg", NULL); |
238 | if (reg == NULL) | 238 | if (reg == NULL) |
239 | goto fail; | 239 | goto fail; |
240 | fct->reg = *reg; | 240 | fct->reg = *reg; |
diff --git a/drivers/macintosh/windfarm_smu_sat.c b/drivers/macintosh/windfarm_smu_sat.c index 83f79de7174b..9a6c2cf8fd0e 100644 --- a/drivers/macintosh/windfarm_smu_sat.c +++ b/drivers/macintosh/windfarm_smu_sat.c | |||
@@ -241,7 +241,7 @@ static void wf_sat_create(struct i2c_adapter *adapter, struct device_node *dev) | |||
241 | char *name; | 241 | char *name; |
242 | int vsens[2], isens[2]; | 242 | int vsens[2], isens[2]; |
243 | 243 | ||
244 | reg = get_property(dev, "reg", NULL); | 244 | reg = of_get_property(dev, "reg", NULL); |
245 | if (reg == NULL) | 245 | if (reg == NULL) |
246 | return; | 246 | return; |
247 | addr = *reg; | 247 | addr = *reg; |
@@ -268,9 +268,9 @@ static void wf_sat_create(struct i2c_adapter *adapter, struct device_node *dev) | |||
268 | isens[0] = isens[1] = -1; | 268 | isens[0] = isens[1] = -1; |
269 | child = NULL; | 269 | child = NULL; |
270 | while ((child = of_get_next_child(dev, child)) != NULL) { | 270 | while ((child = of_get_next_child(dev, child)) != NULL) { |
271 | reg = get_property(child, "reg", NULL); | 271 | reg = of_get_property(child, "reg", NULL); |
272 | type = get_property(child, "device_type", NULL); | 272 | type = of_get_property(child, "device_type", NULL); |
273 | loc = get_property(child, "location", NULL); | 273 | loc = of_get_property(child, "location", NULL); |
274 | if (reg == NULL || loc == NULL) | 274 | if (reg == NULL || loc == NULL) |
275 | continue; | 275 | continue; |
276 | 276 | ||
diff --git a/drivers/macintosh/windfarm_smu_sensors.c b/drivers/macintosh/windfarm_smu_sensors.c index 01b4c50143dd..9c567b93f417 100644 --- a/drivers/macintosh/windfarm_smu_sensors.c +++ b/drivers/macintosh/windfarm_smu_sensors.c | |||
@@ -204,8 +204,8 @@ static struct smu_ad_sensor *smu_ads_create(struct device_node *node) | |||
204 | ads = kmalloc(sizeof(struct smu_ad_sensor), GFP_KERNEL); | 204 | ads = kmalloc(sizeof(struct smu_ad_sensor), GFP_KERNEL); |
205 | if (ads == NULL) | 205 | if (ads == NULL) |
206 | return NULL; | 206 | return NULL; |
207 | c = get_property(node, "device_type", NULL); | 207 | c = of_get_property(node, "device_type", NULL); |
208 | l = get_property(node, "location", NULL); | 208 | l = of_get_property(node, "location", NULL); |
209 | if (c == NULL || l == NULL) | 209 | if (c == NULL || l == NULL) |
210 | goto fail; | 210 | goto fail; |
211 | 211 | ||
@@ -255,7 +255,7 @@ static struct smu_ad_sensor *smu_ads_create(struct device_node *node) | |||
255 | } else | 255 | } else |
256 | goto fail; | 256 | goto fail; |
257 | 257 | ||
258 | v = get_property(node, "reg", NULL); | 258 | v = of_get_property(node, "reg", NULL); |
259 | if (v == NULL) | 259 | if (v == NULL) |
260 | goto fail; | 260 | goto fail; |
261 | ads->reg = *v; | 261 | ads->reg = *v; |
diff --git a/drivers/media/video/planb.c b/drivers/media/video/planb.c index fe184f93c016..1455a8f4e930 100644 --- a/drivers/media/video/planb.c +++ b/drivers/media/video/planb.c | |||
@@ -2160,7 +2160,7 @@ static int find_planb(void) | |||
2160 | if (!machine_is(powermac)) | 2160 | if (!machine_is(powermac)) |
2161 | return 0; | 2161 | return 0; |
2162 | 2162 | ||
2163 | planb_devices = find_devices("planb"); | 2163 | planb_devices = of_find_node_by_name(NULL, "planb"); |
2164 | if (planb_devices == 0) { | 2164 | if (planb_devices == 0) { |
2165 | planb_num=0; | 2165 | planb_num=0; |
2166 | printk(KERN_WARNING "PlanB: no device found!\n"); | 2166 | printk(KERN_WARNING "PlanB: no device found!\n"); |
@@ -2175,12 +2175,14 @@ static int find_planb(void) | |||
2175 | if (planb_devices->n_addrs != 1) { | 2175 | if (planb_devices->n_addrs != 1) { |
2176 | printk (KERN_WARNING "PlanB: expecting 1 address for planb " | 2176 | printk (KERN_WARNING "PlanB: expecting 1 address for planb " |
2177 | "(got %d)", planb_devices->n_addrs); | 2177 | "(got %d)", planb_devices->n_addrs); |
2178 | of_node_put(planb_devices); | ||
2178 | return 0; | 2179 | return 0; |
2179 | } | 2180 | } |
2180 | 2181 | ||
2181 | if (planb_devices->n_intrs == 0) { | 2182 | if (planb_devices->n_intrs == 0) { |
2182 | printk(KERN_WARNING "PlanB: no intrs for device %s\n", | 2183 | printk(KERN_WARNING "PlanB: no intrs for device %s\n", |
2183 | planb_devices->full_name); | 2184 | planb_devices->full_name); |
2185 | of_node_put(planb_devices); | ||
2184 | return 0; | 2186 | return 0; |
2185 | } else { | 2187 | } else { |
2186 | irq = planb_devices->intrs[0].line; | 2188 | irq = planb_devices->intrs[0].line; |
@@ -2202,6 +2204,7 @@ static int find_planb(void) | |||
2202 | confreg = planb_devices->addrs[0].space & 0xff; | 2204 | confreg = planb_devices->addrs[0].space & 0xff; |
2203 | old_base = planb_devices->addrs[0].address; | 2205 | old_base = planb_devices->addrs[0].address; |
2204 | new_base = 0xf1000000; | 2206 | new_base = 0xf1000000; |
2207 | of_node_put(planb_devices); | ||
2205 | 2208 | ||
2206 | DEBUG("PlanB: Found on bus %d, dev %d, func %d, " | 2209 | DEBUG("PlanB: Found on bus %d, dev %d, func %d, " |
2207 | "membase 0x%x (base reg. 0x%x)\n", | 2210 | "membase 0x%x (base reg. 0x%x)\n", |
diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig index 545c405a5cb0..eb4b96c4d388 100644 --- a/drivers/net/Kconfig +++ b/drivers/net/Kconfig | |||
@@ -2274,11 +2274,12 @@ config GFAR_NAPI | |||
2274 | depends on GIANFAR | 2274 | depends on GIANFAR |
2275 | 2275 | ||
2276 | config UCC_GETH | 2276 | config UCC_GETH |
2277 | tristate "Freescale QE UCC GETH" | 2277 | tristate "Freescale QE Gigabit Ethernet" |
2278 | depends on QUICC_ENGINE && UCC_FAST | 2278 | depends on QUICC_ENGINE |
2279 | select UCC_FAST | ||
2279 | help | 2280 | help |
2280 | This driver supports the Gigabit Ethernet mode of QE UCC. | 2281 | This driver supports the Gigabit Ethernet mode of the QUICC Engine, |
2281 | QE can be found on MPC836x CPUs. | 2282 | which is available on some Freescale SOCs. |
2282 | 2283 | ||
2283 | config UGETH_NAPI | 2284 | config UGETH_NAPI |
2284 | bool "NAPI Support" | 2285 | bool "NAPI Support" |
diff --git a/drivers/ps3/vuart.c b/drivers/ps3/vuart.c index 6c12744eeb9d..7d7cab1d91b4 100644 --- a/drivers/ps3/vuart.c +++ b/drivers/ps3/vuart.c | |||
@@ -82,14 +82,6 @@ struct ports_bmp { | |||
82 | u64 unused[3]; | 82 | u64 unused[3]; |
83 | } __attribute__ ((aligned (32))); | 83 | } __attribute__ ((aligned (32))); |
84 | 84 | ||
85 | /* redefine dev_dbg to do a syntax check */ | ||
86 | |||
87 | #if !defined(DEBUG) | ||
88 | #undef dev_dbg | ||
89 | static inline int __attribute__ ((format (printf, 2, 3))) dev_dbg( | ||
90 | const struct device *_dev, const char *fmt, ...) {return 0;} | ||
91 | #endif | ||
92 | |||
93 | #define dump_ports_bmp(_b) _dump_ports_bmp(_b, __func__, __LINE__) | 85 | #define dump_ports_bmp(_b) _dump_ports_bmp(_b, __func__, __LINE__) |
94 | static void __attribute__ ((unused)) _dump_ports_bmp( | 86 | static void __attribute__ ((unused)) _dump_ports_bmp( |
95 | const struct ports_bmp* bmp, const char* func, int line) | 87 | const struct ports_bmp* bmp, const char* func, int line) |
diff --git a/drivers/scsi/ibmvscsi/ibmvstgt.c b/drivers/scsi/ibmvscsi/ibmvstgt.c index 4368ca0e8270..a39a478bb39a 100644 --- a/drivers/scsi/ibmvscsi/ibmvstgt.c +++ b/drivers/scsi/ibmvscsi/ibmvstgt.c | |||
@@ -897,9 +897,9 @@ static int get_system_info(void) | |||
897 | { | 897 | { |
898 | struct device_node *rootdn; | 898 | struct device_node *rootdn; |
899 | const char *id, *model, *name; | 899 | const char *id, *model, *name; |
900 | unsigned int *num; | 900 | const unsigned int *num; |
901 | 901 | ||
902 | rootdn = find_path_device("/"); | 902 | rootdn = of_find_node_by_path("/"); |
903 | if (!rootdn) | 903 | if (!rootdn) |
904 | return -ENOENT; | 904 | return -ENOENT; |
905 | 905 | ||
@@ -912,10 +912,11 @@ static int get_system_info(void) | |||
912 | if (name) | 912 | if (name) |
913 | strncpy(partition_name, name, sizeof(partition_name)); | 913 | strncpy(partition_name, name, sizeof(partition_name)); |
914 | 914 | ||
915 | num = (unsigned int *) get_property(rootdn, "ibm,partition-no", NULL); | 915 | num = get_property(rootdn, "ibm,partition-no", NULL); |
916 | if (num) | 916 | if (num) |
917 | partition_number = *num; | 917 | partition_number = *num; |
918 | 918 | ||
919 | of_node_put(rootdn); | ||
919 | return 0; | 920 | return 0; |
920 | } | 921 | } |
921 | 922 | ||
diff --git a/drivers/scsi/ibmvscsi/rpa_vscsi.c b/drivers/scsi/ibmvscsi/rpa_vscsi.c index 227c0f2f4d74..0a533f398f52 100644 --- a/drivers/scsi/ibmvscsi/rpa_vscsi.c +++ b/drivers/scsi/ibmvscsi/rpa_vscsi.c | |||
@@ -157,7 +157,7 @@ static void gather_partition_info(void) | |||
157 | const unsigned int *p_number_ptr; | 157 | const unsigned int *p_number_ptr; |
158 | 158 | ||
159 | /* Retrieve information about this partition */ | 159 | /* Retrieve information about this partition */ |
160 | rootdn = find_path_device("/"); | 160 | rootdn = of_find_node_by_path("/"); |
161 | if (!rootdn) { | 161 | if (!rootdn) { |
162 | return; | 162 | return; |
163 | } | 163 | } |
@@ -169,6 +169,7 @@ static void gather_partition_info(void) | |||
169 | p_number_ptr = get_property(rootdn, "ibm,partition-no", NULL); | 169 | p_number_ptr = get_property(rootdn, "ibm,partition-no", NULL); |
170 | if (p_number_ptr) | 170 | if (p_number_ptr) |
171 | partition_number = *p_number_ptr; | 171 | partition_number = *p_number_ptr; |
172 | of_node_put(rootdn); | ||
172 | } | 173 | } |
173 | 174 | ||
174 | static void set_adapter_info(struct ibmvscsi_host_data *hostdata) | 175 | static void set_adapter_info(struct ibmvscsi_host_data *hostdata) |
diff --git a/drivers/serial/pmac_zilog.c b/drivers/serial/pmac_zilog.c index 752ef07516b9..be8d75721a85 100644 --- a/drivers/serial/pmac_zilog.c +++ b/drivers/serial/pmac_zilog.c | |||
@@ -1467,7 +1467,8 @@ no_dma: | |||
1467 | if (ZS_IS_IRDA(uap)) | 1467 | if (ZS_IS_IRDA(uap)) |
1468 | uap->port_type = PMAC_SCC_IRDA; | 1468 | uap->port_type = PMAC_SCC_IRDA; |
1469 | if (ZS_IS_INTMODEM(uap)) { | 1469 | if (ZS_IS_INTMODEM(uap)) { |
1470 | struct device_node* i2c_modem = find_devices("i2c-modem"); | 1470 | struct device_node* i2c_modem = |
1471 | of_find_node_by_name(NULL, "i2c-modem"); | ||
1471 | if (i2c_modem) { | 1472 | if (i2c_modem) { |
1472 | const char* mid = | 1473 | const char* mid = |
1473 | get_property(i2c_modem, "modem-id", NULL); | 1474 | get_property(i2c_modem, "modem-id", NULL); |
@@ -1482,6 +1483,7 @@ no_dma: | |||
1482 | } | 1483 | } |
1483 | printk(KERN_INFO "pmac_zilog: i2c-modem detected, id: %d\n", | 1484 | printk(KERN_INFO "pmac_zilog: i2c-modem detected, id: %d\n", |
1484 | mid ? (*mid) : 0); | 1485 | mid ? (*mid) : 0); |
1486 | of_node_put(i2c_modem); | ||
1485 | } else { | 1487 | } else { |
1486 | printk(KERN_INFO "pmac_zilog: serial modem detected\n"); | 1488 | printk(KERN_INFO "pmac_zilog: serial modem detected\n"); |
1487 | } | 1489 | } |
diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig index 8372ace4a0d9..b1cb72c3780f 100644 --- a/drivers/video/Kconfig +++ b/drivers/video/Kconfig | |||
@@ -396,7 +396,7 @@ config FB_ATARI | |||
396 | 396 | ||
397 | config FB_OF | 397 | config FB_OF |
398 | bool "Open Firmware frame buffer device support" | 398 | bool "Open Firmware frame buffer device support" |
399 | depends on (FB = y) && (PPC64 || PPC_OF) | 399 | depends on (FB = y) && (PPC64 || PPC_OF) && (!PPC_PSERIES || PCI) |
400 | select FB_CFB_FILLRECT | 400 | select FB_CFB_FILLRECT |
401 | select FB_CFB_COPYAREA | 401 | select FB_CFB_COPYAREA |
402 | select FB_CFB_IMAGEBLIT | 402 | select FB_CFB_IMAGEBLIT |
diff --git a/drivers/video/aty/radeon_pm.c b/drivers/video/aty/radeon_pm.c index 9a2b0d69b0ae..c411293cefc8 100644 --- a/drivers/video/aty/radeon_pm.c +++ b/drivers/video/aty/radeon_pm.c | |||
@@ -1262,7 +1262,7 @@ static void radeon_pm_full_reset_sdram(struct radeonfb_info *rinfo) | |||
1262 | /* This is the code for the Aluminium PowerBooks M10 / iBooks M11 */ | 1262 | /* This is the code for the Aluminium PowerBooks M10 / iBooks M11 */ |
1263 | if (rinfo->family == CHIP_FAMILY_RV350) { | 1263 | if (rinfo->family == CHIP_FAMILY_RV350) { |
1264 | u32 sdram_mode_reg = rinfo->save_regs[35]; | 1264 | u32 sdram_mode_reg = rinfo->save_regs[35]; |
1265 | static u32 default_mrtable[] = | 1265 | static const u32 default_mrtable[] = |
1266 | { 0x21320032, | 1266 | { 0x21320032, |
1267 | 0x21321000, 0xa1321000, 0x21321000, 0xffffffff, | 1267 | 0x21321000, 0xa1321000, 0x21321000, 0xffffffff, |
1268 | 0x21320032, 0xa1320032, 0x21320032, 0xffffffff, | 1268 | 0x21320032, 0xa1320032, 0x21320032, 0xffffffff, |
diff --git a/drivers/video/controlfb.c b/drivers/video/controlfb.c index fd60dba294da..8b762739b1e0 100644 --- a/drivers/video/controlfb.c +++ b/drivers/video/controlfb.c | |||
@@ -179,12 +179,14 @@ MODULE_LICENSE("GPL"); | |||
179 | int init_module(void) | 179 | int init_module(void) |
180 | { | 180 | { |
181 | struct device_node *dp; | 181 | struct device_node *dp; |
182 | int ret = -ENXIO; | ||
182 | 183 | ||
183 | dp = find_devices("control"); | 184 | dp = of_find_node_by_name(NULL, "control"); |
184 | if (dp != 0 && !control_of_init(dp)) | 185 | if (dp != 0 && !control_of_init(dp)) |
185 | return 0; | 186 | ret = 0; |
187 | of_node_put(dp); | ||
186 | 188 | ||
187 | return -ENXIO; | 189 | return ret; |
188 | } | 190 | } |
189 | 191 | ||
190 | void cleanup_module(void) | 192 | void cleanup_module(void) |
@@ -589,16 +591,18 @@ static int __init control_init(void) | |||
589 | { | 591 | { |
590 | struct device_node *dp; | 592 | struct device_node *dp; |
591 | char *option = NULL; | 593 | char *option = NULL; |
594 | int ret = -ENXIO; | ||
592 | 595 | ||
593 | if (fb_get_options("controlfb", &option)) | 596 | if (fb_get_options("controlfb", &option)) |
594 | return -ENODEV; | 597 | return -ENODEV; |
595 | control_setup(option); | 598 | control_setup(option); |
596 | 599 | ||
597 | dp = find_devices("control"); | 600 | dp = of_find_node_by_name(NULL, "control"); |
598 | if (dp != 0 && !control_of_init(dp)) | 601 | if (dp != 0 && !control_of_init(dp)) |
599 | return 0; | 602 | ret = 0; |
603 | of_node_put(dp); | ||
600 | 604 | ||
601 | return -ENXIO; | 605 | return ret; |
602 | } | 606 | } |
603 | 607 | ||
604 | module_init(control_init); | 608 | module_init(control_init); |