Skip to content
Commit 5ed1c55f authored by Michel Alex's avatar Michel Alex Committed by Tom Rini
Browse files

misc: i2c_eeprom: consider pagesize when writing to eeprom



Calculate the maximum length of the buffer when writing
across the page boundary. If the buffer length (len)
exceeds the page boundary (pagesize), split it. Use this
length instead of comparing the length with the pagesize,
because if the write start address (offset) is not at the
beginning of a page and the page_offset + len is greater
than the page boundary (pagesize), the write operation
would overflow the current page and the behaviour can be
undefined (e.g. at24).

Signed-off-by: default avatarAlex Michel <alex.michel@wiedemann-group.com>
parent 9f339140
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment