macintosh: Don't assume i2c device probing always succeeds
[sfrench/cifs-2.6.git] / drivers / macintosh / therm_adt746x.c
index fde377c60cca753eafe9c358f7e562c6d538ad7b..556f0feaa4df33fe3733e0ccf3638bb6bfe1aa44 100644 (file)
@@ -124,6 +124,8 @@ read_reg(struct thermostat* th, int reg)
        return data;
 }
 
+static struct i2c_driver thermostat_driver;
+
 static int
 attach_thermostat(struct i2c_adapter *adapter)
 {
@@ -148,7 +150,7 @@ attach_thermostat(struct i2c_adapter *adapter)
         * Let i2c-core delete that device on driver removal.
         * This is safe because i2c-core holds the core_lock mutex for us.
         */
-       list_add_tail(&client->detected, &client->driver->clients);
+       list_add_tail(&client->detected, &thermostat_driver.clients);
        return 0;
 }