2
0
mirror of https://github.com/lm-sensors/lm-sensors synced 2025-08-29 21:38:17 +00:00

Rewrite the bank switching code in a slightly different way to keep

some compilers quiet.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@4094 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
Jean Delvare 2006-08-12 21:02:54 +00:00
parent c8ae77bdc6
commit e554f90d33

View File

@ -290,11 +290,13 @@ int main(int argc, char *argv[])
/* See Winbond w83781d data sheet for bank details */
if (bank && size != I2C_SMBUS_BLOCK_DATA) {
old_bank = i2c_smbus_read_byte_data(file, bankreg);
if (old_bank >= 0)
res = i2c_smbus_read_byte_data(file, bankreg);
if (res >= 0) {
old_bank = res;
res = i2c_smbus_write_byte_data(file, bankreg,
bank | (old_bank & 0xf0));
if (old_bank < 0 || res < 0) {
}
if (res < 0) {
fprintf(stderr, "Error: Bank switching failed\n");
exit(1);
}