diff options
Diffstat (limited to 'drivers/macintosh')
-rw-r--r-- | drivers/macintosh/macio-adb.c | 1 | ||||
-rw-r--r-- | drivers/macintosh/macio_asic.c | 28 | ||||
-rw-r--r-- | drivers/macintosh/macio_sysfs.c | 6 | ||||
-rw-r--r-- | drivers/macintosh/mediabay.c | 2 | ||||
-rw-r--r-- | drivers/macintosh/rack-meter.c | 4 | ||||
-rw-r--r-- | drivers/macintosh/smu.c | 11 | ||||
-rw-r--r-- | drivers/macintosh/therm_adt746x.c | 2 | ||||
-rw-r--r-- | drivers/macintosh/therm_pm72.c | 9 | ||||
-rw-r--r-- | drivers/macintosh/therm_windtunnel.c | 7 | ||||
-rw-r--r-- | drivers/macintosh/windfarm_pm81.c | 8 | ||||
-rw-r--r-- | drivers/macintosh/windfarm_pm91.c | 9 |
11 files changed, 47 insertions, 40 deletions
diff --git a/drivers/macintosh/macio-adb.c b/drivers/macintosh/macio-adb.c index 79119f56e82d..bd6da7a9c55b 100644 --- a/drivers/macintosh/macio-adb.c +++ b/drivers/macintosh/macio-adb.c | |||
@@ -155,6 +155,7 @@ static int macio_adb_reset_bus(void) | |||
155 | while ((in_8(&adb->ctrl.r) & ADB_RST) != 0) { | 155 | while ((in_8(&adb->ctrl.r) & ADB_RST) != 0) { |
156 | if (--timeout == 0) { | 156 | if (--timeout == 0) { |
157 | out_8(&adb->ctrl.r, in_8(&adb->ctrl.r) & ~ADB_RST); | 157 | out_8(&adb->ctrl.r, in_8(&adb->ctrl.r) & ~ADB_RST); |
158 | spin_unlock_irqrestore(&macio_lock, flags); | ||
158 | return -1; | 159 | return -1; |
159 | } | 160 | } |
160 | } | 161 | } |
diff --git a/drivers/macintosh/macio_asic.c b/drivers/macintosh/macio_asic.c index 26a303a1d1ab..97147804a49c 100644 --- a/drivers/macintosh/macio_asic.c +++ b/drivers/macintosh/macio_asic.c | |||
@@ -39,14 +39,12 @@ static struct macio_chip *macio_on_hold; | |||
39 | 39 | ||
40 | static int macio_bus_match(struct device *dev, struct device_driver *drv) | 40 | static int macio_bus_match(struct device *dev, struct device_driver *drv) |
41 | { | 41 | { |
42 | struct macio_dev * macio_dev = to_macio_device(dev); | 42 | const struct of_device_id * matches = drv->of_match_table; |
43 | struct macio_driver * macio_drv = to_macio_driver(drv); | ||
44 | const struct of_device_id * matches = macio_drv->match_table; | ||
45 | 43 | ||
46 | if (!matches) | 44 | if (!matches) |
47 | return 0; | 45 | return 0; |
48 | 46 | ||
49 | return of_match_device(matches, &macio_dev->ofdev) != NULL; | 47 | return of_match_device(matches, dev) != NULL; |
50 | } | 48 | } |
51 | 49 | ||
52 | struct macio_dev *macio_dev_get(struct macio_dev *dev) | 50 | struct macio_dev *macio_dev_get(struct macio_dev *dev) |
@@ -84,7 +82,7 @@ static int macio_device_probe(struct device *dev) | |||
84 | 82 | ||
85 | macio_dev_get(macio_dev); | 83 | macio_dev_get(macio_dev); |
86 | 84 | ||
87 | match = of_match_device(drv->match_table, &macio_dev->ofdev); | 85 | match = of_match_device(drv->driver.of_match_table, dev); |
88 | if (match) | 86 | if (match) |
89 | error = drv->probe(macio_dev, match); | 87 | error = drv->probe(macio_dev, match); |
90 | if (error) | 88 | if (error) |
@@ -248,7 +246,7 @@ static void macio_create_fixup_irq(struct macio_dev *dev, int index, | |||
248 | 246 | ||
249 | static void macio_add_missing_resources(struct macio_dev *dev) | 247 | static void macio_add_missing_resources(struct macio_dev *dev) |
250 | { | 248 | { |
251 | struct device_node *np = dev->ofdev.node; | 249 | struct device_node *np = dev->ofdev.dev.of_node; |
252 | unsigned int irq_base; | 250 | unsigned int irq_base; |
253 | 251 | ||
254 | /* Gatwick has some missing interrupts on child nodes */ | 252 | /* Gatwick has some missing interrupts on child nodes */ |
@@ -289,7 +287,7 @@ static void macio_add_missing_resources(struct macio_dev *dev) | |||
289 | 287 | ||
290 | static void macio_setup_interrupts(struct macio_dev *dev) | 288 | static void macio_setup_interrupts(struct macio_dev *dev) |
291 | { | 289 | { |
292 | struct device_node *np = dev->ofdev.node; | 290 | struct device_node *np = dev->ofdev.dev.of_node; |
293 | unsigned int irq; | 291 | unsigned int irq; |
294 | int i = 0, j = 0; | 292 | int i = 0, j = 0; |
295 | 293 | ||
@@ -317,7 +315,7 @@ static void macio_setup_interrupts(struct macio_dev *dev) | |||
317 | static void macio_setup_resources(struct macio_dev *dev, | 315 | static void macio_setup_resources(struct macio_dev *dev, |
318 | struct resource *parent_res) | 316 | struct resource *parent_res) |
319 | { | 317 | { |
320 | struct device_node *np = dev->ofdev.node; | 318 | struct device_node *np = dev->ofdev.dev.of_node; |
321 | struct resource r; | 319 | struct resource r; |
322 | int index; | 320 | int index; |
323 | 321 | ||
@@ -373,9 +371,9 @@ static struct macio_dev * macio_add_one_device(struct macio_chip *chip, | |||
373 | 371 | ||
374 | dev->bus = &chip->lbus; | 372 | dev->bus = &chip->lbus; |
375 | dev->media_bay = in_bay; | 373 | dev->media_bay = in_bay; |
376 | dev->ofdev.node = np; | 374 | dev->ofdev.dev.of_node = np; |
377 | dev->ofdev.dma_mask = 0xffffffffUL; | 375 | dev->ofdev.archdata.dma_mask = 0xffffffffUL; |
378 | dev->ofdev.dev.dma_mask = &dev->ofdev.dma_mask; | 376 | dev->ofdev.dev.dma_mask = &dev->ofdev.archdata.dma_mask; |
379 | dev->ofdev.dev.parent = parent; | 377 | dev->ofdev.dev.parent = parent; |
380 | dev->ofdev.dev.bus = &macio_bus_type; | 378 | dev->ofdev.dev.bus = &macio_bus_type; |
381 | dev->ofdev.dev.release = macio_release_dev; | 379 | dev->ofdev.dev.release = macio_release_dev; |
@@ -494,9 +492,9 @@ static void macio_pci_add_devices(struct macio_chip *chip) | |||
494 | } | 492 | } |
495 | 493 | ||
496 | /* Add media bay devices if any */ | 494 | /* Add media bay devices if any */ |
495 | pnode = mbdev->ofdev.dev.of_node; | ||
497 | if (mbdev) | 496 | if (mbdev) |
498 | for (np = NULL; (np = of_get_next_child(mbdev->ofdev.node, np)) | 497 | for (np = NULL; (np = of_get_next_child(pnode, np)) != NULL;) { |
499 | != NULL;) { | ||
500 | if (macio_skip_device(np)) | 498 | if (macio_skip_device(np)) |
501 | continue; | 499 | continue; |
502 | of_node_get(np); | 500 | of_node_get(np); |
@@ -506,9 +504,9 @@ static void macio_pci_add_devices(struct macio_chip *chip) | |||
506 | } | 504 | } |
507 | 505 | ||
508 | /* Add serial ports if any */ | 506 | /* Add serial ports if any */ |
507 | pnode = sdev->ofdev.dev.of_node; | ||
509 | if (sdev) { | 508 | if (sdev) { |
510 | for (np = NULL; (np = of_get_next_child(sdev->ofdev.node, np)) | 509 | for (np = NULL; (np = of_get_next_child(pnode, np)) != NULL;) { |
511 | != NULL;) { | ||
512 | if (macio_skip_device(np)) | 510 | if (macio_skip_device(np)) |
513 | continue; | 511 | continue; |
514 | of_node_get(np); | 512 | of_node_get(np); |
diff --git a/drivers/macintosh/macio_sysfs.c b/drivers/macintosh/macio_sysfs.c index 9e9453b58425..6999ce59fd10 100644 --- a/drivers/macintosh/macio_sysfs.c +++ b/drivers/macintosh/macio_sysfs.c | |||
@@ -9,7 +9,7 @@ field##_show (struct device *dev, struct device_attribute *attr, \ | |||
9 | char *buf) \ | 9 | char *buf) \ |
10 | { \ | 10 | { \ |
11 | struct macio_dev *mdev = to_macio_device (dev); \ | 11 | struct macio_dev *mdev = to_macio_device (dev); \ |
12 | return sprintf (buf, format_string, mdev->ofdev.node->field); \ | 12 | return sprintf (buf, format_string, mdev->ofdev.dev.of_node->field); \ |
13 | } | 13 | } |
14 | 14 | ||
15 | static ssize_t | 15 | static ssize_t |
@@ -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 = of_get_property(of->node, "compatible", &cplen); | 24 | compat = of_get_property(of->dev.of_node, "compatible", &cplen); |
25 | if (!compat) { | 25 | if (!compat) { |
26 | *buf = '\0'; | 26 | *buf = '\0'; |
27 | return 0; | 27 | return 0; |
@@ -58,7 +58,7 @@ static ssize_t devspec_show(struct device *dev, | |||
58 | struct of_device *ofdev; | 58 | struct of_device *ofdev; |
59 | 59 | ||
60 | ofdev = to_of_device(dev); | 60 | ofdev = to_of_device(dev); |
61 | return sprintf(buf, "%s\n", ofdev->node->full_name); | 61 | return sprintf(buf, "%s\n", ofdev->dev.of_node->full_name); |
62 | } | 62 | } |
63 | 63 | ||
64 | macio_config_of_attr (name, "%s\n"); | 64 | macio_config_of_attr (name, "%s\n"); |
diff --git a/drivers/macintosh/mediabay.c b/drivers/macintosh/mediabay.c index 08002b88f342..288acce76b74 100644 --- a/drivers/macintosh/mediabay.c +++ b/drivers/macintosh/mediabay.c | |||
@@ -564,7 +564,7 @@ static int __devinit media_bay_attach(struct macio_dev *mdev, const struct of_de | |||
564 | unsigned long base; | 564 | unsigned long base; |
565 | int i; | 565 | int i; |
566 | 566 | ||
567 | ofnode = mdev->ofdev.node; | 567 | ofnode = mdev->ofdev.dev.of_node; |
568 | 568 | ||
569 | if (macio_resource_count(mdev) < 1) | 569 | if (macio_resource_count(mdev) < 1) |
570 | return -ENODEV; | 570 | return -ENODEV; |
diff --git a/drivers/macintosh/rack-meter.c b/drivers/macintosh/rack-meter.c index 7c54d80c4fb2..12946c5f583f 100644 --- a/drivers/macintosh/rack-meter.c +++ b/drivers/macintosh/rack-meter.c | |||
@@ -375,7 +375,7 @@ static int __devinit rackmeter_probe(struct macio_dev* mdev, | |||
375 | pr_debug("rackmeter_probe()\n"); | 375 | pr_debug("rackmeter_probe()\n"); |
376 | 376 | ||
377 | /* Get i2s-a node */ | 377 | /* Get i2s-a node */ |
378 | while ((i2s = of_get_next_child(mdev->ofdev.node, i2s)) != NULL) | 378 | while ((i2s = of_get_next_child(mdev->ofdev.dev.of_node, i2s)) != NULL) |
379 | if (strcmp(i2s->name, "i2s-a") == 0) | 379 | if (strcmp(i2s->name, "i2s-a") == 0) |
380 | break; | 380 | break; |
381 | if (i2s == NULL) { | 381 | if (i2s == NULL) { |
@@ -431,7 +431,7 @@ static int __devinit rackmeter_probe(struct macio_dev* mdev, | |||
431 | of_address_to_resource(i2s, 1, &rdma)) { | 431 | of_address_to_resource(i2s, 1, &rdma)) { |
432 | printk(KERN_ERR | 432 | printk(KERN_ERR |
433 | "rackmeter: found match but lacks resources: %s", | 433 | "rackmeter: found match but lacks resources: %s", |
434 | mdev->ofdev.node->full_name); | 434 | mdev->ofdev.dev.of_node->full_name); |
435 | rc = -ENXIO; | 435 | rc = -ENXIO; |
436 | goto bail_free; | 436 | goto bail_free; |
437 | } | 437 | } |
diff --git a/drivers/macintosh/smu.c b/drivers/macintosh/smu.c index 888448cf7f1f..2506c957712e 100644 --- a/drivers/macintosh/smu.c +++ b/drivers/macintosh/smu.c | |||
@@ -671,8 +671,11 @@ static const struct of_device_id smu_platform_match[] = | |||
671 | 671 | ||
672 | static struct of_platform_driver smu_of_platform_driver = | 672 | static struct of_platform_driver smu_of_platform_driver = |
673 | { | 673 | { |
674 | .name = "smu", | 674 | .driver = { |
675 | .match_table = smu_platform_match, | 675 | .name = "smu", |
676 | .owner = THIS_MODULE, | ||
677 | .of_match_table = smu_platform_match, | ||
678 | }, | ||
676 | .probe = smu_platform_probe, | 679 | .probe = smu_platform_probe, |
677 | }; | 680 | }; |
678 | 681 | ||
@@ -1183,8 +1186,10 @@ static ssize_t smu_read_command(struct file *file, struct smu_private *pp, | |||
1183 | return -EOVERFLOW; | 1186 | return -EOVERFLOW; |
1184 | spin_lock_irqsave(&pp->lock, flags); | 1187 | spin_lock_irqsave(&pp->lock, flags); |
1185 | if (pp->cmd.status == 1) { | 1188 | if (pp->cmd.status == 1) { |
1186 | if (file->f_flags & O_NONBLOCK) | 1189 | if (file->f_flags & O_NONBLOCK) { |
1190 | spin_unlock_irqrestore(&pp->lock, flags); | ||
1187 | return -EAGAIN; | 1191 | return -EAGAIN; |
1192 | } | ||
1188 | add_wait_queue(&pp->wait, &wait); | 1193 | add_wait_queue(&pp->wait, &wait); |
1189 | for (;;) { | 1194 | for (;;) { |
1190 | set_current_state(TASK_INTERRUPTIBLE); | 1195 | set_current_state(TASK_INTERRUPTIBLE); |
diff --git a/drivers/macintosh/therm_adt746x.c b/drivers/macintosh/therm_adt746x.c index c42eeb43042d..16d82f17ae82 100644 --- a/drivers/macintosh/therm_adt746x.c +++ b/drivers/macintosh/therm_adt746x.c | |||
@@ -182,6 +182,7 @@ remove_thermostat(struct i2c_client *client) | |||
182 | 182 | ||
183 | thermostat = NULL; | 183 | thermostat = NULL; |
184 | 184 | ||
185 | i2c_set_clientdata(client, NULL); | ||
185 | kfree(th); | 186 | kfree(th); |
186 | 187 | ||
187 | return 0; | 188 | return 0; |
@@ -399,6 +400,7 @@ static int probe_thermostat(struct i2c_client *client, | |||
399 | rc = read_reg(th, CONFIG_REG); | 400 | rc = read_reg(th, CONFIG_REG); |
400 | if (rc < 0) { | 401 | if (rc < 0) { |
401 | dev_err(&client->dev, "Thermostat failed to read config!\n"); | 402 | dev_err(&client->dev, "Thermostat failed to read config!\n"); |
403 | i2c_set_clientdata(client, NULL); | ||
402 | kfree(th); | 404 | kfree(th); |
403 | return -ENODEV; | 405 | return -ENODEV; |
404 | } | 406 | } |
diff --git a/drivers/macintosh/therm_pm72.c b/drivers/macintosh/therm_pm72.c index b18fa948f3d1..e60605bd0ea9 100644 --- a/drivers/macintosh/therm_pm72.c +++ b/drivers/macintosh/therm_pm72.c | |||
@@ -2215,7 +2215,7 @@ static int fcu_of_probe(struct of_device* dev, const struct of_device_id *match) | |||
2215 | state = state_detached; | 2215 | state = state_detached; |
2216 | 2216 | ||
2217 | /* Lookup the fans in the device tree */ | 2217 | /* Lookup the fans in the device tree */ |
2218 | fcu_lookup_fans(dev->node); | 2218 | fcu_lookup_fans(dev->dev.of_node); |
2219 | 2219 | ||
2220 | /* Add the driver */ | 2220 | /* Add the driver */ |
2221 | return i2c_add_driver(&therm_pm72_driver); | 2221 | return i2c_add_driver(&therm_pm72_driver); |
@@ -2238,8 +2238,11 @@ static const struct of_device_id fcu_match[] = | |||
2238 | 2238 | ||
2239 | static struct of_platform_driver fcu_of_platform_driver = | 2239 | static struct of_platform_driver fcu_of_platform_driver = |
2240 | { | 2240 | { |
2241 | .name = "temperature", | 2241 | .driver = { |
2242 | .match_table = fcu_match, | 2242 | .name = "temperature", |
2243 | .owner = THIS_MODULE, | ||
2244 | .of_match_table = fcu_match, | ||
2245 | }, | ||
2243 | .probe = fcu_of_probe, | 2246 | .probe = fcu_of_probe, |
2244 | .remove = fcu_of_remove | 2247 | .remove = fcu_of_remove |
2245 | }; | 2248 | }; |
diff --git a/drivers/macintosh/therm_windtunnel.c b/drivers/macintosh/therm_windtunnel.c index 0839770e4ec5..5c9367acf0cf 100644 --- a/drivers/macintosh/therm_windtunnel.c +++ b/drivers/macintosh/therm_windtunnel.c | |||
@@ -463,8 +463,11 @@ static const struct of_device_id therm_of_match[] = {{ | |||
463 | }; | 463 | }; |
464 | 464 | ||
465 | static struct of_platform_driver therm_of_driver = { | 465 | static struct of_platform_driver therm_of_driver = { |
466 | .name = "temperature", | 466 | .driver = { |
467 | .match_table = therm_of_match, | 467 | .name = "temperature", |
468 | .owner = THIS_MODULE, | ||
469 | .of_match_table = therm_of_match, | ||
470 | }, | ||
468 | .probe = therm_of_probe, | 471 | .probe = therm_of_probe, |
469 | .remove = therm_of_remove, | 472 | .remove = therm_of_remove, |
470 | }; | 473 | }; |
diff --git a/drivers/macintosh/windfarm_pm81.c b/drivers/macintosh/windfarm_pm81.c index 565d5b2adc95..749d174b0dc6 100644 --- a/drivers/macintosh/windfarm_pm81.c +++ b/drivers/macintosh/windfarm_pm81.c | |||
@@ -188,7 +188,7 @@ struct wf_smu_sys_fans_state { | |||
188 | }; | 188 | }; |
189 | 189 | ||
190 | /* | 190 | /* |
191 | * Configs for SMU Sytem Fan control loop | 191 | * Configs for SMU System Fan control loop |
192 | */ | 192 | */ |
193 | static struct wf_smu_sys_fans_param wf_smu_sys_all_params[] = { | 193 | static struct wf_smu_sys_fans_param wf_smu_sys_all_params[] = { |
194 | /* Model ID 2 */ | 194 | /* Model ID 2 */ |
@@ -757,10 +757,8 @@ static int __devexit wf_smu_remove(struct platform_device *ddev) | |||
757 | wf_put_control(cpufreq_clamp); | 757 | wf_put_control(cpufreq_clamp); |
758 | 758 | ||
759 | /* Destroy control loops state structures */ | 759 | /* Destroy control loops state structures */ |
760 | if (wf_smu_sys_fans) | 760 | kfree(wf_smu_sys_fans); |
761 | kfree(wf_smu_sys_fans); | 761 | kfree(wf_smu_cpu_fans); |
762 | if (wf_smu_cpu_fans) | ||
763 | kfree(wf_smu_cpu_fans); | ||
764 | 762 | ||
765 | return 0; | 763 | return 0; |
766 | } | 764 | } |
diff --git a/drivers/macintosh/windfarm_pm91.c b/drivers/macintosh/windfarm_pm91.c index bea99168ff35..344273235124 100644 --- a/drivers/macintosh/windfarm_pm91.c +++ b/drivers/macintosh/windfarm_pm91.c | |||
@@ -687,12 +687,9 @@ static int __devexit wf_smu_remove(struct platform_device *ddev) | |||
687 | wf_put_control(cpufreq_clamp); | 687 | wf_put_control(cpufreq_clamp); |
688 | 688 | ||
689 | /* Destroy control loops state structures */ | 689 | /* Destroy control loops state structures */ |
690 | if (wf_smu_slots_fans) | 690 | kfree(wf_smu_slots_fans); |
691 | kfree(wf_smu_cpu_fans); | 691 | kfree(wf_smu_drive_fans); |
692 | if (wf_smu_drive_fans) | 692 | kfree(wf_smu_cpu_fans); |
693 | kfree(wf_smu_cpu_fans); | ||
694 | if (wf_smu_cpu_fans) | ||
695 | kfree(wf_smu_cpu_fans); | ||
696 | 693 | ||
697 | return 0; | 694 | return 0; |
698 | } | 695 | } |