Skip to content

Commit

Permalink
Merge branch 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/…
Browse files Browse the repository at this point in the history
…kernel/git/jdelvare/staging

* 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging:
  hwmon: (fschmd) Fix a memleak on multiple opens of /dev/watchdog
  hwmon: (asus_atk0110) Do not fail if MBIF is missing
  hwmon: (amc6821) Double unlock bug
  hwmon: (smsc47m1) Fix section mismatch
  • Loading branch information
Linus Torvalds committed Jan 26, 2010
2 parents abefedd + c453615 commit c799d15
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 14 deletions.
1 change: 0 additions & 1 deletion drivers/hwmon/amc6821.c
Original file line number Diff line number Diff line change
Expand Up @@ -686,7 +686,6 @@ static ssize_t set_fan1_div(
data->fan1_div = 4;
break;
default:
mutex_unlock(&data->update_lock);
count = -EINVAL;
goto EXIT;
}
Expand Down
19 changes: 9 additions & 10 deletions drivers/hwmon/asus_atk0110.c
Original file line number Diff line number Diff line change
Expand Up @@ -1329,17 +1329,16 @@ static int atk_add(struct acpi_device *device)
&buf, ACPI_TYPE_PACKAGE);
if (ret != AE_OK) {
dev_dbg(&device->dev, "atk: method MBIF not found\n");
err = -ENODEV;
goto out;
}

obj = buf.pointer;
if (obj->package.count >= 2 &&
obj->package.elements[1].type == ACPI_TYPE_STRING) {
dev_dbg(&device->dev, "board ID = %s\n",
obj->package.elements[1].string.pointer);
} else {
obj = buf.pointer;
if (obj->package.count >= 2) {
union acpi_object *id = &obj->package.elements[1];
if (id->type == ACPI_TYPE_STRING)
dev_dbg(&device->dev, "board ID = %s\n",
id->string.pointer);
}
ACPI_FREE(buf.pointer);
}
ACPI_FREE(buf.pointer);

err = atk_probe_if(data);
if (err) {
Expand Down
7 changes: 5 additions & 2 deletions drivers/hwmon/fschmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -768,6 +768,7 @@ static int watchdog_stop(struct fschmd_data *data)
static int watchdog_open(struct inode *inode, struct file *filp)
{
struct fschmd_data *pos, *data = NULL;
int watchdog_is_open;

/* We get called from drivers/char/misc.c with misc_mtx hold, and we
call misc_register() from fschmd_probe() with watchdog_data_mutex
Expand All @@ -782,10 +783,12 @@ static int watchdog_open(struct inode *inode, struct file *filp)
}
}
/* Note we can never not have found data, so we don't check for this */
kref_get(&data->kref);
watchdog_is_open = test_and_set_bit(0, &data->watchdog_is_open);
if (!watchdog_is_open)
kref_get(&data->kref);
mutex_unlock(&watchdog_data_mutex);

if (test_and_set_bit(0, &data->watchdog_is_open))
if (watchdog_is_open)
return -EBUSY;

/* Start the watchdog */
Expand Down
2 changes: 1 addition & 1 deletion drivers/hwmon/smsc47m1.c
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@ static int __init smsc47m1_find(unsigned short *addr,
}

/* Restore device to its initial state */
static void __init smsc47m1_restore(const struct smsc47m1_sio_data *sio_data)
static void smsc47m1_restore(const struct smsc47m1_sio_data *sio_data)
{
if ((sio_data->activate & 0x01) == 0) {
superio_enter();
Expand Down

0 comments on commit c799d15

Please sign in to comment.