[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20181205195050.4759-33-robh@kernel.org>
Date: Wed, 5 Dec 2018 13:50:49 -0600
From: Rob Herring <robh@...nel.org>
To: devicetree@...r.kernel.org, linux-kernel@...r.kernel.org
Cc: Timur Tabi <timur@...nel.org>,
Nicolin Chen <nicoleotsuka@...il.com>,
Xiubo Li <Xiubo.Lee@...il.com>,
Fabio Estevam <fabio.estevam@....com>,
Liam Girdwood <lgirdwood@...il.com>,
Mark Brown <broonie@...nel.org>,
Jaroslav Kysela <perex@...ex.cz>,
Takashi Iwai <tiwai@...e.com>, alsa-devel@...a-project.org,
linuxppc-dev@...ts.ozlabs.org
Subject: [PATCH] ASoC: Use of_node_name_eq for node name comparisons
Convert string compares of DT node names to use of_node_name_eq helper
instead. This removes direct access to the node name pointer.
For the FSL ASoC card, the full node names appear to be "ssi", "esai",
and "sai", so there's not any reason to use strstr and of_node_name_eq
can be used instead.
Cc: Timur Tabi <timur@...nel.org>
Cc: Nicolin Chen <nicoleotsuka@...il.com>
Cc: Xiubo Li <Xiubo.Lee@...il.com>
Cc: Fabio Estevam <fabio.estevam@....com>
Cc: Liam Girdwood <lgirdwood@...il.com>
Cc: Mark Brown <broonie@...nel.org>
Cc: Jaroslav Kysela <perex@...ex.cz>
Cc: Takashi Iwai <tiwai@...e.com>
Cc: alsa-devel@...a-project.org
Cc: linuxppc-dev@...ts.ozlabs.org
Signed-off-by: Rob Herring <robh@...nel.org>
---
sound/soc/fsl/fsl-asoc-card.c | 6 +++---
sound/soc/generic/simple-scu-card.c | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/sound/soc/fsl/fsl-asoc-card.c b/sound/soc/fsl/fsl-asoc-card.c
index 44433b20435c..81f2fe2c6d23 100644
--- a/sound/soc/fsl/fsl-asoc-card.c
+++ b/sound/soc/fsl/fsl-asoc-card.c
@@ -571,17 +571,17 @@ static int fsl_asoc_card_probe(struct platform_device *pdev)
}
/* Common settings for corresponding Freescale CPU DAI driver */
- if (strstr(cpu_np->name, "ssi")) {
+ if (of_node_name_eq(cpu_np, "ssi")) {
/* Only SSI needs to configure AUDMUX */
ret = fsl_asoc_card_audmux_init(np, priv);
if (ret) {
dev_err(&pdev->dev, "failed to init audmux\n");
goto asrc_fail;
}
- } else if (strstr(cpu_np->name, "esai")) {
+ } else if (of_node_name_eq(cpu_np, "esai")) {
priv->cpu_priv.sysclk_id[1] = ESAI_HCKT_EXTAL;
priv->cpu_priv.sysclk_id[0] = ESAI_HCKR_EXTAL;
- } else if (strstr(cpu_np->name, "sai")) {
+ } else if (of_node_name_eq(cpu_np, "sai")) {
priv->cpu_priv.sysclk_id[1] = FSL_SAI_CLK_MAST1;
priv->cpu_priv.sysclk_id[0] = FSL_SAI_CLK_MAST1;
}
diff --git a/sound/soc/generic/simple-scu-card.c b/sound/soc/generic/simple-scu-card.c
index 85b46f0eae0f..e9a1acffcf5b 100644
--- a/sound/soc/generic/simple-scu-card.c
+++ b/sound/soc/generic/simple-scu-card.c
@@ -216,7 +216,7 @@ static int asoc_simple_card_parse_of(struct simple_card_data *priv)
i = 0;
for_each_child_of_node(node, np) {
is_fe = false;
- if (strcmp(np->name, PREFIX "cpu") == 0)
+ if (of_node_name_eq(np, PREFIX "cpu"))
is_fe = true;
ret = asoc_simple_card_dai_link_of(np, priv, daifmt, i, is_fe);
--
2.19.1
Powered by blists - more mailing lists