diff options
Diffstat (limited to 'drivers/hwmon')
-rw-r--r-- | drivers/hwmon/f75375s.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/drivers/hwmon/f75375s.c b/drivers/hwmon/f75375s.c index 472b052770d3..6892f76fc18a 100644 --- a/drivers/hwmon/f75375s.c +++ b/drivers/hwmon/f75375s.c | |||
@@ -343,7 +343,7 @@ static ssize_t set_pwm_mode(struct device *dev, struct device_attribute *attr, | |||
343 | int val = simple_strtoul(buf, NULL, 10); | 343 | int val = simple_strtoul(buf, NULL, 10); |
344 | u8 conf = 0; | 344 | u8 conf = 0; |
345 | 345 | ||
346 | if (!(val == 0 || val == 1) || data->kind == f75373) | 346 | if (!(val == 0 || val == 1)) |
347 | return -EINVAL; | 347 | return -EINVAL; |
348 | 348 | ||
349 | mutex_lock(&data->update_lock); | 349 | mutex_lock(&data->update_lock); |
@@ -549,13 +549,13 @@ static SENSOR_DEVICE_ATTR(pwm1, S_IRUGO|S_IWUSR, | |||
549 | show_pwm, set_pwm, 0); | 549 | show_pwm, set_pwm, 0); |
550 | static SENSOR_DEVICE_ATTR(pwm1_enable, S_IRUGO|S_IWUSR, | 550 | static SENSOR_DEVICE_ATTR(pwm1_enable, S_IRUGO|S_IWUSR, |
551 | show_pwm_enable, set_pwm_enable, 0); | 551 | show_pwm_enable, set_pwm_enable, 0); |
552 | static SENSOR_DEVICE_ATTR(pwm1_mode, S_IRUGO|S_IWUSR, | 552 | static SENSOR_DEVICE_ATTR(pwm1_mode, S_IRUGO, |
553 | show_pwm_mode, set_pwm_mode, 0); | 553 | show_pwm_mode, set_pwm_mode, 0); |
554 | static SENSOR_DEVICE_ATTR(pwm2, S_IRUGO | S_IWUSR, | 554 | static SENSOR_DEVICE_ATTR(pwm2, S_IRUGO | S_IWUSR, |
555 | show_pwm, set_pwm, 1); | 555 | show_pwm, set_pwm, 1); |
556 | static SENSOR_DEVICE_ATTR(pwm2_enable, S_IRUGO|S_IWUSR, | 556 | static SENSOR_DEVICE_ATTR(pwm2_enable, S_IRUGO|S_IWUSR, |
557 | show_pwm_enable, set_pwm_enable, 1); | 557 | show_pwm_enable, set_pwm_enable, 1); |
558 | static SENSOR_DEVICE_ATTR(pwm2_mode, S_IRUGO|S_IWUSR, | 558 | static SENSOR_DEVICE_ATTR(pwm2_mode, S_IRUGO, |
559 | show_pwm_mode, set_pwm_mode, 1); | 559 | show_pwm_mode, set_pwm_mode, 1); |
560 | 560 | ||
561 | static struct attribute *f75375_attributes[] = { | 561 | static struct attribute *f75375_attributes[] = { |
@@ -656,6 +656,19 @@ static int f75375_probe(struct i2c_client *client) | |||
656 | if ((err = sysfs_create_group(&client->dev.kobj, &f75375_group))) | 656 | if ((err = sysfs_create_group(&client->dev.kobj, &f75375_group))) |
657 | goto exit_free; | 657 | goto exit_free; |
658 | 658 | ||
659 | if (data->kind == f75375) { | ||
660 | err = sysfs_chmod_file(&client->dev.kobj, | ||
661 | &sensor_dev_attr_pwm1_mode.dev_attr.attr, | ||
662 | S_IRUGO | S_IWUSR); | ||
663 | if (err) | ||
664 | goto exit_remove; | ||
665 | err = sysfs_chmod_file(&client->dev.kobj, | ||
666 | &sensor_dev_attr_pwm2_mode.dev_attr.attr, | ||
667 | S_IRUGO | S_IWUSR); | ||
668 | if (err) | ||
669 | goto exit_remove; | ||
670 | } | ||
671 | |||
659 | data->hwmon_dev = hwmon_device_register(&client->dev); | 672 | data->hwmon_dev = hwmon_device_register(&client->dev); |
660 | if (IS_ERR(data->hwmon_dev)) { | 673 | if (IS_ERR(data->hwmon_dev)) { |
661 | err = PTR_ERR(data->hwmon_dev); | 674 | err = PTR_ERR(data->hwmon_dev); |