From e0484650effdba3da0b448bc17abd6b029a64b1a Mon Sep 17 00:00:00 2001 From: Frodo Looijaard Date: Sat, 5 Dec 1998 16:36:47 +0000 Subject: [PATCH] Fixed some more bugs * PIIX4: better names in /proc files * sensors.c: fixed bug which prevented registration of non-ISA clients Status: * lm75 inserts happily and interacts with the PIIX4 correctly * lm75 readings are still wrong (all 0xff) * lm75 insertion with ISA bus present causes oops git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@39 7894878c-1315-0410-8ee3-d5d059ff63e0 --- kernel/busses/i2c-piix4.c | 4 ++-- kernel/chips/lm75.c | 4 ---- kernel/sensors.c | 2 +- src/lm75.c | 4 ---- src/piix4.c | 4 ++-- src/sensors.c | 2 +- 6 files changed, 6 insertions(+), 14 deletions(-) diff --git a/kernel/busses/i2c-piix4.c b/kernel/busses/i2c-piix4.c index 81a3e8a6..d68daeaa 100644 --- a/kernel/busses/i2c-piix4.c +++ b/kernel/busses/i2c-piix4.c @@ -168,7 +168,7 @@ int piix4_setup(void) } /* Everything is happy, let's grab the memory and set things up. */ - request_region(piix4_smba, 8, "SMBus"); + request_region(piix4_smba, 8, "piix4"); #ifdef DEBUG if ((temp & 0x0E) == 8) @@ -376,7 +376,7 @@ int piix4_init(void) return res; } piix4_initialized ++; - strcpy(piix4_adapter.name,"SMBus PIIX4 adapter"); + sprintf(piix4_adapter.name,"SMBus PIIX4 adapter at %04x",piix4_smba); piix4_adapter.id = ALGO_SMBUS | SMBUS_PIIX4; piix4_adapter.algo = &smbus_algorithm; piix4_adapter.smbus_access = &piix4_access; diff --git a/kernel/chips/lm75.c b/kernel/chips/lm75.c index 3d9cfdef..08f94124 100644 --- a/kernel/chips/lm75.c +++ b/kernel/chips/lm75.c @@ -174,7 +174,6 @@ int lm75_attach_adapter(struct i2c_adapter *adapter) lm75_write_value(new_client,LM75_REG_CONF,0); continue; - /* OK, this is not exactly good programming practice, usually. But it is very code-efficient in this case. */ @@ -301,9 +300,6 @@ void lm75_temp(struct i2c_client *client, int operation, int ctl_name, } } - - - int lm75_init(void) { int res; diff --git a/kernel/sensors.c b/kernel/sensors.c index b7b90768..a14972db 100644 --- a/kernel/sensors.c +++ b/kernel/sensors.c @@ -68,7 +68,7 @@ int sensors_create_name(char **name, const char *prefix, if (i2c_is_isa_adapter(adapter)) sprintf(name_buffer,"%s-isa-%04x",prefix,addr); else { - if ((id = i2c_adapter_id(adapter)) < 0); + if ((id = i2c_adapter_id(adapter)) < 0) return -ENOENT; sprintf(name_buffer,"%s-i2c-%d-%02x",prefix,id,addr); } diff --git a/src/lm75.c b/src/lm75.c index 3d9cfdef..08f94124 100644 --- a/src/lm75.c +++ b/src/lm75.c @@ -174,7 +174,6 @@ int lm75_attach_adapter(struct i2c_adapter *adapter) lm75_write_value(new_client,LM75_REG_CONF,0); continue; - /* OK, this is not exactly good programming practice, usually. But it is very code-efficient in this case. */ @@ -301,9 +300,6 @@ void lm75_temp(struct i2c_client *client, int operation, int ctl_name, } } - - - int lm75_init(void) { int res; diff --git a/src/piix4.c b/src/piix4.c index 81a3e8a6..d68daeaa 100644 --- a/src/piix4.c +++ b/src/piix4.c @@ -168,7 +168,7 @@ int piix4_setup(void) } /* Everything is happy, let's grab the memory and set things up. */ - request_region(piix4_smba, 8, "SMBus"); + request_region(piix4_smba, 8, "piix4"); #ifdef DEBUG if ((temp & 0x0E) == 8) @@ -376,7 +376,7 @@ int piix4_init(void) return res; } piix4_initialized ++; - strcpy(piix4_adapter.name,"SMBus PIIX4 adapter"); + sprintf(piix4_adapter.name,"SMBus PIIX4 adapter at %04x",piix4_smba); piix4_adapter.id = ALGO_SMBUS | SMBUS_PIIX4; piix4_adapter.algo = &smbus_algorithm; piix4_adapter.smbus_access = &piix4_access; diff --git a/src/sensors.c b/src/sensors.c index b7b90768..a14972db 100644 --- a/src/sensors.c +++ b/src/sensors.c @@ -68,7 +68,7 @@ int sensors_create_name(char **name, const char *prefix, if (i2c_is_isa_adapter(adapter)) sprintf(name_buffer,"%s-isa-%04x",prefix,addr); else { - if ((id = i2c_adapter_id(adapter)) < 0); + if ((id = i2c_adapter_id(adapter)) < 0) return -ENOENT; sprintf(name_buffer,"%s-i2c-%d-%02x",prefix,id,addr); }