public inbox for linux-tegra@vger.kernel.org
 help / color / mirror / Atom feed
From: Mark Brown <broonie-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>
To: Mike Rapoport <mike-UTxiZqZC01RS1MOuV/RT9w@public.gmane.org>
Cc: Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>,
	alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw@public.gmane.org,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH] ASoC: tegra: TrimSlice machine support
Date: Mon, 18 Apr 2011 15:44:27 +0100	[thread overview]
Message-ID: <20110418144427.GD1765@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <1303043988-21933-1-git-send-email-mike-UTxiZqZC01RS1MOuV/RT9w@public.gmane.org>

On Sun, Apr 17, 2011 at 03:39:48PM +0300, Mike Rapoport wrote:

> +	if (mclk_change) {
> +		err = snd_soc_dai_set_sysclk(codec_dai, 0, mclk,
> +					     SND_SOC_CLOCK_IN);
> +		if (err < 0) {
> +			dev_err(card->dev, "codec_dai clock not set\n");
> +			return err;
> +		}
> +	}

Fix the CODEC driver to cope gracefully with noop changes if this is a
problem, no sense in all callers replicating this code.

> +static int trimslice_asoc_init(struct snd_soc_pcm_runtime *rtd)
> +{
> +	struct snd_soc_codec *codec = rtd->codec;
> +	struct snd_soc_dapm_context *dapm = &codec->dapm;
> +
> +	snd_soc_dapm_new_controls(dapm, trimslice_dapm_widgets,
> +					ARRAY_SIZE(trimslice_dapm_widgets));
> +
> +	snd_soc_dapm_add_routes(dapm, trimslice_audio_map,
> +				ARRAY_SIZE(trimslice_audio_map));
> +
> +	snd_soc_dapm_sync(dapm);

Please switch to using the data based specification of widgets and
routes in -next.  This should completely remove the need for this code.

> +static __devinit int tegra_snd_trimslice_probe(struct platform_device *pdev)
> +{
> +	struct snd_soc_card *card = &snd_soc_trimslice;
> +	struct tegra_trimslice *trimslice;
> +	int ret;
> +
> +	if (!machine_is_trimslice()) {
> +		dev_err(&pdev->dev, "Not running on Trimslice!\n");
> +		return -ENODEV;
> +	}

This isn't needed since you're registering based on a platform device -
whatever registers the platform device should check this.

> +err_clear_drvdata:
> +	snd_soc_card_set_drvdata(card, NULL);
> +	platform_set_drvdata(pdev, NULL);
> +	card->dev = NULL;

No need for any of these, anything relying on them outside of the device
being registered is buggy anyway.

> +	snd_soc_card_set_drvdata(card, NULL);
> +	platform_set_drvdata(pdev, NULL);
> +	card->dev = NULL;

Similarly here.

      parent reply	other threads:[~2011-04-18 14:44 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-17 12:39 [PATCH] ASoC: tegra: TrimSlice machine support Mike Rapoport
     [not found] ` <1303043988-21933-1-git-send-email-mike-UTxiZqZC01RS1MOuV/RT9w@public.gmane.org>
2011-04-17 15:45   ` Stephen Warren
     [not found]     ` <74CDBE0F657A3D45AFBB94109FB122FF04973BB176-C7FfzLzN0UxDw2glCA4ptUEOCMrvLtNR@public.gmane.org>
2011-04-18 14:40       ` Mark Brown
     [not found]         ` <20110418144050.GC1765-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>
2011-04-18 16:16           ` Stephen Warren
2011-04-21  6:53           ` Mike Rapoport
2011-04-18 14:44   ` Mark Brown [this message]

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=20110418144427.GD1765@opensource.wolfsonmicro.com \
    --to=broonie-yzvpicuk2aatku/dhu1wvuem+bqzidxxqq4iyu8u01e@public.gmane.org \
    --cc=alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw@public.gmane.org \
    --cc=linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=mike-UTxiZqZC01RS1MOuV/RT9w@public.gmane.org \
    --cc=swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org \
    /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