Skip to content

Commit

Permalink
hwmon/f71805f: Fix the device address decoding
Browse files Browse the repository at this point in the history
The lowest 3 bits are ignored, and the chip decodes all 8 addresses,
not only the 2 it needs.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
  • Loading branch information
Jean Delvare authored and Jean Delvare committed Dec 12, 2006
1 parent c7176cb commit 75c9902
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions drivers/hwmon/f71805f.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,9 @@ superio_exit(int base)
* ISA constants
*/

#define REGION_LENGTH 2
#define ADDR_REG_OFFSET 0
#define DATA_REG_OFFSET 1
#define REGION_LENGTH 8
#define ADDR_REG_OFFSET 5
#define DATA_REG_OFFSET 6

/*
* Registers
Expand Down Expand Up @@ -1359,6 +1359,7 @@ static int __init f71805f_find(int sioaddr, unsigned short *address,
"skipping\n");
goto exit;
}
*address &= ~(REGION_LENGTH - 1); /* Ignore 3 LSB */

err = 0;
printk(KERN_INFO DRVNAME ": Found %s chip at %#x, revision %u\n",
Expand Down

0 comments on commit 75c9902

Please sign in to comment.