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
Kirill Smelkov
linux
Commits
07b21537
Commit
07b21537
authored
Apr 12, 2004
by
Jean Delvare
Committed by
Greg Kroah-Hartman
Apr 12, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] I2C: make I2C chip drivers return -EINVAL on error
parent
a30b044a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
3 deletions
+4
-3
drivers/i2c/chips/fscher.c
drivers/i2c/chips/fscher.c
+1
-1
drivers/i2c/chips/it87.c
drivers/i2c/chips/it87.c
+1
-1
drivers/i2c/chips/pcf8591.c
drivers/i2c/chips/pcf8591.c
+2
-1
No files found.
drivers/i2c/chips/fscher.c
View file @
07b21537
...
...
@@ -512,7 +512,7 @@ static ssize_t set_fan_div(struct i2c_client *client, struct fscher_data *data,
default:
dev_err
(
&
client
->
dev
,
"fan_div value %ld not "
"supported. Choose one of 2, 4 or 8!
\n
"
,
v
);
return
-
1
;
return
-
EINVAL
;
}
/* bits 2..7 reserved => mask with 0x03 */
...
...
drivers/i2c/chips/it87.c
View file @
07b21537
...
...
@@ -367,7 +367,7 @@ static ssize_t set_sensor(struct device *dev, const char *buf,
else
if
(
val
==
2
)
data
->
sensor
|=
8
<<
nr
;
else
if
(
val
!=
0
)
return
-
1
;
return
-
EINVAL
;
it87_write_value
(
client
,
IT87_REG_TEMP_ENABLE
,
data
->
sensor
);
return
count
;
}
...
...
drivers/i2c/chips/pcf8591.c
View file @
07b21537
...
...
@@ -129,8 +129,9 @@ static ssize_t set_out0_output(struct device *dev, const char *buf, size_t count
if
((
value
=
(
simple_strtoul
(
buf
,
NULL
,
10
)
+
5
)
/
10
)
<=
255
)
{
data
->
aout
=
value
;
i2c_smbus_write_byte_data
(
client
,
data
->
control
,
data
->
aout
);
return
count
;
}
return
count
;
return
-
EINVAL
;
}
static
DEVICE_ATTR
(
out0_output
,
S_IWUSR
|
S_IRUGO
,
...
...
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