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: 1008440 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43998q45lXz9s3l for ; Thu, 6 Dec 2018 07:20:43 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=kernel.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 43998q16TzzDqx4 for ; Thu, 6 Dec 2018 07:20:43 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dmarc=fail (p=none dis=none) header.from=kernel.org X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gmail.com (client-ip=209.85.210.65; helo=mail-ot1-f65.google.com; envelope-from=robherring2@gmail.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=fail (p=none dis=none) header.from=kernel.org Received: from mail-ot1-f65.google.com (mail-ot1-f65.google.com [209.85.210.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4398W63DZSzDqRt for ; Thu, 6 Dec 2018 06:51:30 +1100 (AEDT) Received: by mail-ot1-f65.google.com with SMTP id a11so19778838otr.10 for ; Wed, 05 Dec 2018 11:51:30 -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=o4tCqymkhD7YMjwIFiPfWYVwCcIjM8VGmF0ck6SGtdO0VhxskWqffVAXg9UPKGduwO OM5ioXtGl2PvTCkAlODTic9/LE+aDoMLGFsYNw8+AxYg3Ispf8JVSGTnlcthfRa7PrV+ b87UnQGZvn2VbrmZHk9UC8C6R3WMmYnm6LEH0A31DY4Ph0VxHAbxGt3Juk9DlrItyb3C n6AlkN8Jk/22cUmE1bWOHxjk2bZ6mxI3Gk97Nu2rxsL+Ma3F52UUwDVQ3Np4e2KMgO/U Lqbs0SgxOIdReD+15gmhwNHx7dAyKST88z5IVJdF6x8ED2ibU5q34KSbN5YeMXXZTW+v 1KYw== X-Gm-Message-State: AA+aEWYNiUpXQgMUM/3FNFwvXvEPl8knBvdflVkXcVZsl69wVDhhDVca 5TWV8ugy6tbaNou1IIcGTQ== 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 Subject: [PATCH] ASoC: Use of_node_name_eq for node name comparisons 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 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alsa-devel@alsa-project.org, Timur Tabi , Xiubo Li , Takashi Iwai , Liam Girdwood , Jaroslav Kysela , Nicolin Chen , Mark Brown , Fabio Estevam , linuxppc-dev@lists.ozlabs.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" 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);