Commit 1d52a74e authored by Rob Herring's avatar Rob Herring Committed by Mark Brown

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@kernel.org>
Cc: Nicolin Chen <nicoleotsuka@gmail.com>
Cc: Xiubo Li <Xiubo.Lee@gmail.com>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Liam Girdwood <lgirdwood@gmail.com>
Cc: Mark Brown <broonie@kernel.org>
Cc: Jaroslav Kysela <perex@perex.cz>
Cc: Takashi Iwai <tiwai@suse.com>
Cc: alsa-devel@alsa-project.org
Cc: linuxppc-dev@lists.ozlabs.org
Signed-off-by: default avatarRob Herring <robh@kernel.org>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 23aa128b
...@@ -571,17 +571,17 @@ static int fsl_asoc_card_probe(struct platform_device *pdev) ...@@ -571,17 +571,17 @@ static int fsl_asoc_card_probe(struct platform_device *pdev)
} }
/* Common settings for corresponding Freescale CPU DAI driver */ /* 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 */ /* Only SSI needs to configure AUDMUX */
ret = fsl_asoc_card_audmux_init(np, priv); ret = fsl_asoc_card_audmux_init(np, priv);
if (ret) { if (ret) {
dev_err(&pdev->dev, "failed to init audmux\n"); dev_err(&pdev->dev, "failed to init audmux\n");
goto asrc_fail; 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[1] = ESAI_HCKT_EXTAL;
priv->cpu_priv.sysclk_id[0] = ESAI_HCKR_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[1] = FSL_SAI_CLK_MAST1;
priv->cpu_priv.sysclk_id[0] = FSL_SAI_CLK_MAST1; priv->cpu_priv.sysclk_id[0] = FSL_SAI_CLK_MAST1;
} }
......
...@@ -223,7 +223,7 @@ static int asoc_simple_card_parse_of(struct simple_card_data *priv) ...@@ -223,7 +223,7 @@ static int asoc_simple_card_parse_of(struct simple_card_data *priv)
i = 0; i = 0;
for_each_child_of_node(node, np) { for_each_child_of_node(node, np) {
is_fe = false; is_fe = false;
if (strcmp(np->name, PREFIX "cpu") == 0) if (of_node_name_eq(np, PREFIX "cpu"))
is_fe = true; is_fe = true;
ret = asoc_simple_card_dai_link_of(np, priv, daifmt, i, is_fe); ret = asoc_simple_card_dai_link_of(np, priv, daifmt, i, is_fe);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment