projects
/
powerpc.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
hwmon: Discard useless I2C driver IDs
[powerpc.git]
/
drivers
/
hwmon
/
vt1211.c
diff --git
a/drivers/hwmon/vt1211.c
b/drivers/hwmon/vt1211.c
index
9f3e332
..
12b4359
100644
(file)
--- a/
drivers/hwmon/vt1211.c
+++ b/
drivers/hwmon/vt1211.c
@@
-42,6
+42,10
@@
static int int_mode = -1;
module_param(int_mode, int, 0);
MODULE_PARM_DESC(int_mode, "Force the temperature interrupt mode");
module_param(int_mode, int, 0);
MODULE_PARM_DESC(int_mode, "Force the temperature interrupt mode");
+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 "vt1211"
static struct platform_device *pdev;
#define DRVNAME "vt1211"
@@
-108,7
+112,7
@@
static const u8 bitalarmfan[] = {6, 7};
struct vt1211_data {
unsigned short addr;
const char *name;
struct vt1211_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 */
struct mutex update_lock;
char valid; /* !=0 if following fields are valid */
@@
-795,7
+799,7
@@
static ssize_t set_pwm_auto_point_pwm(struct device *dev,
if ((val < 0) || (val > 255)) {
dev_err(dev, "pwm value %ld is out of range. "
if ((val < 0) || (val > 255)) {
dev_err(dev, "pwm value %ld is out of range. "
- "Choose a value between 0 and 255." , val);
+ "Choose a value between 0 and 255.
\n
" , val);
return -EINVAL;
}
return -EINVAL;
}
@@
-1191,9
+1195,9
@@
static int __devinit vt1211_probe(struct platform_device *pdev)
}
/* Register device */
}
/* Register device */
- 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);
dev_err(dev, "Class registration failed (%d)\n", err);
goto EXIT_DEV_REMOVE_SILENT;
}
dev_err(dev, "Class registration failed (%d)\n", err);
goto EXIT_DEV_REMOVE_SILENT;
}
@@
-1217,7
+1221,7
@@
static int __devexit vt1211_remove(struct platform_device *pdev)
struct vt1211_data *data = platform_get_drvdata(pdev);
struct resource *res;
struct vt1211_data *data = platform_get_drvdata(pdev);
struct resource *res;
- hwmon_device_unregister(data->
class
_dev);
+ hwmon_device_unregister(data->
hwmon
_dev);
vt1211_remove_sysfs(pdev);
platform_set_drvdata(pdev, NULL);
kfree(data);
vt1211_remove_sysfs(pdev);
platform_set_drvdata(pdev, NULL);
kfree(data);
@@
-1280,10
+1284,12
@@
EXIT:
static int __init vt1211_find(int sio_cip, unsigned short *address)
{
int err = -ENODEV;
static int __init vt1211_find(int sio_cip, unsigned short *address)
{
int err = -ENODEV;
+ int devid;
superio_enter(sio_cip);
superio_enter(sio_cip);
- if (superio_inb(sio_cip, SIO_VT1211_DEVID) != SIO_VT1211_ID) {
+ devid = force_id ? force_id : superio_inb(sio_cip, SIO_VT1211_DEVID);
+ if (devid != SIO_VT1211_ID) {
goto EXIT;
}
goto EXIT;
}