]> Pileus Git - ~andy/linux/blobdiff - drivers/hwmon/atxp1.c
Merge by Hand
[~andy/linux] / drivers / hwmon / atxp1.c
index 5cf77e67a2ed1c56a46d4c21d395212f96e6c8d1..53324f56404e2c38979e8b7401e6b4b254028783 100644 (file)
@@ -23,8 +23,8 @@
 #include <linux/module.h>
 #include <linux/jiffies.h>
 #include <linux/i2c.h>
-#include <linux/i2c-vid.h>
 #include <linux/hwmon.h>
+#include <linux/hwmon-vid.h>
 #include <linux/err.h>
 
 MODULE_LICENSE("GPL");
@@ -253,6 +253,8 @@ static DEVICE_ATTR(gpio2, S_IRUGO | S_IWUSR, atxp1_showgpio2, atxp1_storegpio2);
 
 static int atxp1_attach_adapter(struct i2c_adapter *adapter)
 {
+       if (!(adapter->class & I2C_CLASS_HWMON))
+               return 0;
        return i2c_probe(adapter, &addr_data, &atxp1_detect);
 };
 
@@ -266,12 +268,11 @@ static int atxp1_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 atxp1_data), GFP_KERNEL))) {
+       if (!(data = kzalloc(sizeof(struct atxp1_data), GFP_KERNEL))) {
                err = -ENOMEM;
                goto exit;
        }
 
-       memset(data, 0, sizeof(struct atxp1_data));
        new_client = &data->client;
        i2c_set_clientdata(new_client, data);
 
@@ -296,7 +297,7 @@ static int atxp1_detect(struct i2c_adapter *adapter, int address, int kind)
        }
 
        /* Get VRM */
-       data->vrm = i2c_which_vrm();
+       data->vrm = vid_which_vrm();
 
        if ((data->vrm != 90) && (data->vrm != 91)) {
                dev_err(&new_client->dev, "Not supporting VRM %d.%d\n",