All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: sameo@openedhand.com, linux-kernel@vger.kernel.org,
	broonie@opensource.wolfsonmicro.com
Subject: Re: [PATCH 3/3] mfd: Improve diagnostics for WM8350 ID register probe
Date: Fri, 30 Jan 2009 12:10:09 -0800	[thread overview]
Message-ID: <20090130121009.6de9f11c.akpm@linux-foundation.org> (raw)
In-Reply-To: <1232727516-5049-3-git-send-email-broonie@opensource.wolfsonmicro.com>

On Fri, 23 Jan 2009 16:18:36 +0000
Mark Brown <broonie@opensource.wolfsonmicro.com> wrote:

> @@ -1297,14 +1297,29 @@ static void wm8350_client_dev_register(struct wm8350 *wm8350,
>  int wm8350_device_init(struct wm8350 *wm8350, int irq,
>  		       struct wm8350_platform_data *pdata)
>  {
> -	int ret = -EINVAL;
> +	int ret;
>  	u16 id1, id2, mask_rev;
>  	u16 cust_id, mode, chip_rev;
>  
>  	/* get WM8350 revision and config mode */
> -	wm8350->read_dev(wm8350, WM8350_RESET_ID, sizeof(id1), &id1);
> -	wm8350->read_dev(wm8350, WM8350_ID, sizeof(id2), &id2);
> -	wm8350->read_dev(wm8350, WM8350_REVISION, sizeof(mask_rev), &mask_rev);
> +	ret = wm8350->read_dev(wm8350, WM8350_RESET_ID, sizeof(id1), &id1);
> +	if (ret != 0) {
> +		dev_err(wm8350->dev, "Failed to read ID: %d\n", ret);
> +		goto err;
> +	}
> +
> +	ret = wm8350->read_dev(wm8350, WM8350_ID, sizeof(id2), &id2);

Reading a bunch of bytes into a u16 looks a bit fishy from the endianness
point of view?

  reply	other threads:[~2009-01-30 20:11 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-23 16:18 [PATCH 1/3] mfd: Mark WM835x USB_SLV_500MA bit as accessible Mark Brown
2009-01-23 16:18 ` [PATCH 2/3] mfd: Initialise WM8350 interrupts earlier Mark Brown
2009-01-23 16:18   ` [PATCH 3/3] mfd: Improve diagnostics for WM8350 ID register probe Mark Brown
2009-01-30 20:10     ` Andrew Morton [this message]
2009-02-02 11:00       ` Mark Brown
2009-02-02 11:42         ` Mark Brown
2009-02-06 13:57 ` [PATCH 1/3] mfd: Mark WM835x USB_SLV_500MA bit as accessible Samuel Ortiz

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=20090130121009.6de9f11c.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sameo@openedhand.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.