Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Liam Girdwood <lrg@ti.com>
To: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: "alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>
Subject: Re: [PATCH] ASoC: core - Add platform read and write.
Date: Mon, 4 Jul 2011 22:14:05 +0100	[thread overview]
Message-ID: <4E122D1D.4010109@ti.com> (raw)
In-Reply-To: <20110704194140.GC32624@opensource.wolfsonmicro.com>

On 04/07/11 20:41, Mark Brown wrote:
> On Mon, Jul 04, 2011 at 11:10:15AM +0100, Liam Girdwood wrote:
> 
>> +int snd_soc_platform_read(struct snd_soc_platform *platform,
>> +					unsigned int reg)
>> +{
>> +	unsigned int ret;
>> +
>> +	if (!platform->driver->read) {
>> +		dev_err(platform->dev, "platform has no read back\n");
>> +		return -1;
>> +	}
>> +
>> +	ret = platform->driver->read(platform, reg);
>> +	dev_dbg(platform->dev, "read %x => %x\n", reg, ret);
> 
> We should add tracepoints into these as well.

Ah, forgot to send that one with this one. It's on it's way now ;)

> 
>> +int snd_soc_platform_write(struct snd_soc_platform *platform,
>> +					 unsigned int reg, unsigned int val)
>> +{
>> +	if (!platform->driver->write) {
>> +		dev_err(platform->dev, "platform has no write back\n");
>> +		return -1;
> 
> Could return -EINVAL or something here - it's not like read where we're
> mixing with the in band data.

I was thinking that too, but consistency with the codec IO would mean return -1. 

However, I've no real preference. I happy to change to EINVAL.

Liam

  reply	other threads:[~2011-07-04 21:14 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-04 10:10 [PATCH] ASoC: core - Add platform read and write Liam Girdwood
2011-07-04 19:41 ` Mark Brown
2011-07-04 21:14   ` Liam Girdwood [this message]
2011-07-04 22:34     ` Mark Brown
2011-07-04 19:41 ` 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=4E122D1D.4010109@ti.com \
    --to=lrg@ti.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@opensource.wolfsonmicro.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox