All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ben Dooks <ben.dooks@codethink.co.uk>
To: Mark Brown <broonie@kernel.org>
Cc: linux-kernel@lists.codethink.co.uk, alsa-devel@alsa-project.org,
	lgirdwood@gmail.com, kuninori.morimoto.gx@renesas.com
Subject: Re: [PATCH] ak4642: show error if register write fails
Date: Tue, 11 Mar 2014 11:18:30 +0000	[thread overview]
Message-ID: <531EF106.3020809@codethink.co.uk> (raw)
In-Reply-To: <20140310234038.GE28112@sirena.org.uk>

On 10/03/14 23:40, Mark Brown wrote:
> On Mon, Mar 10, 2014 at 06:15:55PM +0000, Ben Dooks wrote:
>
>> +/* wrapper functions to show any errors to updating register values */
>> +
>> +static inline int ak4642_update_bits(struct snd_soc_codec *codec,
>> +				     unsigned int reg,
>> +				     unsigned int mask, unsigned int val)
>> +{
>> +	int ret = snd_soc_update_bits(codec, reg, mask, val);
>> +
>> +	if (ret < 0) {
>> +		pr_info("%s: error %d writing %04x (%08x, mask %08x)\n",
>> +			codec->name, ret, reg, mask, val);
>
> Two things here.  One is that this should be a dev_err() and the other
> is that if this is worth doing shouldn't it just be in the core - I see
> nothing driver specific here?

Sorry, didn't see a device in "struct snd_soc_codec *codec" so I went
for a printk (although it was pr_info instead of pr_err).

I did think if this should be something in the snd_soc_update_bits
and snd_soc_write() calls after sending the patch.

If you think that changing the two snd_soc calls to print errors
when anything bad happens then that would also be a good idea then
I can send a patch for that.

-- 
Ben Dooks				http://www.codethink.co.uk/
Senior Engineer				Codethink - Providing Genius

  reply	other threads:[~2014-03-11 11:19 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-10 18:15 [PATCH] ak4642: show error if register write fails Ben Dooks
2014-03-10 23:40 ` Mark Brown
2014-03-11 11:18   ` Ben Dooks [this message]
2014-03-11 11:21     ` Mark Brown
2014-03-11 13:59       ` Lars-Peter Clausen
2014-03-11 14:17         ` Ben Dooks
2014-03-11 14:20           ` Lars-Peter Clausen
2014-03-11 14:21         ` Mark Brown
2014-03-11 15:15           ` Takashi Iwai
2014-03-11 18:44             ` 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=531EF106.3020809@codethink.co.uk \
    --to=ben.dooks@codethink.co.uk \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=kuninori.morimoto.gx@renesas.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@lists.codethink.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.