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 X-Patchwork-Id: 152956 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp9695741ljp; Wed, 5 Dec 2018 11:51:46 -0800 (PST) X-Google-Smtp-Source: AFSGD/W7DEM8OAlvAV1YtHabs3xpg6k/b3ynMPNXcMt6W6ejlhKxIZ3fLh1m5+mea/MCaG7n/VKq X-Received: by 2002:adf:83a7:: with SMTP id 36mr23104683wre.13.1544039506735; Wed, 05 Dec 2018 11:51:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544039506; cv=none; d=google.com; s=arc-20160816; b=ycfEBF31iBWzfdnobKArharGS3fOeom0T0xbsq9yA8IY/6S45t2mn/Syyl3xw5ksvo CyO60ilvYt6b2+LSM7SkjGexU4I4Gk6cyjsSp5zeQKARRgezHH9MMqygO4takM84Yodl pChorjkQTFytnU8rwYv8JFO8P4kolMTFdRZkg2T5/MQAu03UL2ETXK2iCMm94OHOH+jh JUnVbF8ynE5b8e4cXz9HSUlAxnSK/uslFU65AfYAyeCwQmTlUDqsIJhbvaSWcykkcody PtjIs8M0+eBfnCUx6v16xkws838kE3LtK50OKw2mLNcoqSKwyYUHXfcFNQ19DD7k0BEJ zcbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :cc:mime-version:message-id:date:to:from:delivered-to; bh=S2LvIm10PSjcOHtb709B1uCYa5G4vDnmRVhL+ufhWT0=; b=ahi0fzC/jkFqB1kEKikJZIxblPCq6LLJbiWxAfirqZPG5+lO8D904ePOSstiTVgu6O dlnpm12+ZwYXRJjV8dctbggi5zYDYYsCfmWDHsniMwgXZRqbFrfSgOrqJcuWQXU5JkPE YQPUQS+Iq1xwy9oqWBoWnKa/PV6ZxkIkuHiqUCXy1Dulf/jpL6e8r0xcLCtADED1MwVe CjU/xezviKcH2NMlVuW/6blAdwrtX+pI/U5keaTRdZApJAXxR6L3GtN84lWq4fLGVvvc npWKcD8EqFQT71zqgNxGzN3jHxQDaLbdF2OW8md9CqEQuq0OEkPDBs+ONriKqd0ooFY6 bEvw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) smtp.mailfrom=alsa-devel-bounces@alsa-project.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from alsa0.perex.cz (alsa0.perex.cz. [77.48.224.243]) by mx.google.com with ESMTP id m15si10954728wmi.179.2018.12.05.11.51.46; Wed, 05 Dec 2018 11:51:46 -0800 (PST) Received-SPF: pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) client-ip=77.48.224.243; Authentication-Results: mx.google.com; spf=pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) smtp.mailfrom=alsa-devel-bounces@alsa-project.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.3 required=5.0 tests=FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_PASS autolearn=disabled version=3.4.0 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-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 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(-) -- 2.19.1 _______________________________________________ Alsa-devel mailing list Alsa-devel@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/alsa-devel 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);