aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwmon
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/hwmon')
-rw-r--r--drivers/hwmon/w83627ehf.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/hwmon/w83627ehf.c b/drivers/hwmon/w83627ehf.c
index da5828f2dfc2..30a76404f0af 100644
--- a/drivers/hwmon/w83627ehf.c
+++ b/drivers/hwmon/w83627ehf.c
@@ -121,9 +121,9 @@ superio_exit(void)
121 * ISA constants 121 * ISA constants
122 */ 122 */
123 123
124#define REGION_ALIGNMENT ~7 124#define IOREGION_ALIGNMENT ~7
125#define REGION_OFFSET 5 125#define IOREGION_OFFSET 5
126#define REGION_LENGTH 2 126#define IOREGION_LENGTH 2
127#define ADDR_REG_OFFSET 5 127#define ADDR_REG_OFFSET 5
128#define DATA_REG_OFFSET 6 128#define DATA_REG_OFFSET 6
129 129
@@ -407,7 +407,7 @@ static void w83627ehf_write_fan_div(struct i2c_client *client, int nr)
407 break; 407 break;
408 case 4: 408 case 4:
409 reg = (w83627ehf_read_value(client, W83627EHF_REG_DIODE) & 0x73) 409 reg = (w83627ehf_read_value(client, W83627EHF_REG_DIODE) & 0x73)
410 | ((data->fan_div[4] & 0x03) << 3) 410 | ((data->fan_div[4] & 0x03) << 2)
411 | ((data->fan_div[4] & 0x04) << 5); 411 | ((data->fan_div[4] & 0x04) << 5);
412 w83627ehf_write_value(client, W83627EHF_REG_DIODE, reg); 412 w83627ehf_write_value(client, W83627EHF_REG_DIODE, reg);
413 break; 413 break;
@@ -471,9 +471,9 @@ static struct w83627ehf_data *w83627ehf_update_device(struct device *dev)
471 time */ 471 time */
472 if (data->fan[i] == 0xff 472 if (data->fan[i] == 0xff
473 && data->fan_div[i] < 0x07) { 473 && data->fan_div[i] < 0x07) {
474 dev_dbg(&client->dev, "Increasing fan %d " 474 dev_dbg(&client->dev, "Increasing fan%d "
475 "clock divider from %u to %u\n", 475 "clock divider from %u to %u\n",
476 i, div_from_reg(data->fan_div[i]), 476 i + 1, div_from_reg(data->fan_div[i]),
477 div_from_reg(data->fan_div[i] + 1)); 477 div_from_reg(data->fan_div[i] + 1));
478 data->fan_div[i]++; 478 data->fan_div[i]++;
479 w83627ehf_write_fan_div(client, i); 479 w83627ehf_write_fan_div(client, i);
@@ -1194,7 +1194,7 @@ static int w83627ehf_detect(struct i2c_adapter *adapter)
1194 u8 fan4pin, fan5pin; 1194 u8 fan4pin, fan5pin;
1195 int i, err = 0; 1195 int i, err = 0;
1196 1196
1197 if (!request_region(address + REGION_OFFSET, REGION_LENGTH, 1197 if (!request_region(address + IOREGION_OFFSET, IOREGION_LENGTH,
1198 w83627ehf_driver.driver.name)) { 1198 w83627ehf_driver.driver.name)) {
1199 err = -EBUSY; 1199 err = -EBUSY;
1200 goto exit; 1200 goto exit;
@@ -1322,7 +1322,7 @@ exit_remove:
1322exit_free: 1322exit_free:
1323 kfree(data); 1323 kfree(data);
1324exit_release: 1324exit_release:
1325 release_region(address + REGION_OFFSET, REGION_LENGTH); 1325 release_region(address + IOREGION_OFFSET, IOREGION_LENGTH);
1326exit: 1326exit:
1327 return err; 1327 return err;
1328} 1328}
@@ -1337,7 +1337,7 @@ static int w83627ehf_detach_client(struct i2c_client *client)
1337 1337
1338 if ((err = i2c_detach_client(client))) 1338 if ((err = i2c_detach_client(client)))
1339 return err; 1339 return err;
1340 release_region(client->addr + REGION_OFFSET, REGION_LENGTH); 1340 release_region(client->addr + IOREGION_OFFSET, IOREGION_LENGTH);
1341 kfree(data); 1341 kfree(data);
1342 1342
1343 return 0; 1343 return 0;
@@ -1380,7 +1380,7 @@ static int __init w83627ehf_find(int sioaddr, unsigned short *addr)
1380 superio_select(W83627EHF_LD_HWM); 1380 superio_select(W83627EHF_LD_HWM);
1381 val = (superio_inb(SIO_REG_ADDR) << 8) 1381 val = (superio_inb(SIO_REG_ADDR) << 8)
1382 | superio_inb(SIO_REG_ADDR + 1); 1382 | superio_inb(SIO_REG_ADDR + 1);
1383 *addr = val & REGION_ALIGNMENT; 1383 *addr = val & IOREGION_ALIGNMENT;
1384 if (*addr == 0) { 1384 if (*addr == 0) {
1385 superio_exit(); 1385 superio_exit();
1386 return -ENODEV; 1386 return -ENODEV;