* [PATCH] ASoC: atmel: Remove check for node pointer
@ 2018-01-22 14:15 Ladislav Michl
2018-01-22 14:20 ` Peter Rosin
2018-01-27 21:53 ` Alexandre Belloni
0 siblings, 2 replies; 3+ messages in thread
From: Ladislav Michl @ 2018-01-22 14:15 UTC (permalink / raw)
To: alsa-devel; +Cc: Alexandre Belloni, Nicolas Ferre, Peter Rosin
Probe function is called only after DT compatible is matched,
thus node pointer cannot be NULL.
Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
---
Note: this patch replaces previously sent
"ASoC: sam9x5_wm8731: Return -ENODEV when probe does not find OF node" and
"ASoC: atmel_wm8904: Return -ENODEV when probe does not find OF node"
while taking Alexandre Belloni's advice into account and extending it for
the rest of Atmel's drivers.
sound/soc/atmel/atmel_wm8904.c | 5 -----
sound/soc/atmel/sam9g20_wm8731.c | 4 ----
sound/soc/atmel/sam9x5_wm8731.c | 5 -----
sound/soc/atmel/tse850-pcm5142.c | 5 -----
4 files changed, 19 deletions(-)
diff --git a/sound/soc/atmel/atmel_wm8904.c b/sound/soc/atmel/atmel_wm8904.c
index fbc10f61eb55..0619a9961e0c 100644
--- a/sound/soc/atmel/atmel_wm8904.c
+++ b/sound/soc/atmel/atmel_wm8904.c
@@ -85,11 +85,6 @@ static int atmel_asoc_wm8904_dt_init(struct platform_device *pdev)
struct snd_soc_dai_link *dailink = &atmel_asoc_wm8904_dailink;
int ret;
- if (!np) {
- dev_err(&pdev->dev, "only device tree supported\n");
- return -EINVAL;
- }
-
ret = snd_soc_of_parse_card_name(card, "atmel,model");
if (ret) {
dev_err(&pdev->dev, "failed to parse card name\n");
diff --git a/sound/soc/atmel/sam9g20_wm8731.c b/sound/soc/atmel/sam9g20_wm8731.c
index 98f93e79c654..a53f3ee82d30 100644
--- a/sound/soc/atmel/sam9g20_wm8731.c
+++ b/sound/soc/atmel/sam9g20_wm8731.c
@@ -163,10 +163,6 @@ static int at91sam9g20ek_audio_probe(struct platform_device *pdev)
struct snd_soc_card *card = &snd_soc_at91sam9g20ek;
int ret;
- if (!np) {
- return -ENODEV;
- }
-
ret = atmel_ssc_set_audio(0);
if (ret) {
dev_err(&pdev->dev, "ssc channel is not valid\n");
diff --git a/sound/soc/atmel/sam9x5_wm8731.c b/sound/soc/atmel/sam9x5_wm8731.c
index 920f72565ff2..b177524f5926 100644
--- a/sound/soc/atmel/sam9x5_wm8731.c
+++ b/sound/soc/atmel/sam9x5_wm8731.c
@@ -83,11 +83,6 @@ static int sam9x5_wm8731_driver_probe(struct platform_device *pdev)
struct sam9x5_drvdata *priv;
int ret;
- if (!np) {
- dev_err(&pdev->dev, "No device node supplied\n");
- return -EINVAL;
- }
-
card = devm_kzalloc(&pdev->dev, sizeof(*card), GFP_KERNEL);
priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
dai = devm_kzalloc(&pdev->dev, sizeof(*dai), GFP_KERNEL);
diff --git a/sound/soc/atmel/tse850-pcm5142.c b/sound/soc/atmel/tse850-pcm5142.c
index 3a1393283156..73b327e781ab 100644
--- a/sound/soc/atmel/tse850-pcm5142.c
+++ b/sound/soc/atmel/tse850-pcm5142.c
@@ -327,11 +327,6 @@ static int tse850_dt_init(struct platform_device *pdev)
struct device_node *codec_np, *cpu_np;
struct snd_soc_dai_link *dailink = &tse850_dailink;
- if (!np) {
- dev_err(&pdev->dev, "only device tree supported\n");
- return -EINVAL;
- }
-
cpu_np = of_parse_phandle(np, "axentia,cpu-dai", 0);
if (!cpu_np) {
dev_err(&pdev->dev, "failed to get cpu dai\n");
--
2.15.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] ASoC: atmel: Remove check for node pointer
2018-01-22 14:15 [PATCH] ASoC: atmel: Remove check for node pointer Ladislav Michl
@ 2018-01-22 14:20 ` Peter Rosin
2018-01-27 21:53 ` Alexandre Belloni
1 sibling, 0 replies; 3+ messages in thread
From: Peter Rosin @ 2018-01-22 14:20 UTC (permalink / raw)
To: Ladislav Michl, alsa-devel; +Cc: Alexandre Belloni, Nicolas Ferre
On 2018-01-22 15:15, Ladislav Michl wrote:
> Probe function is called only after DT compatible is matched,
> thus node pointer cannot be NULL.
>
> Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
Sure,
Acked-by: Peter Rosin <peda@axentia.se>
Cheers,
peda
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] ASoC: atmel: Remove check for node pointer
2018-01-22 14:15 [PATCH] ASoC: atmel: Remove check for node pointer Ladislav Michl
2018-01-22 14:20 ` Peter Rosin
@ 2018-01-27 21:53 ` Alexandre Belloni
1 sibling, 0 replies; 3+ messages in thread
From: Alexandre Belloni @ 2018-01-27 21:53 UTC (permalink / raw)
To: Ladislav Michl; +Cc: alsa-devel, Nicolas Ferre, Peter Rosin
On 22/01/2018 at 15:15:57 +0100, Ladislav Michl wrote:
> Probe function is called only after DT compatible is matched,
> thus node pointer cannot be NULL.
>
> Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
Acked-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
> ---
> Note: this patch replaces previously sent
> "ASoC: sam9x5_wm8731: Return -ENODEV when probe does not find OF node" and
> "ASoC: atmel_wm8904: Return -ENODEV when probe does not find OF node"
> while taking Alexandre Belloni's advice into account and extending it for
> the rest of Atmel's drivers.
>
> sound/soc/atmel/atmel_wm8904.c | 5 -----
> sound/soc/atmel/sam9g20_wm8731.c | 4 ----
> sound/soc/atmel/sam9x5_wm8731.c | 5 -----
> sound/soc/atmel/tse850-pcm5142.c | 5 -----
> 4 files changed, 19 deletions(-)
>
> diff --git a/sound/soc/atmel/atmel_wm8904.c b/sound/soc/atmel/atmel_wm8904.c
> index fbc10f61eb55..0619a9961e0c 100644
> --- a/sound/soc/atmel/atmel_wm8904.c
> +++ b/sound/soc/atmel/atmel_wm8904.c
> @@ -85,11 +85,6 @@ static int atmel_asoc_wm8904_dt_init(struct platform_device *pdev)
> struct snd_soc_dai_link *dailink = &atmel_asoc_wm8904_dailink;
> int ret;
>
> - if (!np) {
> - dev_err(&pdev->dev, "only device tree supported\n");
> - return -EINVAL;
> - }
> -
> ret = snd_soc_of_parse_card_name(card, "atmel,model");
> if (ret) {
> dev_err(&pdev->dev, "failed to parse card name\n");
> diff --git a/sound/soc/atmel/sam9g20_wm8731.c b/sound/soc/atmel/sam9g20_wm8731.c
> index 98f93e79c654..a53f3ee82d30 100644
> --- a/sound/soc/atmel/sam9g20_wm8731.c
> +++ b/sound/soc/atmel/sam9g20_wm8731.c
> @@ -163,10 +163,6 @@ static int at91sam9g20ek_audio_probe(struct platform_device *pdev)
> struct snd_soc_card *card = &snd_soc_at91sam9g20ek;
> int ret;
>
> - if (!np) {
> - return -ENODEV;
> - }
> -
> ret = atmel_ssc_set_audio(0);
> if (ret) {
> dev_err(&pdev->dev, "ssc channel is not valid\n");
> diff --git a/sound/soc/atmel/sam9x5_wm8731.c b/sound/soc/atmel/sam9x5_wm8731.c
> index 920f72565ff2..b177524f5926 100644
> --- a/sound/soc/atmel/sam9x5_wm8731.c
> +++ b/sound/soc/atmel/sam9x5_wm8731.c
> @@ -83,11 +83,6 @@ static int sam9x5_wm8731_driver_probe(struct platform_device *pdev)
> struct sam9x5_drvdata *priv;
> int ret;
>
> - if (!np) {
> - dev_err(&pdev->dev, "No device node supplied\n");
> - return -EINVAL;
> - }
> -
> card = devm_kzalloc(&pdev->dev, sizeof(*card), GFP_KERNEL);
> priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
> dai = devm_kzalloc(&pdev->dev, sizeof(*dai), GFP_KERNEL);
> diff --git a/sound/soc/atmel/tse850-pcm5142.c b/sound/soc/atmel/tse850-pcm5142.c
> index 3a1393283156..73b327e781ab 100644
> --- a/sound/soc/atmel/tse850-pcm5142.c
> +++ b/sound/soc/atmel/tse850-pcm5142.c
> @@ -327,11 +327,6 @@ static int tse850_dt_init(struct platform_device *pdev)
> struct device_node *codec_np, *cpu_np;
> struct snd_soc_dai_link *dailink = &tse850_dailink;
>
> - if (!np) {
> - dev_err(&pdev->dev, "only device tree supported\n");
> - return -EINVAL;
> - }
> -
> cpu_np = of_parse_phandle(np, "axentia,cpu-dai", 0);
> if (!cpu_np) {
> dev_err(&pdev->dev, "failed to get cpu dai\n");
> --
> 2.15.1
>
--
Alexandre Belloni, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-01-27 21:53 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-22 14:15 [PATCH] ASoC: atmel: Remove check for node pointer Ladislav Michl
2018-01-22 14:20 ` Peter Rosin
2018-01-27 21:53 ` Alexandre Belloni
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).