diff options
Diffstat (limited to 'usr/src')
| -rw-r--r-- | usr/src/dkms_source_tree/applesmc.c | 68 | ||||
| -rw-r--r-- | usr/src/dkms_source_tree/dkms.conf | 2 |
2 files changed, 31 insertions, 39 deletions
diff --git a/usr/src/dkms_source_tree/applesmc.c b/usr/src/dkms_source_tree/applesmc.c index 7af6fe0..b6598aa 100644 --- a/usr/src/dkms_source_tree/applesmc.c +++ b/usr/src/dkms_source_tree/applesmc.c | |||
| @@ -209,6 +209,9 @@ static unsigned int applesmc_accelerometer; | |||
| 209 | /* Indicates whether this computer has light sensors and keyboard backlight. */ | 209 | /* Indicates whether this computer has light sensors and keyboard backlight. */ |
| 210 | static unsigned int applesmc_light; | 210 | static unsigned int applesmc_light; |
| 211 | 211 | ||
| 212 | /* The number of fans handled by the driver */ | ||
| 213 | static unsigned int fans_handled; | ||
| 214 | |||
| 212 | /* Indicates which temperature sensors set to use. */ | 215 | /* Indicates which temperature sensors set to use. */ |
| 213 | static unsigned int applesmc_temperature_set; | 216 | static unsigned int applesmc_temperature_set; |
| 214 | 217 | ||
| @@ -1387,8 +1390,9 @@ static struct attribute *temperature_attributes[] = { | |||
| 1387 | static const struct attribute_group temperature_attributes_group = | 1390 | static const struct attribute_group temperature_attributes_group = |
| 1388 | { .attrs = temperature_attributes }; | 1391 | { .attrs = temperature_attributes }; |
| 1389 | 1392 | ||
| 1390 | static const struct attribute_group label_attributes_group = | 1393 | static const struct attribute_group label_attributes_group = { |
| 1391 | { .attrs = label_attributes }; | 1394 | .attrs = label_attributes |
| 1395 | }; | ||
| 1392 | 1396 | ||
| 1393 | /* Module stuff */ | 1397 | /* Module stuff */ |
| 1394 | 1398 | ||
| @@ -1668,39 +1672,24 @@ static int __init applesmc_init(void) | |||
| 1668 | 1672 | ||
| 1669 | /* create fan files */ | 1673 | /* create fan files */ |
| 1670 | count = applesmc_get_fan_count(); | 1674 | count = applesmc_get_fan_count(); |
| 1671 | if (count < 0) { | 1675 | if (count < 0) |
| 1672 | printk(KERN_ERR "applesmc: Cannot get the number of fans.\n"); | 1676 | printk(KERN_ERR "applesmc: Cannot get the number of fans.\n"); |
| 1673 | } else { | 1677 | else |
| 1674 | printk(KERN_INFO "applesmc: %d fans found.\n", count); | 1678 | printk(KERN_INFO "applesmc: %d fans found.\n", count); |
| 1675 | 1679 | ||
| 1676 | switch (count) { | 1680 | if (count > 4) { |
| 1677 | default: | 1681 | count = 4; |
| 1678 | printk(KERN_WARNING "applesmc: More than 4 fans found," | 1682 | printk(KERN_WARNING "applesmc: More than 4 fans found," |
| 1679 | " but at most 4 fans are supported" | 1683 | " but at most 4 fans are supported" |
| 1680 | " by the driver.\n"); | 1684 | " by the driver.\n"); |
| 1681 | case 4: | 1685 | } |
| 1682 | ret = sysfs_create_group(&pdev->dev.kobj, | 1686 | |
| 1683 | &fan_attribute_groups[3]); | 1687 | while (fans_handled < count) { |
| 1684 | if (ret) | 1688 | ret = sysfs_create_group(&pdev->dev.kobj, |
| 1685 | goto out_key_enumeration; | 1689 | &fan_attribute_groups[fans_handled]); |
| 1686 | case 3: | 1690 | if (ret) |
| 1687 | ret = sysfs_create_group(&pdev->dev.kobj, | 1691 | goto out_fans; |
| 1688 | &fan_attribute_groups[2]); | 1692 | fans_handled++; |
| 1689 | if (ret) | ||
| 1690 | goto out_key_enumeration; | ||
| 1691 | case 2: | ||
| 1692 | ret = sysfs_create_group(&pdev->dev.kobj, | ||
| 1693 | &fan_attribute_groups[1]); | ||
| 1694 | if (ret) | ||
| 1695 | goto out_key_enumeration; | ||
| 1696 | case 1: | ||
| 1697 | ret = sysfs_create_group(&pdev->dev.kobj, | ||
| 1698 | &fan_attribute_groups[0]); | ||
| 1699 | if (ret) | ||
| 1700 | goto out_fan_1; | ||
| 1701 | case 0: | ||
| 1702 | ; | ||
| 1703 | } | ||
| 1704 | } | 1693 | } |
| 1705 | 1694 | ||
| 1706 | for (i = 0; | 1695 | for (i = 0; |
| @@ -1717,6 +1706,8 @@ static int __init applesmc_init(void) | |||
| 1717 | } | 1706 | } |
| 1718 | ret = sysfs_create_file(&pdev->dev.kobj, | 1707 | ret = sysfs_create_file(&pdev->dev.kobj, |
| 1719 | temperature_attributes[i]); | 1708 | temperature_attributes[i]); |
| 1709 | if (ret) | ||
| 1710 | goto out_temperature; | ||
| 1720 | ret = sysfs_create_file(&pdev->dev.kobj, | 1711 | ret = sysfs_create_file(&pdev->dev.kobj, |
| 1721 | label_attributes[i]); | 1712 | label_attributes[i]); |
| 1722 | if (ret) | 1713 | if (ret) |
| @@ -1773,10 +1764,10 @@ out_accelerometer: | |||
| 1773 | out_temperature: | 1764 | out_temperature: |
| 1774 | sysfs_remove_group(&pdev->dev.kobj, &label_attributes_group); | 1765 | sysfs_remove_group(&pdev->dev.kobj, &label_attributes_group); |
| 1775 | sysfs_remove_group(&pdev->dev.kobj, &temperature_attributes_group); | 1766 | sysfs_remove_group(&pdev->dev.kobj, &temperature_attributes_group); |
| 1776 | sysfs_remove_group(&pdev->dev.kobj, &fan_attribute_groups[0]); | 1767 | out_fans: |
| 1777 | out_fan_1: | 1768 | while (fans_handled) |
| 1778 | sysfs_remove_group(&pdev->dev.kobj, &fan_attribute_groups[1]); | 1769 | sysfs_remove_group(&pdev->dev.kobj, |
| 1779 | out_key_enumeration: | 1770 | &fan_attribute_groups[--fans_handled]); |
| 1780 | sysfs_remove_group(&pdev->dev.kobj, &key_enumeration_group); | 1771 | sysfs_remove_group(&pdev->dev.kobj, &key_enumeration_group); |
| 1781 | out_name: | 1772 | out_name: |
| 1782 | sysfs_remove_file(&pdev->dev.kobj, &dev_attr_name.attr); | 1773 | sysfs_remove_file(&pdev->dev.kobj, &dev_attr_name.attr); |
| @@ -1803,8 +1794,9 @@ static void __exit applesmc_exit(void) | |||
| 1803 | applesmc_release_accelerometer(); | 1794 | applesmc_release_accelerometer(); |
| 1804 | sysfs_remove_group(&pdev->dev.kobj, &label_attributes_group); | 1795 | sysfs_remove_group(&pdev->dev.kobj, &label_attributes_group); |
| 1805 | sysfs_remove_group(&pdev->dev.kobj, &temperature_attributes_group); | 1796 | sysfs_remove_group(&pdev->dev.kobj, &temperature_attributes_group); |
| 1806 | sysfs_remove_group(&pdev->dev.kobj, &fan_attribute_groups[0]); | 1797 | while (fans_handled) |
| 1807 | sysfs_remove_group(&pdev->dev.kobj, &fan_attribute_groups[1]); | 1798 | sysfs_remove_group(&pdev->dev.kobj, |
| 1799 | &fan_attribute_groups[--fans_handled]); | ||
| 1808 | sysfs_remove_group(&pdev->dev.kobj, &key_enumeration_group); | 1800 | sysfs_remove_group(&pdev->dev.kobj, &key_enumeration_group); |
| 1809 | sysfs_remove_file(&pdev->dev.kobj, &dev_attr_name.attr); | 1801 | sysfs_remove_file(&pdev->dev.kobj, &dev_attr_name.attr); |
| 1810 | platform_device_unregister(pdev); | 1802 | platform_device_unregister(pdev); |
diff --git a/usr/src/dkms_source_tree/dkms.conf b/usr/src/dkms_source_tree/dkms.conf index 141298a..0e3b9fe 100644 --- a/usr/src/dkms_source_tree/dkms.conf +++ b/usr/src/dkms_source_tree/dkms.conf | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | NAME=applesmc | 1 | NAME=applesmc |
| 2 | VERSION=0.16.0 | 2 | VERSION=0.16.1 |
| 3 | PACKAGE_NAME="$NAME" | 3 | PACKAGE_NAME="$NAME" |
| 4 | PACKAGE_VERSION="$VERSION" | 4 | PACKAGE_VERSION="$VERSION" |
| 5 | MAKE[0]="make -C ${kernel_source_dir} | 5 | MAKE[0]="make -C ${kernel_source_dir} |
