aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/macintosh
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/macintosh')
-rw-r--r--drivers/macintosh/macio_asic.c7
-rw-r--r--drivers/macintosh/therm_pm72.c30
2 files changed, 8 insertions, 29 deletions
diff --git a/drivers/macintosh/macio_asic.c b/drivers/macintosh/macio_asic.c
index b6e7ddc09d76..4daf9e5a7736 100644
--- a/drivers/macintosh/macio_asic.c
+++ b/drivers/macintosh/macio_asic.c
@@ -387,11 +387,10 @@ static struct macio_dev * macio_add_one_device(struct macio_chip *chip,
387 /* Set the DMA ops to the ones from the PCI device, this could be 387 /* Set the DMA ops to the ones from the PCI device, this could be
388 * fishy if we didn't know that on PowerMac it's always direct ops 388 * fishy if we didn't know that on PowerMac it's always direct ops
389 * or iommu ops that will work fine 389 * or iommu ops that will work fine
390 *
391 * To get all the fields, copy all archdata
390 */ 392 */
391 dev->ofdev.dev.archdata.dma_ops = 393 dev->ofdev.dev.archdata = chip->lbus.pdev->dev.archdata;
392 chip->lbus.pdev->dev.archdata.dma_ops;
393 dev->ofdev.dev.archdata.dma_data =
394 chip->lbus.pdev->dev.archdata.dma_data;
395#endif /* CONFIG_PCI */ 394#endif /* CONFIG_PCI */
396 395
397#ifdef DEBUG 396#ifdef DEBUG
diff --git a/drivers/macintosh/therm_pm72.c b/drivers/macintosh/therm_pm72.c
index 44549272333c..2e041fd0a00c 100644
--- a/drivers/macintosh/therm_pm72.c
+++ b/drivers/macintosh/therm_pm72.c
@@ -2213,6 +2213,9 @@ static void fcu_lookup_fans(struct device_node *fcu_node)
2213static int fcu_of_probe(struct platform_device* dev, const struct of_device_id *match) 2213static int fcu_of_probe(struct platform_device* dev, const struct of_device_id *match)
2214{ 2214{
2215 state = state_detached; 2215 state = state_detached;
2216 of_dev = dev;
2217
2218 dev_info(&dev->dev, "PowerMac G5 Thermal control driver %s\n", VERSION);
2216 2219
2217 /* Lookup the fans in the device tree */ 2220 /* Lookup the fans in the device tree */
2218 fcu_lookup_fans(dev->dev.of_node); 2221 fcu_lookup_fans(dev->dev.of_node);
@@ -2235,6 +2238,7 @@ static const struct of_device_id fcu_match[] =
2235 }, 2238 },
2236 {}, 2239 {},
2237}; 2240};
2241MODULE_DEVICE_TABLE(of, fcu_match);
2238 2242
2239static struct of_platform_driver fcu_of_platform_driver = 2243static struct of_platform_driver fcu_of_platform_driver =
2240{ 2244{
@@ -2252,8 +2256,6 @@ static struct of_platform_driver fcu_of_platform_driver =
2252 */ 2256 */
2253static int __init therm_pm72_init(void) 2257static int __init therm_pm72_init(void)
2254{ 2258{
2255 struct device_node *np;
2256
2257 rackmac = of_machine_is_compatible("RackMac3,1"); 2259 rackmac = of_machine_is_compatible("RackMac3,1");
2258 2260
2259 if (!of_machine_is_compatible("PowerMac7,2") && 2261 if (!of_machine_is_compatible("PowerMac7,2") &&
@@ -2261,34 +2263,12 @@ static int __init therm_pm72_init(void)
2261 !rackmac) 2263 !rackmac)
2262 return -ENODEV; 2264 return -ENODEV;
2263 2265
2264 printk(KERN_INFO "PowerMac G5 Thermal control driver %s\n", VERSION); 2266 return of_register_platform_driver(&fcu_of_platform_driver);
2265
2266 np = of_find_node_by_type(NULL, "fcu");
2267 if (np == NULL) {
2268 /* Some machines have strangely broken device-tree */
2269 np = of_find_node_by_path("/u3@0,f8000000/i2c@f8001000/fan@15e");
2270 if (np == NULL) {
2271 printk(KERN_ERR "Can't find FCU in device-tree !\n");
2272 return -ENODEV;
2273 }
2274 }
2275 of_dev = of_platform_device_create(np, "temperature", NULL);
2276 if (of_dev == NULL) {
2277 printk(KERN_ERR "Can't register FCU platform device !\n");
2278 return -ENODEV;
2279 }
2280
2281 of_register_platform_driver(&fcu_of_platform_driver);
2282
2283 return 0;
2284} 2267}
2285 2268
2286static void __exit therm_pm72_exit(void) 2269static void __exit therm_pm72_exit(void)
2287{ 2270{
2288 of_unregister_platform_driver(&fcu_of_platform_driver); 2271 of_unregister_platform_driver(&fcu_of_platform_driver);
2289
2290 if (of_dev)
2291 of_device_unregister(of_dev);
2292} 2272}
2293 2273
2294module_init(therm_pm72_init); 2274module_init(therm_pm72_init);