diff options
Diffstat (limited to 'drivers/macintosh/smu.c')
| -rw-r--r-- | drivers/macintosh/smu.c | 26 | 
1 files changed, 3 insertions, 23 deletions
diff --git a/drivers/macintosh/smu.c b/drivers/macintosh/smu.c index 9ecd76849e35..db2ae71d07ef 100644 --- a/drivers/macintosh/smu.c +++ b/drivers/macintosh/smu.c  | |||
| @@ -584,34 +584,14 @@ core_initcall(smu_late_init); | |||
| 584 | * sysfs visibility | 584 | * sysfs visibility | 
| 585 | */ | 585 | */ | 
| 586 | 586 | ||
| 587 | static void smu_create_i2c(struct device_node *np) | ||
| 588 | { | ||
| 589 | char name[32]; | ||
| 590 | u32 *reg = (u32 *)get_property(np, "reg", NULL); | ||
| 591 | |||
| 592 | if (reg != NULL) { | ||
| 593 | sprintf(name, "smu-i2c-%02x", *reg); | ||
| 594 | of_platform_device_create(np, name, &smu->of_dev->dev); | ||
| 595 | } | ||
| 596 | } | ||
| 597 | |||
| 598 | static void smu_expose_childs(void *unused) | 587 | static void smu_expose_childs(void *unused) | 
| 599 | { | 588 | { | 
| 600 | struct device_node *np, *gp; | 589 | struct device_node *np; | 
| 601 | 590 | ||
| 602 | for (np = NULL; (np = of_get_next_child(smu->of_node, np)) != NULL;) { | 591 | for (np = NULL; (np = of_get_next_child(smu->of_node, np)) != NULL;) | 
| 603 | if (device_is_compatible(np, "smu-i2c-control")) { | ||
| 604 | gp = NULL; | ||
| 605 | while ((gp = of_get_next_child(np, gp)) != NULL) | ||
| 606 | if (device_is_compatible(gp, "i2c-bus")) | ||
| 607 | smu_create_i2c(gp); | ||
| 608 | } else if (device_is_compatible(np, "smu-i2c")) | ||
| 609 | smu_create_i2c(np); | ||
| 610 | if (device_is_compatible(np, "smu-sensors")) | 592 | if (device_is_compatible(np, "smu-sensors")) | 
| 611 | of_platform_device_create(np, "smu-sensors", | 593 | of_platform_device_create(np, "smu-sensors", | 
| 612 | &smu->of_dev->dev); | 594 | &smu->of_dev->dev); | 
| 613 | } | ||
| 614 | |||
| 615 | } | 595 | } | 
| 616 | 596 | ||
| 617 | static DECLARE_WORK(smu_expose_childs_work, smu_expose_childs, NULL); | 597 | static DECLARE_WORK(smu_expose_childs_work, smu_expose_childs, NULL); | 
