Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
reform-boundary-uboot
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jack Humbert
reform-boundary-uboot
Commits
c4330d28
Commit
c4330d28
authored
12 years ago
by
Troy Kisky
Committed by
Heiko Schocher
12 years ago
Browse files
Options
Downloads
Patches
Plain Diff
mxc_i2c: call i2c_imx_stop on error in i2c_read/i2c_write
Signed-off-by:
Troy Kisky
<
troy.kisky@boundarydevices.com
>
parent
b230ddc2
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
drivers/i2c/mxc_i2c.c
+7
-3
7 additions, 3 deletions
drivers/i2c/mxc_i2c.c
with
7 additions
and
3 deletions
drivers/i2c/mxc_i2c.c
+
7
−
3
View file @
c4330d28
...
...
@@ -337,8 +337,10 @@ int i2c_read(uchar chip, uint addr, int alen, uchar *buf, int len)
writeb
(
temp
,
&
i2c_regs
->
i2cr
);
ret
=
tx_byte
(
i2c_regs
,
(
chip
<<
1
)
|
1
);
if
(
ret
<
0
)
if
(
ret
<
0
)
{
i2c_imx_stop
();
return
ret
;
}
/* setup bus to read data */
temp
=
readb
(
&
i2c_regs
->
i2cr
);
...
...
@@ -352,8 +354,10 @@ int i2c_read(uchar chip, uint addr, int alen, uchar *buf, int len)
/* read data */
for
(
i
=
0
;
i
<
len
;
i
++
)
{
ret
=
i2c_imx_trx_complete
();
if
(
ret
)
if
(
ret
)
{
i2c_imx_stop
();
return
ret
;
}
/*
* It must generate STOP before read I2DR to prevent
...
...
@@ -395,7 +399,7 @@ int i2c_write(uchar chip, uint addr, int alen, uchar *buf, int len)
for
(
i
=
0
;
i
<
len
;
i
++
)
{
ret
=
tx_byte
(
i2c_regs
,
buf
[
i
]);
if
(
ret
<
0
)
re
turn
ret
;
b
re
ak
;
}
i2c_imx_stop
();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment