Skip to content

Commit

Permalink
hwmon: (fschmd) Drop useless mutex
Browse files Browse the repository at this point in the history
As discussed one year ago, the WDIOC_GETSUPPORT ioctl only needs a
mutex because it operates on a static variable. There is no good
reason to keep this variable static, so let's just make it non-static
and drop the now useless mutex altogether.

See the discussion at:
http://marc.info/?l=lm-sensors&m=125563869402323&w=2

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Hans de Goede <hdegoede@redhat.com>
Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
  • Loading branch information
Jean Delvare authored and Jean Delvare committed Jan 12, 2011
1 parent 1ca2821 commit 1b7243e
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions drivers/hwmon/fschmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@
#include <linux/kref.h>

/* Addresses to scan */
static DEFINE_MUTEX(watchdog_mutex);
static const unsigned short normal_i2c[] = { 0x73, I2C_CLIENT_END };

/* Insmod parameters */
Expand Down Expand Up @@ -850,15 +849,14 @@ static ssize_t watchdog_write(struct file *filp, const char __user *buf,

static long watchdog_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
{
static struct watchdog_info ident = {
struct watchdog_info ident = {
.options = WDIOF_KEEPALIVEPING | WDIOF_SETTIMEOUT |
WDIOF_CARDRESET,
.identity = "FSC watchdog"
};
int i, ret = 0;
struct fschmd_data *data = filp->private_data;

mutex_lock(&watchdog_mutex);
switch (cmd) {
case WDIOC_GETSUPPORT:
ident.firmware_version = data->revision;
Expand Down Expand Up @@ -915,7 +913,6 @@ static long watchdog_ioctl(struct file *filp, unsigned int cmd, unsigned long ar
default:
ret = -ENOTTY;
}
mutex_unlock(&watchdog_mutex);
return ret;
}

Expand Down

0 comments on commit 1b7243e

Please sign in to comment.