ASoC: atmel: Remove check for node pointer
Subsystems (5)
PATCH 1/1 ASoC: atmel: Remove check for node pointer
Probe function is called only after DT compatible is matched, thus node pointer cannot be NULL.
---
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(-)
sound/soc/atmel/atmel_wm8904.c +0 -5
@@ -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" );
sound/soc/atmel/sam9g20_wm8731.c +0 -4
@@ -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" );
sound/soc/atmel/sam9x5_wm8731.c +0 -5
@@ -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 );
sound/soc/atmel/tse850-pcm5142.c +0 -5
@@ -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" );
Signature · 1 line
2.15.1
Quoted 4 lines · Ladislav Michl
Probe function is called only after DT compatible is matched, thus node pointer cannot be NULL.
Signed-off-by Ladislav Michl <[email protected]>
Sure,
Cheers,
peda
Quoted 4 lines · Ladislav Michl
Probe function is called only after DT compatible is matched, thus node pointer cannot be NULL.
Signed-off-by Ladislav Michl <[email protected]>
Quoted 79 lines
---
Note: this patch replaces previously sent
"ASoC:sam9x5_wm8731: Return-ENODEVwhen probe does not find OF node" and "ASoC:atmel_wm8904: Return-ENODEVwhen 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(-)sound/soc/atmel/atmel_wm8904.c +0
-5@@ -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" );sound/soc/atmel/sam9g20_wm8731.c +0
-4@@ -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" );sound/soc/atmel/sam9x5_wm8731.c +0
-5@@ -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 );sound/soc/atmel/tse850-pcm5142.c +0
-5@@ -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" );Signature · 1 line
2.15.1
Signature · 3 lines
Alexandre Belloni, Free Electrons Embedded Linux and Kernel engineering http://free-electrons.com