alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: "Koul, Vinod" <vinod.koul@intel.com>
Cc: tiwai@suse.de, alsa-devel@alsa-project.org, alan@linux.intel.com,
	Harsha Priya <priya.harsha@intel.com>,
	lrg@slimlogic.co.uk
Subject: Re: [PATCH 2/4] ASoC sst v2: Add mid platform driver
Date: Thu, 6 Jan 2011 14:12:15 +0000	[thread overview]
Message-ID: <20110106141215.GC6328@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <1294152392-8914-1-git-send-email-vinod.koul@intel.com>

On Tue, Jan 04, 2011 at 08:16:32PM +0530, Koul, Vinod wrote:

> This patch adds the platform driver for mid asoc drivers
> This platfrom driver sends commands to sst dsp engine driver for the dai operations.
> For this purpose it depends on intel_sst driver which is currently in staging tree

Wrap lines within changelogs to something less than 80 columns.

> +
> +	spin_lock(&stream->status_lock);
> +	if (stream->stream_status != SST_PLATFORM_RUNNING) {
> +		spin_unlock(&stream->status_lock);
> +		return;
> +	}
> +	spin_unlock(&stream->status_lock);
> +	snd_pcm_period_elapsed(substream);
> +	return;
> +}

This return statement is pointless.  The above code would be much
clearer if you just said something like:

	spin_lock()
	set flag if running
	spin_unlock()

	period_elapsed()

> +	ret_val = sst_platform_init_stream(substream);
> +	if (ret_val)
> +		return ret_val;
> +	substream->runtime->hw.info = SNDRV_PCM_INFO_BLOCK_TRANSFER;
> +	return ret_val;

As with much of the driver the use of blank lines between blocks seems
intermittent.

> +	spin_lock(&stream->status_lock);
> +	if (stream->stream_status == SST_PLATFORM_INIT) {
> +		spin_unlock(&stream->status_lock);
> +		return 0;
> +	}
> +	spin_unlock(&stream->status_lock);

A helper function to do the lock/check would probably make life a lot
easier if you're going to do this a lot so callers could do:

	if (sst_stream_state(stream, SST_PLATFORM_INIT)
		return 0;

or whatever.

> +	return stream->stream_info.buffer_ptr;

I thought you were going to clarify that this isn't exactly a pointer?

> +MODULE_LICENSE("GPL v2");
> +MODULE_ALIAS("platfrom: sst-platform");

Typos here - extra space and platform is spelt wrongly.

  reply	other threads:[~2011-01-06 14:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-04 14:46 [PATCH 2/4] ASoC sst v2: Add mid platform driver Koul, Vinod
2011-01-06 14:12 ` Mark Brown [this message]
2011-01-11  9:03   ` Harsha, Priya

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=20110106141215.GC6328@opensource.wolfsonmicro.com \
    --to=broonie@opensource.wolfsonmicro.com \
    --cc=alan@linux.intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=lrg@slimlogic.co.uk \
    --cc=priya.harsha@intel.com \
    --cc=tiwai@suse.de \
    --cc=vinod.koul@intel.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;
as well as URLs for NNTP newsgroup(s).