hwmon: (w83627ehf) Invert fan pin variables logic

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linux Kernel Mailing List
Date: Monday, March 30, 2009 - 6:59 pm

Gitweb:     http://git.kernel.org/linus/1704b26ee3fd89c76724cbea238e951dc019faca
Commit:     1704b26ee3fd89c76724cbea238e951dc019faca
Parent:     b6a33fe2cc1b44851174967943fe5989f7e0550f
Author:     Jean Delvare <khali@linux-fr.org>
AuthorDate: Mon Mar 30 21:46:42 2009 +0200
Committer:  Jean Delvare <khali@linux-fr.org>
CommitDate: Mon Mar 30 21:46:42 2009 +0200

    hwmon: (w83627ehf) Invert fan pin variables logic
    
    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>
---
 drivers/hwmon/w83627ehf.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/hwmon/w83627ehf.c b/drivers/hwmon/w83627ehf.c
index feae743..18432e3 100644
--- a/drivers/hwmon/w83627ehf.c
+++ b/drivers/hwmon/w83627ehf.c
@@ -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
@@ -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 */
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
hwmon: (w83627ehf) Invert fan pin variables logic, Linux Kernel Mailing ..., (Mon Mar 30, 6:59 pm)