From patchwork Wed Dec 5 19:50:49 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Rob Herring (Arm)" X-Patchwork-Id: 10714801 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6819213BB for ; Wed, 5 Dec 2018 19:51:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 55CAF2E382 for ; Wed, 5 Dec 2018 19:51:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 46A462E394; Wed, 5 Dec 2018 19:51:48 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7DDD12E382 for ; Wed, 5 Dec 2018 19:51:47 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 5C710267C4A; Wed, 5 Dec 2018 20:51:35 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 1D8C8267C4A; Wed, 5 Dec 2018 20:51:33 +0100 (CET) Received: from mail-ot1-f66.google.com (mail-ot1-f66.google.com [209.85.210.66]) by alsa0.perex.cz (Postfix) with ESMTP id AD0C8267BA5 for ; Wed, 5 Dec 2018 20:51:29 +0100 (CET) Received: by mail-ot1-f66.google.com with SMTP id n8so15943044otl.6 for ; Wed, 05 Dec 2018 11:51:29 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=ThQ7RT0snc2eXhKBllFE/yVobWH1ZvOxkwfOj6s8tE8=; b=OqbwRAOIk8kmxZBl9tosZ2GOI4dJl83IslfK+myhMXhtfsaBsI2ZLbiE11KkFAzNXF BsKya+wPo6Rx0xeG1eVWDrM5tuNLOobWooEuF4AW8np67ugUl077WVd6sLjvpkVGvTU0 qr6L6dpQnQndvBmKOWurMdV//vWVbm8N3FaEWJUlXOi1bgi9zx2IM1e9SXbfbI8fufUX 6tItUNWzZNITD8exUx99ntiViGqPz4Nl9O7nAkDN7soQoLeQXiFuhElys1Zas8dFReHN DjFcDuW5tATAVrEuXMaNPQ1fJNdPyPtCQuwhf56KjrsnaB0C5igfCeBs7WvGBm6qntFJ kchg== X-Gm-Message-State: AA+aEWaAC9Ee+j5OHMW2oVxjcjxd15q9vpIV9zoLyLdRBta3Cj5Oj4FG 4qBNepN0kKZxJdPgaT9WGw== X-Google-Smtp-Source: AFSGD/WpzdhTG/04KfFGOZWhkfcbxlLfUQArESSierVbdwONFtNtAjGMAkfqvVdxhqqgqIJsIfGAnQ== X-Received: by 2002:a05:6830:13c2:: with SMTP id e2mr15266877otq.15.1544039488275; Wed, 05 Dec 2018 11:51:28 -0800 (PST) Received: from xps15.herring.priv (24-155-109-49.dyn.grandenetworks.net. [24.155.109.49]) by smtp.googlemail.com with ESMTPSA id k13sm25759879otj.19.2018.12.05.11.51.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Dec 2018 11:51:27 -0800 (PST) From: Rob Herring To: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Date: Wed, 5 Dec 2018 13:50:49 -0600 Message-Id: <20181205195050.4759-33-robh@kernel.org> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 Cc: alsa-devel@alsa-project.org, Timur Tabi , Xiubo Li , Takashi Iwai , Liam Girdwood , Nicolin Chen , Mark Brown , Fabio Estevam , linuxppc-dev@lists.ozlabs.org Subject: [alsa-devel] [PATCH] ASoC: Use of_node_name_eq for node name comparisons X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Cc: Nicolin Chen Cc: Xiubo Li Cc: Fabio Estevam Cc: Liam Girdwood Cc: Mark Brown Cc: Jaroslav Kysela Cc: Takashi Iwai Cc: alsa-devel@alsa-project.org Cc: linuxppc-dev@lists.ozlabs.org Signed-off-by: Rob Herring --- 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);