diff options
Diffstat (limited to 'drivers/platform/x86/asus-wmi.c')
-rw-r--r-- | drivers/platform/x86/asus-wmi.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c index 65b66aa44c78..bcb9fb41ddc4 100644 --- a/drivers/platform/x86/asus-wmi.c +++ b/drivers/platform/x86/asus-wmi.c | |||
@@ -797,8 +797,8 @@ exit: | |||
797 | * Hwmon device | 797 | * Hwmon device |
798 | */ | 798 | */ |
799 | static ssize_t asus_hwmon_pwm1(struct device *dev, | 799 | static ssize_t asus_hwmon_pwm1(struct device *dev, |
800 | struct device_attribute *attr, | 800 | struct device_attribute *attr, |
801 | char *buf) | 801 | char *buf) |
802 | { | 802 | { |
803 | struct asus_wmi *asus = dev_get_drvdata(dev); | 803 | struct asus_wmi *asus = dev_get_drvdata(dev); |
804 | u32 value; | 804 | u32 value; |
@@ -809,7 +809,7 @@ static ssize_t asus_hwmon_pwm1(struct device *dev, | |||
809 | if (err < 0) | 809 | if (err < 0) |
810 | return err; | 810 | return err; |
811 | 811 | ||
812 | value |= 0xFF; | 812 | value &= 0xFF; |
813 | 813 | ||
814 | if (value == 1) /* Low Speed */ | 814 | if (value == 1) /* Low Speed */ |
815 | value = 85; | 815 | value = 85; |
@@ -869,7 +869,7 @@ static mode_t asus_hwmon_sysfs_is_visible(struct kobject *kobj, | |||
869 | * - reverved bits are non-zero | 869 | * - reverved bits are non-zero |
870 | * - sfun and presence bit are not set | 870 | * - sfun and presence bit are not set |
871 | */ | 871 | */ |
872 | if (value != ASUS_WMI_UNSUPPORTED_METHOD || value & 0xFFF80000 | 872 | if (value == ASUS_WMI_UNSUPPORTED_METHOD || value & 0xFFF80000 |
873 | || (!asus->sfun && !(value & ASUS_WMI_DSTS_PRESENCE_BIT))) | 873 | || (!asus->sfun && !(value & ASUS_WMI_DSTS_PRESENCE_BIT))) |
874 | ok = false; | 874 | ok = false; |
875 | } | 875 | } |
@@ -904,6 +904,7 @@ static int asus_wmi_hwmon_init(struct asus_wmi *asus) | |||
904 | pr_err("Could not register asus hwmon device\n"); | 904 | pr_err("Could not register asus hwmon device\n"); |
905 | return PTR_ERR(hwmon); | 905 | return PTR_ERR(hwmon); |
906 | } | 906 | } |
907 | dev_set_drvdata(hwmon, asus); | ||
907 | asus->hwmon_device = hwmon; | 908 | asus->hwmon_device = hwmon; |
908 | result = sysfs_create_group(&hwmon->kobj, &hwmon_attribute_group); | 909 | result = sysfs_create_group(&hwmon->kobj, &hwmon_attribute_group); |
909 | if (result) | 910 | if (result) |