Skip to contentSkip to conversation

imx-sgtl5000: return E_PROBE_DEFER if ssi/codec not found

RFC PATCH Applied Arnaud Patard (Rtp) 3 participants 5 messages Jun 22, 2013 – Jul 4, 2013

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 imx-sgtl5000: return E_PROBE_DEFER if ssi/codec not found

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.

sound/soc/fsl/imx-sgtl5000.c +2 -2
Index: linux/sound/soc/fsl/imx-sgtl5000.c
===================================================================
@@ -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);
reviewer
#1 lore raw
Quoted 6 lines · Arnaud Patard

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.

Which board you are using that fails to probe sgtl5000?

I have fixed this problem for some boards recently.

#2 lore raw
Quoted 11 lines · Fabio Estevam
Quoted 6 lines · Arnaud Patard

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.

Which board you are using that fails to probe sgtl5000?

It was on imx53-qsb, nearly everything in module and boot with DT.

Quoted 1 line

I have fixed this problem for some boards recently.

I'm curious to know how to fix that with modules on a per board basis. Please, explain.

Thanks,
Arnaud

reviewer
#3 lore raw
Quoted 2 lines · Arnaud Patard

I'm curious to know how to fix that with modules on a per board basis. Please, explain.

Ok, looks like a different problem than the one I handled before.

maintainer Applied
#4 lore raw
In reply to Arnaud Patard (Rtp)
Quoted 4 lines · Arnaud Patard

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.

Applied, thanks.