X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fhwmon%2Fpc87360.c;h=9b462bb13fa33b3b9cc67d66e884628a7e2043ba;hb=638157bc1461f6718eeca06bedd9a09cf1f35c36;hp=f57c75d59a5bcf0273aba9569b0958e417eaa81d;hpb=3a97aeb5c199070f136c085f8b0f9338d19c4148;p=linux-2.6-omap-h63xx.git diff --git a/drivers/hwmon/pc87360.c b/drivers/hwmon/pc87360.c index f57c75d59a5..9b462bb13fa 100644 --- a/drivers/hwmon/pc87360.c +++ b/drivers/hwmon/pc87360.c @@ -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);