From patchwork Wed Dec 5 19:50:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Herring X-Patchwork-Id: 10714811 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 BAA91157A for ; Wed, 5 Dec 2018 19:52:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AC1A92E3A0 for ; Wed, 5 Dec 2018 19:52:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A0EEA2E3A1; Wed, 5 Dec 2018 19:52:09 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 6E1F82E399 for ; Wed, 5 Dec 2018 19:52:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=UIL8GrqH3WUncSvHqVBofEZ2CoFGT4C87VaEXQ9J0+c=; b=U54QBfP4RQQArD DXfNznieMMaN7F0EhOgi87jrEjfLVuhHGxqeDL8Uy2Nt8d9ftDY0fl2zvW1yybjO8h4hRCTPQwHFo UEmyYv4NmllxOHMOwjpWU+phj1QrWq3aFAKz0Wr8YGWGqIjqFK5d9Dw4Ih1rASzxvxsSnaqNx3Qyo jREPdq+62fqOuwyESu3DMYkM8lfSHi/gGfMNK9346+w3PPH4v7fO+0Gklh6o4NsP7ItVSBxKLF/c4 3a8MYtFs16TNYNwFkJ14hXCxiqkEtn09xXoZ/zreUySVIeXerhr3VIdUqywMPqFtFMseN3p5E8zr0 cZylf77ucm9oDluWxjZg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gUdDI-0001zg-FY; Wed, 05 Dec 2018 19:52:04 +0000 Received: from mail-oi1-f194.google.com ([209.85.167.194]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gUdCd-00013n-MF; Wed, 05 Dec 2018 19:51:31 +0000 Received: by mail-oi1-f194.google.com with SMTP id y23so18657732oia.4; Wed, 05 Dec 2018 11:51:13 -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=kV+bfkiFbMBXJunTBXrEXEZOatnnsr69uBsZeOB6vV8=; b=FUUg0bVzcjH0J0+PCrAorZe0KZQ/fs68qJnr7TzpDYCp4P3KcM5fS86NuC9VP3wJ9y ZtDShwgq3PV9YOpf0oqyZypxfaWOzSdWlc3dmmsTC5KNVSo7qTKbr8XR41NUxCo4102w xZhdrdkx9cNoP6kIY0ezySCx1RwoTMoeI1ATQ3kOLYTrUybg5B2/w4bbtF9yKtdtPn5W olkGoYw02Q1okHb8MYgaHP1yzzbwKm124Y/u9ahq1oD0GWXi6iYpjqmyHfQjwxBN/vp9 gCOUg3J9IprhSq1SfvQHnPNTTUGnMsLf00zdFkKYcVNOFwI+3KLCy9QAdGFOdUaNgEYT xSng== X-Gm-Message-State: AA+aEWbDUS/6gxkpB5d61HGZ6GY0Rsb6HEuadh5YqpNfkDoYphUfEE+9 8DgOehVOc+10JNfWm0izQ/nESS4= X-Google-Smtp-Source: AFSGD/Vw2xyPBuMfRWc6LCcAZLtIZgBj6fkHey+JeMWTTALy+VvNSUAe0KUClEvAfXtfSq5Ir78asw== X-Received: by 2002:a54:468b:: with SMTP id k11mr14909094oic.27.1544039472473; Wed, 05 Dec 2018 11:51:12 -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.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Dec 2018 11:51:11 -0800 (PST) From: Rob Herring To: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] phy: Use of_node_name_eq for node name comparisons Date: Wed, 5 Dec 2018 13:50:35 -0600 Message-Id: <20181205195050.4759-19-robh@kernel.org> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181205_115124_868830_D27F2E5E X-CRM114-Status: GOOD ( 12.67 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-rockchip@lists.infradead.org, Heiko Stuebner , linux-arm-kernel@lists.infradead.org, Kishon Vijay Abraham I Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.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 instances using of_node_cmp, this has the side effect of now using case sensitive comparisons. This should not matter for any FDT based system which all of these are. Cc: Kishon Vijay Abraham I Cc: Heiko Stuebner Cc: linux-arm-kernel@lists.infradead.org Cc: linux-rockchip@lists.infradead.org Signed-off-by: Rob Herring --- drivers/phy/rockchip/phy-rockchip-inno-usb2.c | 6 +++--- drivers/phy/rockchip/phy-rockchip-typec.c | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c index 24bd2717abdb..91fba60267a0 100644 --- a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c +++ b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c @@ -1168,8 +1168,8 @@ static int rockchip_usb2phy_probe(struct platform_device *pdev) struct phy *phy; /* This driver aims to support both otg-port and host-port */ - if (of_node_cmp(child_np->name, "host-port") && - of_node_cmp(child_np->name, "otg-port")) + if (!of_node_name_eq(child_np, "host-port") && + !of_node_name_eq(child_np, "otg-port")) goto next_child; phy = devm_phy_create(dev, child_np, &rockchip_usb2phy_ops); @@ -1183,7 +1183,7 @@ static int rockchip_usb2phy_probe(struct platform_device *pdev) phy_set_drvdata(rport->phy, rport); /* initialize otg/host port separately */ - if (!of_node_cmp(child_np->name, "host-port")) { + if (of_node_name_eq(child_np, "host-port")) { ret = rockchip_usb2phy_host_port_init(rphy, rport, child_np); if (ret) diff --git a/drivers/phy/rockchip/phy-rockchip-typec.c b/drivers/phy/rockchip/phy-rockchip-typec.c index c57e496f0b0c..e32edeebcd63 100644 --- a/drivers/phy/rockchip/phy-rockchip-typec.c +++ b/drivers/phy/rockchip/phy-rockchip-typec.c @@ -1176,10 +1176,10 @@ static int rockchip_typec_phy_probe(struct platform_device *pdev) for_each_available_child_of_node(np, child_np) { struct phy *phy; - if (!of_node_cmp(child_np->name, "dp-port")) + if (of_node_name_eq(child_np, "dp-port")) phy = devm_phy_create(dev, child_np, &rockchip_dp_phy_ops); - else if (!of_node_cmp(child_np->name, "usb3-port")) + else if (of_node_name_eq(child_np, "usb3-port")) phy = devm_phy_create(dev, child_np, &rockchip_usb3_phy_ops); else