From: Samuel Ortiz <sameo@linux.intel.com>
To: Linus Walleij <linus.walleij@stericsson.com>
Cc: linux-kernel@vger.kernel.org,
Srinidhi Kasagar <srinidhi.kasagar@stericsson.com>
Subject: Re: [PATCH] MFD: AB8500 mask off irrelevant bits from the SPI message
Date: Fri, 18 Jun 2010 23:19:06 +0200 [thread overview]
Message-ID: <20100618211905.GF3582@sortiz.org> (raw)
In-Reply-To: <1275008384-17285-1-git-send-email-linus.walleij@stericsson.com>
Hi Linus,
On Fri, May 28, 2010 at 02:59:44AM +0200, Linus Walleij wrote:
> The registers on the AB8500 are only 8 bits wide, so the content
> of the remaining bits is undefined. Let's mask off the undefined
> stuff when returning a register in an SPI read.
Patch applied, sorry for the delay.
Cheers,
Samuel.
> Acked-by: Rabin Vincent <rabin.vincent@stericsson.com>
> Signed-off-by: Linus Walleij <linus.walleij@stericsson.com>
> ---
> drivers/mfd/ab8500-spi.c | 7 ++++++-
> 1 files changed, 6 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/mfd/ab8500-spi.c b/drivers/mfd/ab8500-spi.c
> index b81d4f7..e1c8b62 100644
> --- a/drivers/mfd/ab8500-spi.c
> +++ b/drivers/mfd/ab8500-spi.c
> @@ -68,7 +68,12 @@ static int ab8500_spi_read(struct ab8500 *ab8500, u16 addr)
>
> ret = spi_sync(spi, &msg);
> if (!ret)
> - ret = ab8500->rx_buf[0];
> + /*
> + * Only the 8 lowermost bytes are
> + * defined with value, the rest may
> + * vary depending on chip/board noise.
> + */
> + ret = ab8500->rx_buf[0] & 0xFFU;
>
> return ret;
> }
> --
> 1.6.3.3
>
--
Intel Open Source Technology Centre
http://oss.intel.com/
prev parent reply other threads:[~2010-06-18 21:19 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-28 0:59 [PATCH] MFD: AB8500 mask off irrelevant bits from the SPI message Linus Walleij
2010-06-17 16:46 ` Linus Walleij
2010-06-17 19:18 ` Samuel Ortiz
2010-06-18 21:19 ` Samuel Ortiz [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=20100618211905.GF3582@sortiz.org \
--to=sameo@linux.intel.com \
--cc=linus.walleij@stericsson.com \
--cc=linux-kernel@vger.kernel.org \
--cc=srinidhi.kasagar@stericsson.com \
/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.