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
14dc9e49
Commit
14dc9e49
authored
Apr 08, 2004
by
Greg Kroah-Hartman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] I2C: minor bugfixes for the pcf8591.c driver and formatting cleanups.
parent
fffab9e0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
6 deletions
+4
-6
drivers/i2c/chips/pcf8591.c
drivers/i2c/chips/pcf8591.c
+4
-6
No files found.
drivers/i2c/chips/pcf8591.c
View file @
14dc9e49
...
@@ -125,8 +125,7 @@ static ssize_t set_out0_output(struct device *dev, const char *buf, size_t count
...
@@ -125,8 +125,7 @@ static ssize_t set_out0_output(struct device *dev, const char *buf, size_t count
unsigned
int
value
;
unsigned
int
value
;
struct
i2c_client
*
client
=
to_i2c_client
(
dev
);
struct
i2c_client
*
client
=
to_i2c_client
(
dev
);
struct
pcf8591_data
*
data
=
i2c_get_clientdata
(
client
);
struct
pcf8591_data
*
data
=
i2c_get_clientdata
(
client
);
if
((
value
=
(
simple_strtoul
(
buf
,
NULL
,
10
)
+
5
)
/
10
)
<=
255
);
if
((
value
=
(
simple_strtoul
(
buf
,
NULL
,
10
)
+
5
)
/
10
)
<=
255
)
{
{
data
->
aout
=
value
;
data
->
aout
=
value
;
i2c_smbus_write_byte_data
(
client
,
data
->
control
,
data
->
aout
);
i2c_smbus_write_byte_data
(
client
,
data
->
control
,
data
->
aout
);
}
}
...
@@ -235,9 +234,9 @@ int pcf8591_detect(struct i2c_adapter *adapter, int address, int kind)
...
@@ -235,9 +234,9 @@ int pcf8591_detect(struct i2c_adapter *adapter, int address, int kind)
/* OK, this is not exactly good programming practice, usually. But it is
/* OK, this is not exactly good programming practice, usually. But it is
very code-efficient in this case. */
very code-efficient in this case. */
exit_kfree:
exit_kfree:
kfree
(
new_client
);
kfree
(
new_client
);
exit:
exit:
return
err
;
return
err
;
}
}
...
@@ -277,8 +276,7 @@ static int pcf8591_read_channel(struct device *dev, int channel)
...
@@ -277,8 +276,7 @@ static int pcf8591_read_channel(struct device *dev, int channel)
down
(
&
data
->
update_lock
);
down
(
&
data
->
update_lock
);
if
((
data
->
control
&
PCF8591_CONTROL_AICH_MASK
)
!=
channel
)
if
((
data
->
control
&
PCF8591_CONTROL_AICH_MASK
)
!=
channel
)
{
{
data
->
control
=
(
data
->
control
&
~
PCF8591_CONTROL_AICH_MASK
)
data
->
control
=
(
data
->
control
&
~
PCF8591_CONTROL_AICH_MASK
)
|
channel
;
|
channel
;
i2c_smbus_write_byte
(
client
,
data
->
control
);
i2c_smbus_write_byte
(
client
,
data
->
control
);
...
...
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