Skip to content

Commit

Permalink
hwmon: (w83627ehf) Invert fan pin variables logic
Browse files Browse the repository at this point in the history
Use positive logic for fan pin variables (variable is set if pin is
used for fan), instead of negative logic which is error prone.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Gong Jun <JGong@nuvoton.com>
  • Loading branch information
Jean Delvare committed Mar 30, 2009
1 parent b6a33fe commit 1704b26
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/hwmon/w83627ehf.c
Original file line number Diff line number Diff line change
Expand Up @@ -1317,8 +1317,8 @@ static int __devinit w83627ehf_probe(struct platform_device *pdev)

/* fan4 and fan5 share some pins with the GPIO and serial flash */

fan5pin = superio_inb(sio_data->sioreg, 0x24) & 0x2;
fan4pin = superio_inb(sio_data->sioreg, 0x29) & 0x6;
fan5pin = !(superio_inb(sio_data->sioreg, 0x24) & 0x2);
fan4pin = !(superio_inb(sio_data->sioreg, 0x29) & 0x6);
superio_exit(sio_data->sioreg);

/* It looks like fan4 and fan5 pins can be alternatively used
Expand All @@ -1329,9 +1329,9 @@ static int __devinit w83627ehf_probe(struct platform_device *pdev)

data->has_fan = 0x07; /* fan1, fan2 and fan3 */
i = w83627ehf_read_value(data, W83627EHF_REG_FANDIV1);
if ((i & (1 << 2)) && (!fan4pin))
if ((i & (1 << 2)) && fan4pin)
data->has_fan |= (1 << 3);
if (!(i & (1 << 1)) && (!fan5pin))
if (!(i & (1 << 1)) && fan5pin)
data->has_fan |= (1 << 4);

/* Read fan clock dividers immediately */
Expand Down

0 comments on commit 1704b26

Please sign in to comment.