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
Merge to Fedora kernel-2.6.18-1.2224_FC5 patched with stable patch-2.6.18.1-vs2.0...
[linux-2.6.git]
/
drivers
/
sbus
/
char
/
riowatchdog.c
diff --git
a/drivers/sbus/char/riowatchdog.c
b/drivers/sbus/char/riowatchdog.c
index
f34c4a9
..
2a9cc82
100644
(file)
--- a/
drivers/sbus/char/riowatchdog.c
+++ b/
drivers/sbus/char/riowatchdog.c
@@
-52,14
+52,14
@@
MODULE_LICENSE("GPL");
#define RIOWD_NAME "pmc"
#define RIOWD_MINOR 215
#define RIOWD_NAME "pmc"
#define RIOWD_MINOR 215
-static
spinlock_t riowd_lock = SPIN_LOCK_UNLOCKED
;
+static
DEFINE_SPINLOCK(riowd_lock)
;
-static void *bbc_regs;
-static void *riowd_regs;
+static void
__iomem
*bbc_regs;
+static void
__iomem
*riowd_regs;
#define WDTO_INDEX 0x05
static int riowd_timeout = 1; /* in minutes */
#define WDTO_INDEX 0x05
static int riowd_timeout = 1; /* in minutes */
-
MODULE_PARM(riowd_timeout,"i"
);
+
module_param(riowd_timeout, int, 0
);
MODULE_PARM_DESC(riowd_timeout, "Watchdog timeout in minutes");
#if 0 /* Currently unused. */
MODULE_PARM_DESC(riowd_timeout, "Watchdog timeout in minutes");
#if 0 /* Currently unused. */
@@
-116,6
+116,7
@@
static void riowd_starttimer(void)
static int riowd_open(struct inode *inode, struct file *filp)
{
static int riowd_open(struct inode *inode, struct file *filp)
{
+ nonseekable_open(inode, filp);
return 0;
}
return 0;
}
@@
-130,18
+131,19
@@
static int riowd_ioctl(struct inode *inode, struct file *filp,
static struct watchdog_info info = {
WDIOF_SETTIMEOUT, 0, "Natl. Semiconductor PC97317"
};
static struct watchdog_info info = {
WDIOF_SETTIMEOUT, 0, "Natl. Semiconductor PC97317"
};
+ void __user *argp = (void __user *)arg;
unsigned int options;
int new_margin;
switch (cmd) {
case WDIOC_GETSUPPORT:
unsigned int options;
int new_margin;
switch (cmd) {
case WDIOC_GETSUPPORT:
- if (copy_to_user(
(struct watchdog_info *) arg
, &info, sizeof(info)))
+ if (copy_to_user(
argp
, &info, sizeof(info)))
return -EFAULT;
break;
case WDIOC_GETSTATUS:
case WDIOC_GETBOOTSTATUS:
return -EFAULT;
break;
case WDIOC_GETSTATUS:
case WDIOC_GETBOOTSTATUS:
- if (put_user(0, (int
*) arg
))
+ if (put_user(0, (int
__user *)argp
))
return -EFAULT;
break;
return -EFAULT;
break;
@@
-150,7
+152,7
@@
static int riowd_ioctl(struct inode *inode, struct file *filp,
break;
case WDIOC_SETOPTIONS:
break;
case WDIOC_SETOPTIONS:
- if (copy_from_user(&options,
(void *) arg
, sizeof(options)))
+ if (copy_from_user(&options,
argp
, sizeof(options)))
return -EFAULT;
if (options & WDIOS_DISABLECARD)
return -EFAULT;
if (options & WDIOS_DISABLECARD)
@@
-163,7
+165,7
@@
static int riowd_ioctl(struct inode *inode, struct file *filp,
break;
case WDIOC_SETTIMEOUT:
break;
case WDIOC_SETTIMEOUT:
- if (get_user(new_margin, (int
*)arg
))
+ if (get_user(new_margin, (int
__user *)argp
))
return -EFAULT;
if ((new_margin < 60) || (new_margin > (255 * 60)))
return -EINVAL;
return -EFAULT;
if ((new_margin < 60) || (new_margin > (255 * 60)))
return -EINVAL;
@@
-172,7
+174,7
@@
static int riowd_ioctl(struct inode *inode, struct file *filp,
/* Fall */
case WDIOC_GETTIMEOUT:
/* Fall */
case WDIOC_GETTIMEOUT:
- return put_user(riowd_timeout * 60, (int
*)arg
);
+ return put_user(riowd_timeout * 60, (int
__user *)argp
);
default:
return -EINVAL;
default:
return -EINVAL;
@@
-181,11
+183,8
@@
static int riowd_ioctl(struct inode *inode, struct file *filp,
return 0;
}
return 0;
}
-static ssize_t riowd_write(struct file *file, const char *buf, size_t count, loff_t *ppos)
+static ssize_t riowd_write(struct file *file, const char
__user
*buf, size_t count, loff_t *ppos)
{
{
- if (ppos != &file->f_pos)
- return -ESPIPE;
-
if (count) {
riowd_pingtimer();
return 1;
if (count) {
riowd_pingtimer();
return 1;
@@
-212,7
+211,7
@@
static int __init riowd_bbc_init(void)
for_each_ebus(ebus) {
for_each_ebusdev(edev, ebus) {
for_each_ebus(ebus) {
for_each_ebusdev(edev, ebus) {
- if (!strcmp(edev->
prom_
name, "bbc"))
+ if (!strcmp(edev->
ofdev.node->
name, "bbc"))
goto found_bbc;
}
}
goto found_bbc;
}
}
@@
-239,7
+238,7
@@
static int __init riowd_init(void)
for_each_ebus(ebus) {
for_each_ebusdev(edev, ebus) {
for_each_ebus(ebus) {
for_each_ebusdev(edev, ebus) {
- if (!strcmp(edev->
prom_
name, RIOWD_NAME))
+ if (!strcmp(edev->
ofdev.node->
name, RIOWD_NAME))
goto ebus_done;
}
}
goto ebus_done;
}
}