git://git.onelab.eu
/
linux-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
linux 2.6.16.38 w/ vs2.0.3-rc1
[linux-2.6.git]
/
arch
/
mips
/
lasat
/
sysctl.c
diff --git
a/arch/mips/lasat/sysctl.c
b/arch/mips/lasat/sysctl.c
index
e3d5aaa
..
8ff43a1
100644
(file)
--- a/
arch/mips/lasat/sysctl.c
+++ b/
arch/mips/lasat/sysctl.c
@@
-30,13
+30,12
@@
#include <linux/string.h>
#include <linux/net.h>
#include <linux/inet.h>
#include <linux/string.h>
#include <linux/net.h>
#include <linux/inet.h>
-#include <linux/mutex.h>
#include <asm/uaccess.h>
#include "sysctl.h"
#include "ds1603.h"
#include <asm/uaccess.h>
#include "sysctl.h"
#include "ds1603.h"
-static DE
FINE_MUTEX(lasat_info_mutex
);
+static DE
CLARE_MUTEX(lasat_info_sem
);
/* Strategy function to write EEPROM after changing string entry */
int sysctl_lasatstring(ctl_table *table, int *name, int nlen,
/* Strategy function to write EEPROM after changing string entry */
int sysctl_lasatstring(ctl_table *table, int *name, int nlen,
@@
-44,17
+43,17
@@
int sysctl_lasatstring(ctl_table *table, int *name, int nlen,
void *newval, size_t newlen, void **context)
{
int r;
void *newval, size_t newlen, void **context)
{
int r;
-
mutex_lock(&lasat_info_mutex
);
+
down(&lasat_info_sem
);
r = sysctl_string(table, name,
nlen, oldval, oldlenp, newval, newlen, context);
if (r < 0) {
r = sysctl_string(table, name,
nlen, oldval, oldlenp, newval, newlen, context);
if (r < 0) {
-
mutex_unlock(&lasat_info_mutex
);
+
up(&lasat_info_sem
);
return r;
}
if (newval && newlen) {
lasat_write_eeprom_info();
}
return r;
}
if (newval && newlen) {
lasat_write_eeprom_info();
}
-
mutex_unlock(&lasat_info_mutex
);
+
up(&lasat_info_sem
);
return 1;
}
return 1;
}
@@
-64,14
+63,14
@@
int proc_dolasatstring(ctl_table *table, int write, struct file *filp,
void *buffer, size_t *lenp, loff_t *ppos)
{
int r;
void *buffer, size_t *lenp, loff_t *ppos)
{
int r;
-
mutex_lock(&lasat_info_mutex
);
+
down(&lasat_info_sem
);
r = proc_dostring(table, write, filp, buffer, lenp, ppos);
if ( (!write) || r) {
r = proc_dostring(table, write, filp, buffer, lenp, ppos);
if ( (!write) || r) {
-
mutex_unlock(&lasat_info_mutex
);
+
up(&lasat_info_sem
);
return r;
}
lasat_write_eeprom_info();
return r;
}
lasat_write_eeprom_info();
-
mutex_unlock(&lasat_info_mutex
);
+
up(&lasat_info_sem
);
return 0;
}
return 0;
}
@@
-80,14
+79,14
@@
int proc_dolasatint(ctl_table *table, int write, struct file *filp,
void *buffer, size_t *lenp, loff_t *ppos)
{
int r;
void *buffer, size_t *lenp, loff_t *ppos)
{
int r;
-
mutex_lock(&lasat_info_mutex
);
+
down(&lasat_info_sem
);
r = proc_dointvec(table, write, filp, buffer, lenp, ppos);
if ( (!write) || r) {
r = proc_dointvec(table, write, filp, buffer, lenp, ppos);
if ( (!write) || r) {
-
mutex_unlock(&lasat_info_mutex
);
+
up(&lasat_info_sem
);
return r;
}
lasat_write_eeprom_info();
return r;
}
lasat_write_eeprom_info();
-
mutex_unlock(&lasat_info_mutex
);
+
up(&lasat_info_sem
);
return 0;
}
return 0;
}
@@
-99,7
+98,7
@@
int proc_dolasatrtc(ctl_table *table, int write, struct file *filp,
void *buffer, size_t *lenp, loff_t *ppos)
{
int r;
void *buffer, size_t *lenp, loff_t *ppos)
{
int r;
-
mutex_lock(&lasat_info_mutex
);
+
down(&lasat_info_sem
);
if (!write) {
rtctmp = ds1603_read();
/* check for time < 0 and set to 0 */
if (!write) {
rtctmp = ds1603_read();
/* check for time < 0 and set to 0 */
@@
-108,11
+107,11
@@
int proc_dolasatrtc(ctl_table *table, int write, struct file *filp,
}
r = proc_dointvec(table, write, filp, buffer, lenp, ppos);
if ( (!write) || r) {
}
r = proc_dointvec(table, write, filp, buffer, lenp, ppos);
if ( (!write) || r) {
-
mutex_unlock(&lasat_info_mutex
);
+
up(&lasat_info_sem
);
return r;
}
ds1603_set(rtctmp);
return r;
}
ds1603_set(rtctmp);
-
mutex_unlock(&lasat_info_mutex
);
+
up(&lasat_info_sem
);
return 0;
}
#endif
return 0;
}
#endif
@@
-123,16
+122,16
@@
int sysctl_lasat_intvec(ctl_table *table, int *name, int nlen,
void *newval, size_t newlen, void **context)
{
int r;
void *newval, size_t newlen, void **context)
{
int r;
-
mutex_lock(&lasat_info_mutex
);
+
down(&lasat_info_sem
);
r = sysctl_intvec(table, name, nlen, oldval, oldlenp, newval, newlen, context);
if (r < 0) {
r = sysctl_intvec(table, name, nlen, oldval, oldlenp, newval, newlen, context);
if (r < 0) {
-
mutex_unlock(&lasat_info_mutex
);
+
up(&lasat_info_sem
);
return r;
}
if (newval && newlen) {
lasat_write_eeprom_info();
}
return r;
}
if (newval && newlen) {
lasat_write_eeprom_info();
}
-
mutex_unlock(&lasat_info_mutex
);
+
up(&lasat_info_sem
);
return 1;
}
return 1;
}
@@
-143,19
+142,19
@@
int sysctl_lasat_rtc(ctl_table *table, int *name, int nlen,
void *newval, size_t newlen, void **context)
{
int r;
void *newval, size_t newlen, void **context)
{
int r;
-
mutex_lock(&lasat_info_mutex
);
+
down(&lasat_info_sem
);
rtctmp = ds1603_read();
if (rtctmp < 0)
rtctmp = 0;
r = sysctl_intvec(table, name, nlen, oldval, oldlenp, newval, newlen, context);
if (r < 0) {
rtctmp = ds1603_read();
if (rtctmp < 0)
rtctmp = 0;
r = sysctl_intvec(table, name, nlen, oldval, oldlenp, newval, newlen, context);
if (r < 0) {
-
mutex_unlock(&lasat_info_mutex
);
+
up(&lasat_info_sem
);
return r;
}
if (newval && newlen) {
ds1603_set(rtctmp);
}
return r;
}
if (newval && newlen) {
ds1603_set(rtctmp);
}
-
mutex_unlock(&lasat_info_mutex
);
+
up(&lasat_info_sem
);
return 1;
}
#endif
return 1;
}
#endif
@@
-193,13
+192,13
@@
int proc_lasat_ip(ctl_table *table, int write, struct file *filp,
return 0;
}
return 0;
}
-
mutex_lock(&lasat_info_mutex
);
+
down(&lasat_info_sem
);
if (write) {
len = 0;
p = buffer;
while (len < *lenp) {
if(get_user(c, p++)) {
if (write) {
len = 0;
p = buffer;
while (len < *lenp) {
if(get_user(c, p++)) {
-
mutex_unlock(&lasat_info_mutex
);
+
up(&lasat_info_sem
);
return -EFAULT;
}
if (c == 0 || c == '\n')
return -EFAULT;
}
if (c == 0 || c == '\n')
@@
-210,7
+209,7
@@
int proc_lasat_ip(ctl_table *table, int write, struct file *filp,
len = sizeof(proc_lasat_ipbuf) - 1;
if (copy_from_user(proc_lasat_ipbuf, buffer, len))
{
len = sizeof(proc_lasat_ipbuf) - 1;
if (copy_from_user(proc_lasat_ipbuf, buffer, len))
{
-
mutex_unlock(&lasat_info_mutex
);
+
up(&lasat_info_sem
);
return -EFAULT;
}
proc_lasat_ipbuf[len] = 0;
return -EFAULT;
}
proc_lasat_ipbuf[len] = 0;
@@
-231,12
+230,12
@@
int proc_lasat_ip(ctl_table *table, int write, struct file *filp,
len = *lenp;
if (len)
if(copy_to_user(buffer, proc_lasat_ipbuf, len)) {
len = *lenp;
if (len)
if(copy_to_user(buffer, proc_lasat_ipbuf, len)) {
-
mutex_unlock(&lasat_info_mutex
);
+
up(&lasat_info_sem
);
return -EFAULT;
}
if (len < *lenp) {
if(put_user('\n', ((char *) buffer) + len)) {
return -EFAULT;
}
if (len < *lenp) {
if(put_user('\n', ((char *) buffer) + len)) {
-
mutex_unlock(&lasat_info_mutex
);
+
up(&lasat_info_sem
);
return -EFAULT;
}
len++;
return -EFAULT;
}
len++;
@@
-245,7
+244,7
@@
int proc_lasat_ip(ctl_table *table, int write, struct file *filp,
*ppos += len;
}
update_bcastaddr();
*ppos += len;
}
update_bcastaddr();
-
mutex_unlock(&lasat_info_mutex
);
+
up(&lasat_info_sem
);
return 0;
}
#endif /* defined(CONFIG_INET) */
return 0;
}
#endif /* defined(CONFIG_INET) */
@@
-257,10
+256,10
@@
static int sysctl_lasat_eeprom_value(ctl_table *table, int *name, int nlen,
{
int r;
{
int r;
-
mutex_lock(&lasat_info_mutex
);
+
down(&lasat_info_sem
);
r = sysctl_intvec(table, name, nlen, oldval, oldlenp, newval, newlen, context);
if (r < 0) {
r = sysctl_intvec(table, name, nlen, oldval, oldlenp, newval, newlen, context);
if (r < 0) {
-
mutex_unlock(&lasat_info_mutex
);
+
up(&lasat_info_sem
);
return r;
}
return r;
}
@@
-272,7
+271,7
@@
static int sysctl_lasat_eeprom_value(ctl_table *table, int *name, int nlen,
lasat_write_eeprom_info();
lasat_init_board_info();
}
lasat_write_eeprom_info();
lasat_init_board_info();
}
-
mutex_unlock(&lasat_info_mutex
);
+
up(&lasat_info_sem
);
return 0;
}
return 0;
}
@@
-281,10
+280,10
@@
int proc_lasat_eeprom_value(ctl_table *table, int write, struct file *filp,
void *buffer, size_t *lenp, loff_t *ppos)
{
int r;
void *buffer, size_t *lenp, loff_t *ppos)
{
int r;
-
mutex_lock(&lasat_info_mutex
);
+
down(&lasat_info_sem
);
r = proc_dointvec(table, write, filp, buffer, lenp, ppos);
if ( (!write) || r) {
r = proc_dointvec(table, write, filp, buffer, lenp, ppos);
if ( (!write) || r) {
-
mutex_unlock(&lasat_info_mutex
);
+
up(&lasat_info_sem
);
return r;
}
if (filp && filp->f_dentry)
return r;
}
if (filp && filp->f_dentry)
@@
-295,7
+294,7
@@
int proc_lasat_eeprom_value(ctl_table *table, int write, struct file *filp,
lasat_board_info.li_eeprom_info.debugaccess = lasat_board_info.li_debugaccess;
}
lasat_write_eeprom_info();
lasat_board_info.li_eeprom_info.debugaccess = lasat_board_info.li_debugaccess;
}
lasat_write_eeprom_info();
-
mutex_unlock(&lasat_info_mutex
);
+
up(&lasat_info_sem
);
return 0;
}
return 0;
}