ASoC: 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.

Signed-off-by: Arnaud Patard <arnaud.patard@rtp-net.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
This commit is contained in:
Arnaud Patard (Rtp) 2013-06-20 23:20:49 +02:00 коммит произвёл Mark Brown
Родитель 84bbc4aa2d
Коммит 28e5ca73ef
1 изменённых файлов: 2 добавлений и 2 удалений

Просмотреть файл

@ -113,13 +113,13 @@ static int imx_sgtl5000_probe(struct platform_device *pdev)
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);