Skip to content
Snippets Groups Projects
Commit 52bc7c7e authored by Alexey Brodkin's avatar Alexey Brodkin Committed by Tom Rini
Browse files

eeprom: fix eeprom write procedure


This fixes commit 1a37889b:
----------------------->8--------------------
eeprom: Pull out the RW loop

Unify the code for doing read/write into single function, since the
code for both the read and write is almost identical. This again
trims down the code duplication.
----------------------->8--------------------

where the same one routine is utilized for both EEPROM writing and
reading. The only difference was supposed to be a "read" flag which
in both cases was set with 1 somehow.

That lead to a missing delay in case of writing which lead to write
failure (in my case no data was written).

Signed-off-by: default avatarAlexey Brodkin <abrodkin@synopsys.com>
Acked-by: default avatarMarek Vasut <marex@denx.de>
Cc: Simon Glass <sjg@chromium.org>
Cc: Tom Rini <trini@konsulko.com>
Cc: Heiko Schocher <hs@denx.de>
parent 2e680f92
No related branches found
No related tags found
No related merge requests found
...@@ -197,7 +197,7 @@ int eeprom_write(unsigned dev_addr, unsigned offset, ...@@ -197,7 +197,7 @@ int eeprom_write(unsigned dev_addr, unsigned offset,
* We must write the address again when changing pages * We must write the address again when changing pages
* because the address counter only increments within a page. * because the address counter only increments within a page.
*/ */
ret = eeprom_rw(dev_addr, offset, buffer, cnt, 1); ret = eeprom_rw(dev_addr, offset, buffer, cnt, 0);
eeprom_write_enable(dev_addr, 0); eeprom_write_enable(dev_addr, 0);
return ret; return ret;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment