All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnaud Patard (Rtp) <arnaud.patard@rtp-net.org>
To: alsa-devel@alsa-project.org
Cc: Mark Brown <broonie@kernel.org>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Shawn Guo <shawn.guo@linaro.org>
Subject: [RFC] [patch 1/1] imx-sgtl5000: return E_PROBE_DEFER if ssi/codec not found
Date: Thu, 20 Jun 2013 23:20:49 +0200	[thread overview]
Message-ID: <20130620212100.075892857@rtp-net.org> (raw)

[-- Attachment #1: imx-sgtl5000-probe-defer.patch --]
[-- Type: text/plain, Size: 1068 bytes --]

If the ssi or codec drivers are not loaded (for instance, because spi or i2c
bus drivers are not loaded), returning -EINVAL will for people to unload and
then reload the module to get sound working. Returning E_PROBE_DEFER will
mitigate this.

Signed-off-by: Arnaud Patard <arnaud.patard@rtp-net.org>

Index: linux/sound/soc/fsl/imx-sgtl5000.c
===================================================================
--- linux.orig/sound/soc/fsl/imx-sgtl5000.c	2013-05-16 09:33:01.000000000 +0200
+++ linux/sound/soc/fsl/imx-sgtl5000.c	2013-05-16 09:35:14.000000000 +0200
@@ -113,13 +113,13 @@ static int imx_sgtl5000_probe(struct pla
 	ssi_pdev = of_find_device_by_node(ssi_np);
 	if (!ssi_pdev) {
 		dev_err(&pdev->dev, "failed to find SSI platform device\n");
-		ret = -EINVAL;
+		ret = -EPROBE_DEFER;
 		goto fail;
 	}
 	codec_dev = of_find_i2c_device_by_node(codec_np);
 	if (!codec_dev) {
 		dev_err(&pdev->dev, "failed to find codec platform device\n");
-		return -EINVAL;
+		return -EPROBE_DEFER;
 	}
 
 	data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL);

             reply	other threads:[~2013-06-22 20:15 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-20 21:20 Arnaud Patard [this message]
2013-06-23 21:48 ` [RFC] [patch 1/1] imx-sgtl5000: return E_PROBE_DEFER if ssi/codec not found Fabio Estevam
2013-06-24  7:33   ` Arnaud Patard
2013-06-24 23:26     ` Fabio Estevam
2013-07-04 14:59 ` 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=20130620212100.075892857@rtp-net.org \
    --to=arnaud.patard@rtp-net.org \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=shawn.guo@linaro.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 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.