public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Lukasz Majewski <l.majewski@samsung.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] pmic_i2c: Return error in case of invalid pmic_i2c_tx_num
Date: Mon, 19 Mar 2012 16:57:19 +0100	[thread overview]
Message-ID: <20120319165719.1fb0d04e@lmajewski.digital.local> (raw)
In-Reply-To: <1331933529-7380-1-git-send-email-festevam@gmail.com>

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

  parent reply	other threads:[~2012-03-19 15:57 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2012-03-19 16:22 ` Stefano Babic
2012-03-19 16:46 ` Stefano Babic

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=20120319165719.1fb0d04e@lmajewski.digital.local \
    --to=l.majewski@samsung.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox