From: Ladislav Michl <ladis@linux-mips.org>
To: alsa-devel@alsa-project.org
Cc: Alexandre Belloni <alexandre.belloni@free-electrons.com>,
Nicolas Ferre <nicolas.ferre@microchip.com>,
Peter Rosin <peda@axentia.se>
Subject: [PATCH] ASoC: atmel: Remove check for node pointer
Date: Mon, 22 Jan 2018 15:15:57 +0100 [thread overview]
Message-ID: <20180122141557.GA29226@lenoch> (raw)
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
next reply other threads:[~2018-01-22 14:16 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-22 14:15 Ladislav Michl [this message]
2018-01-22 14:20 ` [PATCH] ASoC: atmel: Remove check for node pointer Peter Rosin
2018-01-27 21:53 ` Alexandre Belloni
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180122141557.GA29226@lenoch \
--to=ladis@linux-mips.org \
--cc=alexandre.belloni@free-electrons.com \
--cc=alsa-devel@alsa-project.org \
--cc=nicolas.ferre@microchip.com \
--cc=peda@axentia.se \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).