public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] pmic_i2c: Return error in case of invalid pmic_i2c_tx_num
@ 2012-03-16 21:32 Fabio Estevam
  2012-03-17  0:55 ` Marek Vasut
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Fabio Estevam @ 2012-03-16 21:32 UTC (permalink / raw)
  To: u-boot

Return error in case of invalid pmic_i2c_tx_num.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
 drivers/misc/pmic_i2c.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/drivers/misc/pmic_i2c.c b/drivers/misc/pmic_i2c.c
index ad55d64..ebb124d 100644
--- a/drivers/misc/pmic_i2c.c
+++ b/drivers/misc/pmic_i2c.c
@@ -47,6 +47,9 @@ int pmic_reg_write(struct pmic *p, u32 reg, u32 val)
 	case 1:
 		buf[0] = val & 0xff;
 		break;
+	default:
+		printf("%s: invalid tx_num: %d", __func__, pmic_i2c_tx_num);
+		return -1;
 	}
 
 	if (i2c_write(pmic_i2c_addr, reg, 1, buf, pmic_i2c_tx_num))
@@ -73,6 +76,9 @@ int pmic_reg_read(struct pmic *p, u32 reg, u32 *val)
 	case 1:
 		ret_val = buf[0];
 		break;
+	default:
+		printf("%s: invalid tx_num: %d", __func__, pmic_i2c_tx_num);
+		return -1;
 	}
 	memcpy(val, &ret_val, sizeof(ret_val));
 
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [U-Boot] [PATCH] pmic_i2c: Return error in case of invalid pmic_i2c_tx_num
  2012-03-16 21:32 [U-Boot] [PATCH] pmic_i2c: Return error in case of invalid pmic_i2c_tx_num Fabio Estevam
@ 2012-03-17  0:55 ` Marek Vasut
  2012-03-19 15:57 ` Lukasz Majewski
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Marek Vasut @ 2012-03-17  0:55 UTC (permalink / raw)
  To: u-boot

Dear Fabio Estevam,

> Return error in case of invalid pmic_i2c_tx_num.
> 
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>

Acked-by: Marek Vasut <marex@denx.de>

Best regards,
Marek Vasut

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [U-Boot] [PATCH] pmic_i2c: Return error in case of invalid pmic_i2c_tx_num
  2012-03-16 21:32 [U-Boot] [PATCH] pmic_i2c: Return error in case of invalid pmic_i2c_tx_num Fabio Estevam
  2012-03-17  0:55 ` Marek Vasut
@ 2012-03-19 15:57 ` Lukasz Majewski
  2012-03-19 16:22 ` Stefano Babic
  2012-03-19 16:46 ` Stefano Babic
  3 siblings, 0 replies; 5+ messages in thread
From: Lukasz Majewski @ 2012-03-19 15:57 UTC (permalink / raw)
  To: u-boot

On Fri, 16 Mar 2012 18:32:09 -0300
Fabio Estevam <festevam@gmail.com> wrote:

> Return error in case of invalid pmic_i2c_tx_num.
> 
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
> ---
>  drivers/misc/pmic_i2c.c |    6 ++++++
>  1 files changed, 6 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/misc/pmic_i2c.c b/drivers/misc/pmic_i2c.c
> index ad55d64..ebb124d 100644
> --- a/drivers/misc/pmic_i2c.c
> +++ b/drivers/misc/pmic_i2c.c
> @@ -47,6 +47,9 @@ int pmic_reg_write(struct pmic *p, u32 reg, u32 val)
>  	case 1:
>  		buf[0] = val & 0xff;
>  		break;
> +	default:
> +		printf("%s: invalid tx_num: %d", __func__,
> pmic_i2c_tx_num);
> +		return -1;
>  	}
>  
>  	if (i2c_write(pmic_i2c_addr, reg, 1, buf, pmic_i2c_tx_num))
> @@ -73,6 +76,9 @@ int pmic_reg_read(struct pmic *p, u32 reg, u32 *val)
>  	case 1:
>  		ret_val = buf[0];
>  		break;
> +	default:
> +		printf("%s: invalid tx_num: %d", __func__,
> pmic_i2c_tx_num);
> +		return -1;
>  	}
>  	memcpy(val, &ret_val, sizeof(ret_val));
>  

Hi Fabio,

Looks ok, for me.

Acked-by: Lukasz Majewski <l.majewski@samsung.com>
-- 
Best regards,

Lukasz Majewski

Samsung Poland R&D Center
Platform Group

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [U-Boot] [PATCH] pmic_i2c: Return error in case of invalid pmic_i2c_tx_num
  2012-03-16 21:32 [U-Boot] [PATCH] pmic_i2c: Return error in case of invalid pmic_i2c_tx_num Fabio Estevam
  2012-03-17  0:55 ` Marek Vasut
  2012-03-19 15:57 ` Lukasz Majewski
@ 2012-03-19 16:22 ` Stefano Babic
  2012-03-19 16:46 ` Stefano Babic
  3 siblings, 0 replies; 5+ messages in thread
From: Stefano Babic @ 2012-03-19 16:22 UTC (permalink / raw)
  To: u-boot

On 16/03/2012 22:32, Fabio Estevam wrote:
> Return error in case of invalid pmic_i2c_tx_num.
> 
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
> ---
>  drivers/misc/pmic_i2c.c |    6 ++++++
>  1 files changed, 6 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/misc/pmic_i2c.c b/drivers/misc/pmic_i2c.c
> index ad55d64..ebb124d 100644
> --- a/drivers/misc/pmic_i2c.c
> +++ b/drivers/misc/pmic_i2c.c
> @@ -47,6 +47,9 @@ int pmic_reg_write(struct pmic *p, u32 reg, u32 val)
>  	case 1:
>  		buf[0] = val & 0xff;
>  		break;
> +	default:
> +		printf("%s: invalid tx_num: %d", __func__, pmic_i2c_tx_num);
> +		return -1;
>  	}
>  
>  	if (i2c_write(pmic_i2c_addr, reg, 1, buf, pmic_i2c_tx_num))
> @@ -73,6 +76,9 @@ int pmic_reg_read(struct pmic *p, u32 reg, u32 *val)
>  	case 1:
>  		ret_val = buf[0];
>  		break;
> +	default:
> +		printf("%s: invalid tx_num: %d", __func__, pmic_i2c_tx_num);
> +		return -1;
>  	}
>  	memcpy(val, &ret_val, sizeof(ret_val));


Acked-by: Stefano Babic <sbabic@denx.de>

Best regards,
Stefano Babic

-- 
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: office at denx.de
=====================================================================

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [U-Boot] [PATCH] pmic_i2c: Return error in case of invalid pmic_i2c_tx_num
  2012-03-16 21:32 [U-Boot] [PATCH] pmic_i2c: Return error in case of invalid pmic_i2c_tx_num Fabio Estevam
                   ` (2 preceding siblings ...)
  2012-03-19 16:22 ` Stefano Babic
@ 2012-03-19 16:46 ` Stefano Babic
  3 siblings, 0 replies; 5+ messages in thread
From: Stefano Babic @ 2012-03-19 16:46 UTC (permalink / raw)
  To: u-boot

On 16/03/2012 22:32, Fabio Estevam wrote:
> Return error in case of invalid pmic_i2c_tx_num.
> 
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
> ---

Applied to u-boot-imx, thanks.

Best regards,
Stefano Babic

-- 
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: office at denx.de
=====================================================================

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-03-19 16:46 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-16 21:32 [U-Boot] [PATCH] pmic_i2c: Return error in case of invalid pmic_i2c_tx_num Fabio Estevam
2012-03-17  0:55 ` Marek Vasut
2012-03-19 15:57 ` Lukasz Majewski
2012-03-19 16:22 ` Stefano Babic
2012-03-19 16:46 ` Stefano Babic

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox