Commit 36c7fe13 authored by Jean Delvare's avatar Jean Delvare Committed by Jean Delvare

hwmon: (w83793) Drop useless mutex

This is the same case as fschmd, from which the code was copied as far
as I can see. So the same clean-up applies:

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=2Signed-off-by: default avatarJean Delvare <khali@linux-fr.org>
Cc: Hans de Goede <hdegoede@redhat.com>
Acked-by: default avatarGuenter Roeck <guenter.roeck@ericsson.com>
Acked-by: default avatarArnd Bergmann <arnd@arndb.de>
Acked-by: default avatarThomas Gleixner <tglx@linutronix.de>
parent 1b7243e8
...@@ -51,7 +51,6 @@ ...@@ -51,7 +51,6 @@
#define WATCHDOG_TIMEOUT 2 /* 2 minute default timeout */ #define WATCHDOG_TIMEOUT 2 /* 2 minute default timeout */
/* Addresses to scan */ /* Addresses to scan */
static DEFINE_MUTEX(watchdog_mutex);
static const unsigned short normal_i2c[] = { 0x2c, 0x2d, 0x2e, 0x2f, static const unsigned short normal_i2c[] = { 0x2c, 0x2d, 0x2e, 0x2f,
I2C_CLIENT_END }; I2C_CLIENT_END };
...@@ -1350,7 +1349,7 @@ static ssize_t watchdog_write(struct file *filp, const char __user *buf, ...@@ -1350,7 +1349,7 @@ static ssize_t watchdog_write(struct file *filp, const char __user *buf,
static long watchdog_ioctl(struct file *filp, unsigned int cmd, static long watchdog_ioctl(struct file *filp, unsigned int cmd,
unsigned long arg) unsigned long arg)
{ {
static struct watchdog_info ident = { struct watchdog_info ident = {
.options = WDIOF_KEEPALIVEPING | .options = WDIOF_KEEPALIVEPING |
WDIOF_SETTIMEOUT | WDIOF_SETTIMEOUT |
WDIOF_CARDRESET, WDIOF_CARDRESET,
...@@ -1360,7 +1359,6 @@ static long watchdog_ioctl(struct file *filp, unsigned int cmd, ...@@ -1360,7 +1359,6 @@ static long watchdog_ioctl(struct file *filp, unsigned int cmd,
int val, ret = 0; int val, ret = 0;
struct w83793_data *data = filp->private_data; struct w83793_data *data = filp->private_data;
mutex_lock(&watchdog_mutex);
switch (cmd) { switch (cmd) {
case WDIOC_GETSUPPORT: case WDIOC_GETSUPPORT:
if (!nowayout) if (!nowayout)
...@@ -1414,7 +1412,6 @@ static long watchdog_ioctl(struct file *filp, unsigned int cmd, ...@@ -1414,7 +1412,6 @@ static long watchdog_ioctl(struct file *filp, unsigned int cmd,
default: default:
ret = -ENOTTY; ret = -ENOTTY;
} }
mutex_unlock(&watchdog_mutex);
return ret; return ret;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment