All of lore.kernel.org
 help / color / mirror / Atom feed
From: Timur Tabi <timur@freescale.com>
To: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>
Cc: alsa-devel@alsa-project.org, broonie@opensource.wolfsonmicro.com,
	lrg@slimlogic.co.uk
Subject: Re: [PATCH] [v2] ASoC: cs4270: use the built-in register cache support
Date: Mon, 10 Jan 2011 11:35:50 -0600	[thread overview]
Message-ID: <4D2B4376.101@freescale.com> (raw)
In-Reply-To: <1294677365.11031.13.camel@dplaptop.localdomain>

Dimitris Papastamos wrote:
> There's not much that can be done for error recovery at that point.
> Usually a failing snd_soc_read()/snd_soc_write() will complain wildly
> with errors from the underlying bus.  The only place that
> snd_soc_read()/snd_soc_write() are checked for errors is usually in
> _probe() functions.

I did a little digging, and I found something of concern, but I'm not sure if
there's a real problem.

On the surface, it appears that all current callers of snd_soc_update_bits() can
handle a negative return code.  In fact, a lot of existing code already assumes
that it does return error codes.

My concern is that there may be some higher-level function that is *not*
expecting a return value of 1 from snd_soc_update_bits().  For example, take
wm8904_put_deemph().  This function calls wm8904_set_deemph(), which ends with this:

	return snd_soc_update_bits(codec, WM8904_DAC_DIGITAL_1,
				   WM8904_DEEMPH_MASK, val);


This doesn't seem right to me.  Here, the .put function returns 0 or 1,
depending on whether or not the bits were actually updated.  Is that what's
intended?  I can't find any documentation that tells me what the return values
of snd_kcontrol_put_t are supposed to be.

-- 
Timur Tabi
Linux kernel developer at Freescale

  parent reply	other threads:[~2011-01-10 17:35 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-10 16:01 [PATCH] [v2] ASoC: cs4270: use the built-in register cache support Timur Tabi
2011-01-10 16:24 ` Dimitris Papastamos
2011-01-10 16:29 ` Dimitris Papastamos
2011-01-10 16:33   ` Timur Tabi
2011-01-10 16:35     ` Mark Brown
2011-01-10 16:36     ` Dimitris Papastamos
2011-01-10 16:54       ` Timur Tabi
2011-01-10 17:35       ` Timur Tabi [this message]
2011-01-10 18:23         ` Mark Brown
2011-01-10 18:33           ` Timur Tabi
2011-01-10 18:36             ` Mark Brown
2011-01-10 18:41               ` Timur Tabi
2011-01-10 18:54                 ` Mark Brown
2011-01-10 19:03                   ` Timur Tabi
2011-01-10 19:13                     ` Mark Brown

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=4D2B4376.101@freescale.com \
    --to=timur@freescale.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=dp@opensource.wolfsonmicro.com \
    --cc=lrg@slimlogic.co.uk \
    /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.