netfilter: nf_conntrack: restrict runtime expect hashsize modifications
[safe/jmp/linux-2.6] / drivers / macintosh / therm_adt746x.c
index 4a8bf46..556f0fe 100644 (file)
@@ -37,6 +37,7 @@
 #define CONFIG_REG   0x40
 #define MANUAL_MASK  0xe0
 #define AUTO_MASK    0x20
+#define INVERT_MASK  0x10
 
 static u8 TEMP_REG[3]    = {0x26, 0x25, 0x27}; /* local, sensor1, sensor2 */
 static u8 LIMIT_REG[3]   = {0x6b, 0x6a, 0x6c}; /* local, sensor1, sensor2 */
@@ -123,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)
 {
@@ -147,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;
 }
 
@@ -226,7 +229,8 @@ static void write_fan_speed(struct thermostat *th, int speed, int fan)
        
        if (speed >= 0) {
                manual = read_reg(th, MANUAL_MODE[fan]);
-               write_reg(th, MANUAL_MODE[fan], manual|MANUAL_MASK);
+               write_reg(th, MANUAL_MODE[fan],
+                       (manual|MANUAL_MASK) & (~INVERT_MASK));
                write_reg(th, FAN_SPD_SET[fan], speed);
        } else {
                /* back to automatic */