Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
8c30fef8
Commit
8c30fef8
authored
Jan 03, 2004
by
Wim Van Sebroeck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[WATCHDOG] 2.6.0-rc1 _is_open.patch
Make _is_open code consistent for all watchdog-drivers
parent
a74c51c3
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
16 deletions
+9
-16
drivers/char/watchdog/ib700wdt.c
drivers/char/watchdog/ib700wdt.c
+4
-7
drivers/char/watchdog/machzwd.c
drivers/char/watchdog/machzwd.c
+4
-8
drivers/char/watchdog/mixcomwd.c
drivers/char/watchdog/mixcomwd.c
+1
-1
No files found.
drivers/char/watchdog/ib700wdt.c
View file @
8c30fef8
...
...
@@ -48,7 +48,7 @@
#include <asm/uaccess.h>
#include <asm/system.h>
static
int
ibwdt_is_open
;
static
unsigned
long
ibwdt_is_open
;
static
spinlock_t
ibwdt_lock
;
static
char
expect_close
;
...
...
@@ -184,9 +184,7 @@ ibwdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
break
;
case
WDIOC_GETSTATUS
:
if
(
copy_to_user
((
int
*
)
arg
,
&
ibwdt_is_open
,
sizeof
(
int
)))
return
-
EFAULT
;
break
;
return
put_user
(
0
,
(
int
*
)
arg
);
case
WDIOC_KEEPALIVE
:
ibwdt_ping
();
...
...
@@ -218,7 +216,7 @@ static int
ibwdt_open
(
struct
inode
*
inode
,
struct
file
*
file
)
{
spin_lock
(
&
ibwdt_lock
);
if
(
ibwdt_is_open
)
{
if
(
test_and_set_bit
(
0
,
&
ibwdt_is_open
)
)
{
spin_unlock
(
&
ibwdt_lock
);
return
-
EBUSY
;
}
...
...
@@ -226,7 +224,6 @@ ibwdt_open(struct inode *inode, struct file *file)
__module_get
(
THIS_MODULE
);
/* Activate */
ibwdt_is_open
=
1
;
ibwdt_ping
();
spin_unlock
(
&
ibwdt_lock
);
return
0
;
...
...
@@ -241,7 +238,7 @@ ibwdt_close(struct inode *inode, struct file *file)
else
printk
(
KERN_CRIT
PFX
"WDT device closed unexpectedly. WDT will not stop!
\n
"
);
ibwdt_is_open
=
0
;
clear_bit
(
0
,
&
ibwdt_is_open
)
;
expect_close
=
0
;
spin_unlock
(
&
ibwdt_lock
);
return
0
;
...
...
drivers/char/watchdog/machzwd.c
View file @
8c30fef8
...
...
@@ -130,7 +130,7 @@ module_param(action, int, 0);
MODULE_PARM_DESC
(
action
,
"after watchdog resets, generate: 0 = RESET(*) 1 = SMI 2 = NMI 3 = SCI"
);
static
int
zf_action
=
GEN_RESET
;
static
int
zf_is_open
=
0
;
static
unsigned
long
zf_is_open
;
static
char
zf_expect_close
;
static
spinlock_t
zf_lock
;
static
spinlock_t
zf_port_lock
;
...
...
@@ -359,9 +359,7 @@ static int zf_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
break
;
case
WDIOC_GETSTATUS
:
if
(
copy_to_user
((
int
*
)
arg
,
&
zf_is_open
,
sizeof
(
int
)))
return
-
EFAULT
;
break
;
return
put_user
(
0
,
(
int
*
)
arg
);
case
WDIOC_KEEPALIVE
:
zf_ping
(
0
);
...
...
@@ -377,7 +375,7 @@ static int zf_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
static
int
zf_open
(
struct
inode
*
inode
,
struct
file
*
file
)
{
spin_lock
(
&
zf_lock
);
if
(
zf_is_open
)
{
if
(
test_and_set_bit
(
0
,
&
zf_is_open
))
{
spin_unlock
(
&
zf_lock
);
return
-
EBUSY
;
}
...
...
@@ -385,8 +383,6 @@ static int zf_open(struct inode *inode, struct file *file)
if
(
nowayout
)
__module_get
(
THIS_MODULE
);
zf_is_open
=
1
;
spin_unlock
(
&
zf_lock
);
zf_timer_on
();
...
...
@@ -404,7 +400,7 @@ static int zf_close(struct inode *inode, struct file *file)
}
spin_lock
(
&
zf_lock
);
zf_is_open
=
0
;
clear_bit
(
0
,
&
zf_is_open
)
;
spin_unlock
(
&
zf_lock
);
zf_expect_close
=
0
;
...
...
drivers/char/watchdog/mixcomwd.c
View file @
8c30fef8
...
...
@@ -55,7 +55,7 @@ static int mixcomwd_ioports[] = { 0x180, 0x280, 0x380, 0x000 };
#define FLASHCOM_WATCHDOG_OFFSET 0x4
#define FLASHCOM_ID 0x18
static
long
mixcomwd_opened
;
/* long req'd for setbit --RR */
static
unsigned
long
mixcomwd_opened
;
/* long req'd for setbit --RR */
static
int
watchdog_port
;
static
int
mixcomwd_timer_alive
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment