]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/hwmon/w83l785ts.c
Merge master.kernel.org:/pub/scm/linux/kernel/git/dtor/input
[linux-2.6-omap-h63xx.git] / drivers / hwmon / w83l785ts.c
index fcb2c39b04fd722125cc3c9220348ccf168a138d..f495b63786685ba72f77079bcdd361dde7bd18bf 100644 (file)
@@ -74,7 +74,7 @@ I2C_CLIENT_INSMOD_1(w83l785ts);
  * The W83L785TS-S uses signed 8-bit values.
  */
 
-#define TEMP_FROM_REG(val)     ((val & 0x80 ? val-0x100 : val) * 1000)
+#define TEMP_FROM_REG(val)     ((val) * 1000)
 
 /*
  * Functions declaration
@@ -112,7 +112,7 @@ struct w83l785ts_data {
        unsigned long last_updated; /* in jiffies */
 
        /* registers values */
-       u8 temp[2]; /* 0: input
+       s8 temp[2]; /* 0: input
                       1: critical limit */
 };
 
@@ -156,12 +156,10 @@ static int w83l785ts_detect(struct i2c_adapter *adapter, int address, int kind)
        if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA))
                goto exit;
 
-       if (!(data = kmalloc(sizeof(struct w83l785ts_data), GFP_KERNEL))) {
+       if (!(data = kzalloc(sizeof(struct w83l785ts_data), GFP_KERNEL))) {
                err = -ENOMEM;
                goto exit;
        }
-       memset(data, 0, sizeof(struct w83l785ts_data));
-
 
        /* The common I2C client data is placed right before the
         * W83L785TS-specific data. */