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
04315f20
Commit
04315f20
authored
Jan 10, 2003
by
Dave Jones
Committed by
Dave Jones
Jan 10, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[WATCHDOG] ALIM7101 fixes from 2.4 + C99 structs
parent
6c583251
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
26 deletions
+31
-26
drivers/char/watchdog/alim7101_wdt.c
drivers/char/watchdog/alim7101_wdt.c
+31
-26
No files found.
drivers/char/watchdog/alim7101_wdt.c
View file @
04315f20
...
...
@@ -79,6 +79,15 @@ static unsigned long wdt_is_open;
static
int
wdt_expect_close
;
static
struct
pci_dev
*
alim7101_pmu
;
#ifdef CONFIG_WATCHDOG_NOWAYOUT
static
int
nowayout
=
1
;
#else
static
int
nowayout
=
0
;
#endif
MODULE_PARM
(
nowayout
,
"i"
);
MODULE_PARM_DESC
(
nowayout
,
"Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"
);
/*
* Whack the dog
*/
...
...
@@ -155,8 +164,8 @@ static ssize_t fop_write(struct file * file, const char * buf, size_t count, lof
return
-
ESPIPE
;
/* See if we got the magic character */
if
(
count
)
{
if
(
count
)
{
if
(
!
nowayout
)
{
size_t
ofs
;
/* note: just in case someone wrote the magic character
...
...
@@ -164,14 +173,14 @@ static ssize_t fop_write(struct file * file, const char * buf, size_t count, lof
wdt_expect_close
=
0
;
/* now scan */
for
(
ofs
=
0
;
ofs
!=
count
;
ofs
++
)
{
for
(
ofs
=
0
;
ofs
!=
count
;
ofs
++
)
{
char
c
;
if
(
get_user
(
c
,
buf
+
ofs
))
if
(
get_user
(
c
,
buf
+
ofs
))
return
-
EFAULT
;
if
(
c
==
'V'
)
if
(
c
==
'V'
)
wdt_expect_close
=
1
;
}
}
/* someone wrote to us, we should restart timer */
next_heartbeat
=
jiffies
+
WDT_HEARTBEAT
;
return
1
;
...
...
@@ -197,26 +206,22 @@ static int fop_open(struct inode * inode, struct file * file)
static
int
fop_close
(
struct
inode
*
inode
,
struct
file
*
file
)
{
#ifdef CONFIG_WDT_NOWAYOUT
if
(
wdt_expect_close
)
wdt_turnoff
();
else
{
else
printk
(
OUR_NAME
": device file closed unexpectedly. Will not stop the WDT!
\n
"
);
}
#else
wdt_turnoff
();
#endif
clear_bit
(
0
,
&
wdt_is_open
);
return
0
;
}
static
int
fop_ioctl
(
struct
inode
*
inode
,
struct
file
*
file
,
unsigned
int
cmd
,
unsigned
long
arg
)
{
static
struct
watchdog_info
ident
=
static
struct
watchdog_info
ident
=
{
0
,
1
,
"ALiM7101"
.
options
=
WDIOF_MAGICCLOSE
,
.
firmware_version
=
1
,
.
identity
=
"ALiM7101"
};
switch
(
cmd
)
...
...
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