From c1ff1bbd55573736fac00809f6a3019483b285be Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Mon, 12 Dec 2005 20:24:53 +0000 Subject: [PATCH] Initialize the chip before registering it. Drop useless local variable initialization. git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@3212 7894878c-1315-0410-8ee3-d5d059ff63e0 --- kernel/chips/f71805f.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/kernel/chips/f71805f.c b/kernel/chips/f71805f.c index 5f605e61..30fc96f2 100644 --- a/kernel/chips/f71805f.c +++ b/kernel/chips/f71805f.c @@ -301,7 +301,7 @@ static int f71805f_detect(struct i2c_adapter *adapter, int address, { struct i2c_client *client; struct f71805f_data *data; - int err = 0; + int err; if (!request_region(address, REGION_LENGTH, f71805f_driver.name)) { err = -EBUSY; @@ -329,6 +329,9 @@ static int f71805f_detect(struct i2c_adapter *adapter, int address, if ((err = i2c_attach_client(client))) goto exit_free; + /* Initialize the F71805F chip */ + f71805f_init_client(client); + /* Register a new directory entry in /proc */ err = i2c_register_entry(client, "f71805f", f71805f_dir_table_template, THIS_MODULE); @@ -336,8 +339,6 @@ static int f71805f_detect(struct i2c_adapter *adapter, int address, goto exit_detach; data->sysctl_id = err; - /* Initialize the F71805F chip */ - f71805f_init_client(client); return 0; exit_detach: