From 90b82c0b92cdee442461d0fab6c22f4e340f7977 Mon Sep 17 00:00:00 2001 From: "Mark D. Studebaker" Date: Tue, 18 Sep 2001 20:30:53 +0000 Subject: [PATCH] allow force and force_fscpos git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@1184 7894878c-1315-0410-8ee3-d5d059ff63e0 --- kernel/chips/fscpos.c | 34 +++++++++++++--------------------- 1 file changed, 13 insertions(+), 21 deletions(-) diff --git a/kernel/chips/fscpos.c b/kernel/chips/fscpos.c index ad9df246..29473d39 100644 --- a/kernel/chips/fscpos.c +++ b/kernel/chips/fscpos.c @@ -288,29 +288,21 @@ int fscpos_detect(struct i2c_adapter *adapter, int address, new_client->driver = &fscpos_driver; new_client->flags = 0; - /* Now, we do the remaining detection. */ - if (fscpos_read_value(new_client, FSCPOS_REG_IDENT_0) != 0x50) - goto ERROR1; - if (fscpos_read_value(new_client, FSCPOS_REG_IDENT_1) != 0x45) - goto ERROR1; - if (fscpos_read_value(new_client, FSCPOS_REG_IDENT_2) != 0x47) - goto ERROR1; - - /* Determine the chip type - only one kind supported! */ - if (kind <= 0) - kind = fscpos; - - if (kind == fscpos) { - type_name = "fscpos"; - client_name = "fsc poseidon chip"; - } else { -#ifdef DEBUG - printk("fscpos.o: Internal error: unknown kind (%d)?!?", - kind); -#endif - goto ERROR1; + /* Do the remaining detection unless force or force_fscpos parameter */ + if (kind < 0) { + if (fscpos_read_value(new_client, FSCPOS_REG_IDENT_0) != 0x50) + goto ERROR1; + if (fscpos_read_value(new_client, FSCPOS_REG_IDENT_1) != 0x45) + goto ERROR1; + if (fscpos_read_value(new_client, FSCPOS_REG_IDENT_2) != 0x47) + goto ERROR1; } + kind = fscpos; + + type_name = "fscpos"; + client_name = "fsc poseidon chip"; + /* Fill in the remaining client fields and put it into the global list */ strcpy(new_client->name, client_name);