Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
Z
ZIO
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
ZIO
Commits
419a0555
Commit
419a0555
authored
Oct 28, 2013
by
Alessandro Rubini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
trivial: sysfs: simplify zobj_store_enable
Signed-off-by:
Alessandro Rubini
<
rubini@gnudd.com
>
parent
701703e8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
9 deletions
+5
-9
sysfs.c
sysfs.c
+5
-9
No files found.
sysfs.c
View file @
419a0555
...
...
@@ -553,18 +553,14 @@ static ssize_t zobj_store_enable(struct device *dev,
spinlock_t
*
lock
;
err
=
strict_strtol
(
buf
,
0
,
&
val
);
if
(
err
)
if
(
err
||
val
<
0
||
val
>
1
)
return
-
EINVAL
;
lock
=
__get_spinlock
(
to_zio_head
(
dev
));
/* change enable status */
if
(
unlikely
(
strcmp
(
attr
->
attr
.
name
,
ZOBJ_SYSFS_ENABLE
)
==
0
&&
(
val
==
0
||
val
==
1
)))
{
spin_lock
(
lock
);
__zobj_enable
(
dev
,
val
);
spin_unlock
(
lock
);
return
count
;
}
spin_lock
(
lock
);
__zobj_enable
(
dev
,
val
);
spin_unlock
(
lock
);
return
count
;
return
count
;
}
...
...
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