X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fhwmon%2Ff71805f.c;h=89987657925361fa108a762993286ac2ba6a8788;hb=8032b526d1a3bd91ad633dd3a3b5fdbc47ad54f1;hp=1cd71a5be0ea0527ad87235b8433b0692be60dc8;hpb=9cab0217f3f35bd618363842576867badb72ca4b;p=linux-2.6-omap-h63xx.git diff --git a/drivers/hwmon/f71805f.c b/drivers/hwmon/f71805f.c index 1cd71a5be0e..89987657925 100644 --- a/drivers/hwmon/f71805f.c +++ b/drivers/hwmon/f71805f.c @@ -39,8 +39,13 @@ #include #include #include +#include #include +static unsigned short force_id; +module_param(force_id, ushort, 0); +MODULE_PARM_DESC(force_id, "Override the detected device ID"); + static struct platform_device *pdev; #define DRVNAME "f71805f" @@ -162,7 +167,7 @@ struct f71805f_auto_point { struct f71805f_data { unsigned short addr; const char *name; - struct class_device *class_dev; + struct device *hwmon_dev; struct mutex update_lock; char valid; /* !=0 if following fields are valid */ @@ -1381,9 +1386,9 @@ static int __devinit f71805f_probe(struct platform_device *pdev) } } - data->class_dev = hwmon_device_register(&pdev->dev); - if (IS_ERR(data->class_dev)) { - err = PTR_ERR(data->class_dev); + data->hwmon_dev = hwmon_device_register(&pdev->dev); + if (IS_ERR(data->hwmon_dev)) { + err = PTR_ERR(data->hwmon_dev); dev_err(&pdev->dev, "Class registration failed (%d)\n", err); goto exit_remove_files; } @@ -1410,7 +1415,7 @@ static int __devexit f71805f_remove(struct platform_device *pdev) struct resource *res; int i; - hwmon_device_unregister(data->class_dev); + hwmon_device_unregister(data->hwmon_dev); sysfs_remove_group(&pdev->dev.kobj, &f71805f_group); for (i = 0; i < 4; i++) sysfs_remove_group(&pdev->dev.kobj, &f71805f_group_optin[i]); @@ -1451,6 +1456,10 @@ static int __init f71805f_device_add(unsigned short address, } res.name = pdev->name; + err = acpi_check_resource_conflict(&res); + if (err) + goto exit_device_put; + err = platform_device_add_resources(pdev, &res, 1); if (err) { printk(KERN_ERR DRVNAME ": Device resource addition failed " @@ -1497,7 +1506,7 @@ static int __init f71805f_find(int sioaddr, unsigned short *address, if (devid != SIO_FINTEK_ID) goto exit; - devid = superio_inw(sioaddr, SIO_REG_DEVID); + devid = force_id ? force_id : superio_inw(sioaddr, SIO_REG_DEVID); switch (devid) { case SIO_F71805F_ID: sio_data->kind = f71805f;