2019-01-18 09:09:14

by Stefan Agner

[permalink] [raw]
Subject: [PATCH v2 1/5] ASoC: imx-sgtl5000: put of nodes if finding codec fails

Make sure to properly put the of node in case finding the codec
fails.

Fixes: 81e8e4926167 ("ASoC: fsl: add sgtl5000 clock support for imx-sgtl5000")
Signed-off-by: Stefan Agner <[email protected]>
Reviewed-by: Daniel Baluta <[email protected]>
Acked-by: Nicolin Chen <[email protected]>
---
Changes in v2:
- Reordered patches, make sure this is the first in the patchset

--
Stefan

sound/soc/fsl/imx-sgtl5000.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/sound/soc/fsl/imx-sgtl5000.c b/sound/soc/fsl/imx-sgtl5000.c
index c29200cf755a..594bde3b0ded 100644
--- a/sound/soc/fsl/imx-sgtl5000.c
+++ b/sound/soc/fsl/imx-sgtl5000.c
@@ -111,7 +111,8 @@ static int imx_sgtl5000_probe(struct platform_device *pdev)
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 -EPROBE_DEFER;
+ ret = -EPROBE_DEFER;
+ goto fail;
}

data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL);
--
2.20.1



2019-01-18 09:08:39

by Stefan Agner

[permalink] [raw]
Subject: [PATCH v2 2/5] ASoC: imx-sgtl5000: lower log level for potential probe deferral cases

Not finding the codec/SSI instance can be due to probe deferral.
Do not print error messages in those cases.

Signed-off-by: Stefan Agner <[email protected]>
Reviewed-by: Daniel Baluta <[email protected]>
Acked-by: Nicolin Chen <[email protected]>
---
sound/soc/fsl/imx-sgtl5000.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/soc/fsl/imx-sgtl5000.c b/sound/soc/fsl/imx-sgtl5000.c
index 594bde3b0ded..9790a2a8ec2d 100644
--- a/sound/soc/fsl/imx-sgtl5000.c
+++ b/sound/soc/fsl/imx-sgtl5000.c
@@ -104,13 +104,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");
+ dev_dbg(&pdev->dev, "failed to find SSI platform device\n");
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");
+ dev_dbg(&pdev->dev, "failed to find codec platform device\n");
ret = -EPROBE_DEFER;
goto fail;
}
--
2.20.1


2019-01-18 09:08:46

by Stefan Agner

[permalink] [raw]
Subject: [PATCH v2 4/5] ASoC: fsl_spdif: don't print EPROBE_DEFER as error

Probe deferral is to be expected during normal operation, so avoid
printing an error when it is encountered.

Signed-off-by: Stefan Agner <[email protected]>
Reviewed-by: Daniel Baluta <[email protected]>
Acked-by: Nicolin Chen <[email protected]>
---
sound/soc/fsl/fsl_spdif.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/fsl/fsl_spdif.c b/sound/soc/fsl/fsl_spdif.c
index 740b90df44bb..a26686e7281c 100644
--- a/sound/soc/fsl/fsl_spdif.c
+++ b/sound/soc/fsl/fsl_spdif.c
@@ -1320,7 +1320,7 @@ static int fsl_spdif_probe(struct platform_device *pdev)
}

ret = imx_pcm_dma_init(pdev, IMX_SPDIF_DMABUF_SIZE);
- if (ret)
+ if (ret && ret != -EPROBE_DEFER)
dev_err(&pdev->dev, "imx_pcm_dma_init failed: %d\n", ret);

return ret;
--
2.20.1


2019-01-18 09:09:26

by Stefan Agner

[permalink] [raw]
Subject: [PATCH v2 5/5] ASoC: imx-spdif: don't print EPROBE_DEFER as error

Probe deferral is to be expected during normal operation, so avoid
printing an error when it is encountered.

Removing the goto would not be strictly necessary. However, if
code gets added later, the cleanup in the EPROBE_DEFER case likely
would get missed.

Signed-off-by: Stefan Agner <[email protected]>
Reviewed-by: Daniel Baluta <[email protected]>
Acked-by: Nicolin Chen <[email protected]>
---
sound/soc/fsl/imx-spdif.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/sound/soc/fsl/imx-spdif.c b/sound/soc/fsl/imx-spdif.c
index fb896b2c9ba3..797d66e43d49 100644
--- a/sound/soc/fsl/imx-spdif.c
+++ b/sound/soc/fsl/imx-spdif.c
@@ -67,10 +67,8 @@ static int imx_spdif_audio_probe(struct platform_device *pdev)
goto end;

ret = devm_snd_soc_register_card(&pdev->dev, &data->card);
- if (ret) {
+ if (ret && ret != -EPROBE_DEFER)
dev_err(&pdev->dev, "snd_soc_register_card failed: %d\n", ret);
- goto end;
- }

end:
of_node_put(spdif_np);
--
2.20.1


2019-01-18 09:09:32

by Stefan Agner

[permalink] [raw]
Subject: [PATCH v2 3/5] ASoC: imx-sgtl5000: don't print EPROBE_DEFER as error

Probe deferral is to be expected during normal operation, so avoid
printing an error when it is encountered.

Signed-off-by: Stefan Agner <[email protected]>
Reviewed-by: Daniel Baluta <[email protected]>
Acked-by: Nicolin Chen <[email protected]>
---
sound/soc/fsl/imx-sgtl5000.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/sound/soc/fsl/imx-sgtl5000.c b/sound/soc/fsl/imx-sgtl5000.c
index 9790a2a8ec2d..b6cb80480b60 100644
--- a/sound/soc/fsl/imx-sgtl5000.c
+++ b/sound/soc/fsl/imx-sgtl5000.c
@@ -157,7 +157,9 @@ static int imx_sgtl5000_probe(struct platform_device *pdev)

ret = devm_snd_soc_register_card(&pdev->dev, &data->card);
if (ret) {
- dev_err(&pdev->dev, "snd_soc_register_card failed (%d)\n", ret);
+ if (ret != -EPROBE_DEFER)
+ dev_err(&pdev->dev, "snd_soc_register_card failed (%d)\n",
+ ret);
goto fail;
}

--
2.20.1


2019-01-18 10:43:45

by Fabio Estevam

[permalink] [raw]
Subject: Re: [alsa-devel] [PATCH v2 2/5] ASoC: imx-sgtl5000: lower log level for potential probe deferral cases

On Fri, Jan 18, 2019 at 7:07 AM Stefan Agner <[email protected]> wrote:
>
> Not finding the codec/SSI instance can be due to probe deferral.
> Do not print error messages in those cases.
>
> Signed-off-by: Stefan Agner <[email protected]>
> Reviewed-by: Daniel Baluta <[email protected]>
> Acked-by: Nicolin Chen <[email protected]>

Reviewed-by: Fabio Estevam <[email protected]>

2019-01-18 10:44:18

by Fabio Estevam

[permalink] [raw]
Subject: Re: [alsa-devel] [PATCH v2 3/5] ASoC: imx-sgtl5000: don't print EPROBE_DEFER as error

On Fri, Jan 18, 2019 at 7:07 AM Stefan Agner <[email protected]> wrote:
>
> Probe deferral is to be expected during normal operation, so avoid
> printing an error when it is encountered.
>
> Signed-off-by: Stefan Agner <[email protected]>
> Reviewed-by: Daniel Baluta <[email protected]>
> Acked-by: Nicolin Chen <[email protected]>

Reviewed-by: Fabio Estevam <[email protected]>

2019-01-18 10:44:42

by Fabio Estevam

[permalink] [raw]
Subject: Re: [alsa-devel] [PATCH v2 1/5] ASoC: imx-sgtl5000: put of nodes if finding codec fails

Hi Stefan,

On Fri, Jan 18, 2019 at 7:07 AM Stefan Agner <[email protected]> wrote:
>
> Make sure to properly put the of node in case finding the codec
> fails.
>
> Fixes: 81e8e4926167 ("ASoC: fsl: add sgtl5000io clock support for imx-sgtl5000")
> Signed-off-by: Stefan Agner <[email protected]>
> Reviewed-by: Daniel Baluta <[email protected]>
> Acked-by: Nicolin Chen <[email protected]>

Thanks for the re-ordering:

Reviewed-by: Fabio Estevam <[email protected]>

2019-01-18 10:45:15

by Fabio Estevam

[permalink] [raw]
Subject: Re: [alsa-devel] [PATCH v2 5/5] ASoC: imx-spdif: don't print EPROBE_DEFER as error

On Fri, Jan 18, 2019 at 7:07 AM Stefan Agner <[email protected]> wrote:
>
> Probe deferral is to be expected during normal operation, so avoid
> printing an error when it is encountered.
>
> Removing the goto would not be strictly necessary. However, if
> code gets added later, the cleanup in the EPROBE_DEFER case likely
> would get missed.
>
> Signed-off-by: Stefan Agner <[email protected]>
> Reviewed-by: Daniel Baluta <[email protected]>
> Acked-by: Nicolin Chen <[email protected]>

Reviewed-by: Fabio Estevam <[email protected]>

2019-01-18 10:45:53

by Fabio Estevam

[permalink] [raw]
Subject: Re: [alsa-devel] [PATCH v2 4/5] ASoC: fsl_spdif: don't print EPROBE_DEFER as error

On Fri, Jan 18, 2019 at 7:07 AM Stefan Agner <[email protected]> wrote:
>
> Probe deferral is to be expected during normal operation, so avoid
> printing an error when it is encountered.
>
> Signed-off-by: Stefan Agner <[email protected]>
> Reviewed-by: Daniel Baluta <[email protected]>
> Acked-by: Nicolin Chen <[email protected]>

Reviewed-by: Fabio Estevam <[email protected]>