From: Heiko Schocher <hs@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] i2c: mv_i2c.c: Correct address endianness
Date: Mon, 19 Dec 2016 07:22:04 +0100 [thread overview]
Message-ID: <58577C8C.30002@denx.de> (raw)
In-Reply-To: <f7f00113-c5e7-e0af-4a77-c49cbb61d3e4@denx.de>
Hello Stefan,
Am 19.12.2016 um 06:56 schrieb Stefan Roese:
> On 13.12.2016 18:49, Bradley Bolen wrote:
>> 0c0f719ad2f46c8566a56daee37ebdb7c078c3b1 accidentally changed the
>> endianness of the i2c read and write addresses. This was noticable when
>> accessing EEPROMs that use 2 byte addressing as the LSB was being sent
>> first.
>>
>> Signed-off-by: Bradley Bolen <bradleybolen@gmail.com>
>> ---
>> drivers/i2c/mv_i2c.c | 4 ++--
>> 1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/i2c/mv_i2c.c b/drivers/i2c/mv_i2c.c
>> index 7f52fa2..c780272 100644
>> --- a/drivers/i2c/mv_i2c.c
>> +++ b/drivers/i2c/mv_i2c.c
>> @@ -270,7 +270,7 @@ static int __i2c_read(struct mv_i2c *base, uchar chip, u8 *addr, int alen,
>> msg.condition = I2C_COND_NORMAL;
>> msg.acknack = I2C_ACKNAK_WAITACK;
>> msg.direction = I2C_WRITE;
>> - msg.data = *(addr++);
>> + msg.data = addr[alen];
>> if (i2c_transfer(base, &msg))
>> return -1;
>> }
>> @@ -341,7 +341,7 @@ static int __i2c_write(struct mv_i2c *base, uchar chip, u8 *addr, int alen,
>> msg.condition = I2C_COND_NORMAL;
>> msg.acknack = I2C_ACKNAK_WAITACK;
>> msg.direction = I2C_WRITE;
>> - msg.data = *(addr++);
>> + msg.data = addr[alen];
>> if (i2c_transfer(base, &msg))
>> return -1;
>> }
>>
>
> Thanks for spotting:
>
> Rewiewed-by: Stefan Roese <sr@denx.de>
Typo ... I fix this when applying this patch.
Thanks!
bye,
Heiko
--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
prev parent reply other threads:[~2016-12-19 6:22 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-13 17:49 [U-Boot] [PATCH] i2c: mv_i2c.c: Correct address endianness Bradley Bolen
2016-12-19 5:56 ` Stefan Roese
2016-12-19 6:22 ` Heiko Schocher [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=58577C8C.30002@denx.de \
--to=hs@denx.de \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.