Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jwessel...
[pandora-kernel.git] / drivers / hwmon / pc87360.c
index f57c75d..9b462bb 100644 (file)
@@ -59,6 +59,10 @@ MODULE_PARM_DESC(init,
  " 2: Forcibly enable all voltage and temperature channels, except in9\n"
  " 3: Forcibly enable all voltage and temperature channels, including in9");
 
+static unsigned short force_id;
+module_param(force_id, ushort, 0);
+MODULE_PARM_DESC(force_id, "Override the detected device ID");
+
 /*
  * Super-I/O registers and operations
  */
@@ -180,7 +184,7 @@ static inline u8 PWM_TO_REG(int val, int inv)
 
 struct pc87360_data {
        const char *name;
-       struct class_device *class_dev;
+       struct device *hwmon_dev;
        struct mutex lock;
        struct mutex update_lock;
        char valid;             /* !=0 if following fields are valid */
@@ -500,7 +504,7 @@ static DEVICE_ATTR(cpu0_vid, S_IRUGO, show_vid, NULL);
 
 static ssize_t show_vrm(struct device *dev, struct device_attribute *attr, char *buf)
 {
-       struct pc87360_data *data = pc87360_update_device(dev);
+       struct pc87360_data *data = dev_get_drvdata(dev);
        return sprintf(buf, "%u\n", data->vrm);
 }
 static ssize_t set_vrm(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
@@ -826,7 +830,7 @@ static int __init pc87360_find(int sioaddr, u8 *devid, unsigned short *addresses
        /* No superio_enter */
 
        /* Identify device */
-       val = superio_inb(sioaddr, DEVID);
+       val = force_id ? force_id : superio_inb(sioaddr, DEVID);
        switch (val) {
        case 0xE1: /* PC87360 */
        case 0xE8: /* PC87363 */
@@ -1054,9 +1058,9 @@ static int __devinit pc87360_probe(struct platform_device *pdev)
        if ((err = device_create_file(dev, &dev_attr_name)))
                goto ERROR3;
 
-       data->class_dev = hwmon_device_register(dev);
-       if (IS_ERR(data->class_dev)) {
-               err = PTR_ERR(data->class_dev);
+       data->hwmon_dev = hwmon_device_register(dev);
+       if (IS_ERR(data->hwmon_dev)) {
+               err = PTR_ERR(data->hwmon_dev);
                goto ERROR3;
        }
        return 0;
@@ -1083,7 +1087,7 @@ static int __devexit pc87360_remove(struct platform_device *pdev)
        struct pc87360_data *data = platform_get_drvdata(pdev);
        int i;
 
-       hwmon_device_unregister(data->class_dev);
+       hwmon_device_unregister(data->hwmon_dev);
 
        device_remove_file(&pdev->dev, &dev_attr_name);
        sysfs_remove_group(&pdev->dev.kobj, &pc8736x_temp_group);