Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 151026
b: refs/heads/master
c: 996cadb
h: refs/heads/master
v: v3
  • Loading branch information
Hans de Goede authored and Jean Delvare committed Jun 15, 2009
1 parent 5fc44fa commit 9aded2b
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 14 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3fc7838a20cdd9aab0077f355b8c44135cd4b6bd
refs/heads/master: 996cadb2bf3787adcf4e164e1b351966c9e787f6
36 changes: 23 additions & 13 deletions trunk/drivers/hwmon/f71882fg.c
Original file line number Diff line number Diff line change
Expand Up @@ -1735,19 +1735,6 @@ static int __devinit f71882fg_probe(struct platform_device *pdev)
goto exit_free;
}

data->pwm_enable = f71882fg_read8(data, F71882FG_REG_PWM_ENABLE);
/* If it is a 71862 and the fan / pwm part is enabled sanity check
the pwm settings */
if (data->type == f71862fg && (start_reg & 0x02)) {
if ((data->pwm_enable & 0x15) != 0x15) {
dev_err(&pdev->dev,
"Invalid (reserved) pwm settings: 0x%02x\n",
(unsigned int)data->pwm_enable);
err = -ENODEV;
goto exit_free;
}
}

/* Register sysfs interface files */
err = device_create_file(&pdev->dev, &dev_attr_name);
if (err)
Expand Down Expand Up @@ -1778,6 +1765,29 @@ static int __devinit f71882fg_probe(struct platform_device *pdev)
}

if (start_reg & 0x02) {
data->pwm_enable =
f71882fg_read8(data, F71882FG_REG_PWM_ENABLE);

/* Sanity check the pwm settings */
switch (data->type) {
case f71862fg:
err = (data->pwm_enable & 0x15) != 0x15;
break;
case f71882fg:
err = 0;
break;
case f8000:
err = data->pwm_enable & 0x20;
break;
}
if (err) {
dev_err(&pdev->dev,
"Invalid (reserved) pwm settings: 0x%02x\n",
(unsigned int)data->pwm_enable);
err = -ENODEV;
goto exit_unregister_sysfs;
}

err = f71882fg_create_sysfs_files(pdev, fxxxx_fan_attr,
ARRAY_SIZE(fxxxx_fan_attr));
if (err)
Expand Down

0 comments on commit 9aded2b

Please sign in to comment.