diff mbox

[U-Boot,RFC,1/2] cmd_i2c: change variable type for 10bit addressing support

Message ID 1419014064-19214-2-git-send-email-yamada.m@jp.panasonic.com
State Accepted
Delegated to: Simon Glass
Headers show

Commit Message

Masahiro Yamada Dec. 19, 2014, 6:34 p.m. UTC
To store 10bit chip address, the variable type should not be uchar,
but uint.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Cc: Heiko Schocher <hs@denx.de>
Cc: Simon Glass <sjg@chromium.org>
---

 common/cmd_i2c.c | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

Comments

Simon Glass Dec. 19, 2014, 9:23 p.m. UTC | #1
On 19 December 2014 at 11:34, Masahiro Yamada <yamada.m@jp.panasonic.com> wrote:
> To store 10bit chip address, the variable type should not be uchar,
> but uint.
>
> Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
> Cc: Heiko Schocher <hs@denx.de>
> Cc: Simon Glass <sjg@chromium.org>
> ---
>
>  common/cmd_i2c.c | 22 +++++++++++-----------
>  1 file changed, 11 insertions(+), 11 deletions(-)

Acked-by: Simon Glass <sjg@chromium.org>
Simon Glass Dec. 29, 2014, 9:59 p.m. UTC | #2
Hi,

On 19 December 2014 at 14:23, Simon Glass <sjg@chromium.org> wrote:
> On 19 December 2014 at 11:34, Masahiro Yamada <yamada.m@jp.panasonic.com> wrote:
>> To store 10bit chip address, the variable type should not be uchar,
>> but uint.
>>
>> Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
>> Cc: Heiko Schocher <hs@denx.de>
>> Cc: Simon Glass <sjg@chromium.org>
>> ---
>>
>>  common/cmd_i2c.c | 22 +++++++++++-----------
>>  1 file changed, 11 insertions(+), 11 deletions(-)
>
> Acked-by: Simon Glass <sjg@chromium.org>

I feel I should apply this to u-boot-dm as a bug fix, but please let
me know if there are any objections.

Regards,
Simon
Heiko Schocher Jan. 5, 2015, 5:38 a.m. UTC | #3
Hello Simon,

Am 29.12.2014 22:59, schrieb Simon Glass:
> Hi,
>
> On 19 December 2014 at 14:23, Simon Glass <sjg@chromium.org> wrote:
>> On 19 December 2014 at 11:34, Masahiro Yamada <yamada.m@jp.panasonic.com> wrote:
>>> To store 10bit chip address, the variable type should not be uchar,
>>> but uint.
>>>
>>> Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
>>> Cc: Heiko Schocher <hs@denx.de>
>>> Cc: Simon Glass <sjg@chromium.org>
>>> ---
>>>
>>>   common/cmd_i2c.c | 22 +++++++++++-----------
>>>   1 file changed, 11 insertions(+), 11 deletions(-)
>>
>> Acked-by: Simon Glass <sjg@chromium.org>
>
> I feel I should apply this to u-boot-dm as a bug fix, but please let
> me know if there are any objections.

I am fine with that, so:

Acked-by: Heiko Schocher<hs@denx.de>

bye,
Heiko
diff mbox

Patch

diff --git a/common/cmd_i2c.c b/common/cmd_i2c.c
index 22db1bb..f65ab61 100644
--- a/common/cmd_i2c.c
+++ b/common/cmd_i2c.c
@@ -83,12 +83,12 @@  DECLARE_GLOBAL_DATA_PTR;
 /* Display values from last command.
  * Memory modify remembered values are different from display memory.
  */
-static uchar	i2c_dp_last_chip;
+static uint	i2c_dp_last_chip;
 static uint	i2c_dp_last_addr;
 static uint	i2c_dp_last_alen;
 static uint	i2c_dp_last_length = 0x10;
 
-static uchar	i2c_mm_last_chip;
+static uint	i2c_mm_last_chip;
 static uint	i2c_mm_last_addr;
 static uint	i2c_mm_last_alen;
 
@@ -282,7 +282,7 @@  static int i2c_report_err(int ret, enum i2c_err_op op)
  */
 static int do_i2c_read ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
-	u_char	chip;
+	uint	chip;
 	uint	devaddr, length;
 	int alen;
 	u_char  *memaddr;
@@ -335,7 +335,7 @@  static int do_i2c_read ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv
 
 static int do_i2c_write(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
-	u_char	chip;
+	uint	chip;
 	uint	devaddr, length;
 	int alen;
 	u_char  *memaddr;
@@ -444,7 +444,7 @@  static int do_i2c_flags(cmd_tbl_t *cmdtp, int flag, int argc,
  */
 static int do_i2c_md ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
-	u_char	chip;
+	uint	chip;
 	uint	addr, length;
 	int alen;
 	int	j, nbytes, linebytes;
@@ -563,7 +563,7 @@  static int do_i2c_md ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]
  */
 static int do_i2c_mw ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
-	uchar	chip;
+	uint	chip;
 	ulong	addr;
 	int	alen;
 	uchar	byte;
@@ -649,7 +649,7 @@  static int do_i2c_mw ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]
  */
 static int do_i2c_crc (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
-	uchar	chip;
+	uint	chip;
 	ulong	addr;
 	int	alen;
 	int	count;
@@ -734,7 +734,7 @@  static int do_i2c_crc (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]
 static int
 mod_i2c_mem(cmd_tbl_t *cmdtp, int incrflag, int flag, int argc, char * const argv[])
 {
-	uchar	chip;
+	uint	chip;
 	ulong	addr;
 	int	alen;
 	ulong	data;
@@ -957,7 +957,7 @@  static int do_i2c_probe (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv
  */
 static int do_i2c_loop(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 {
-	u_char	chip;
+	uint	chip;
 	int alen;
 	uint	addr;
 	uint	length;
@@ -1085,7 +1085,7 @@  static int do_sdram (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
 {
 	enum { unknown, EDO, SDRAM, DDR2 } type;
 
-	u_char	chip;
+	uint	chip;
 	u_char	data[128];
 	u_char	cksum;
 	int	j;
@@ -1563,7 +1563,7 @@  static int do_sdram (cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
 #if defined(CONFIG_I2C_EDID)
 int do_edid(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
 {
-	u_char chip;
+	uint chip;
 	struct edid1_info edid;
 	int ret;
 #ifdef CONFIG_DM_I2C