diff options
author | Rob Herring <robh@kernel.org> | 2018-12-05 14:50:35 -0500 |
---|---|---|
committer | Kishon Vijay Abraham I <kishon@ti.com> | 2018-12-11 23:31:44 -0500 |
commit | 03e7d002526dc447902d15aba7d24919d9a13f92 (patch) | |
tree | 9c1b8ecfe937428032ea182d153569193498dc70 /drivers/phy/rockchip | |
parent | 3ff18849eb658b16ff4a22da9360bba5dc68a2d2 (diff) |
phy: 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 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 <kishon@ti.com>
Cc: Heiko Stuebner <heiko@sntech.de>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-rockchip@lists.infradead.org
Signed-off-by: Rob Herring <robh@kernel.org>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Diffstat (limited to 'drivers/phy/rockchip')
-rw-r--r-- | drivers/phy/rockchip/phy-rockchip-inno-usb2.c | 6 | ||||
-rw-r--r-- | 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) | |||
1168 | struct phy *phy; | 1168 | struct phy *phy; |
1169 | 1169 | ||
1170 | /* This driver aims to support both otg-port and host-port */ | 1170 | /* This driver aims to support both otg-port and host-port */ |
1171 | if (of_node_cmp(child_np->name, "host-port") && | 1171 | if (!of_node_name_eq(child_np, "host-port") && |
1172 | of_node_cmp(child_np->name, "otg-port")) | 1172 | !of_node_name_eq(child_np, "otg-port")) |
1173 | goto next_child; | 1173 | goto next_child; |
1174 | 1174 | ||
1175 | phy = devm_phy_create(dev, child_np, &rockchip_usb2phy_ops); | 1175 | phy = devm_phy_create(dev, child_np, &rockchip_usb2phy_ops); |
@@ -1183,7 +1183,7 @@ static int rockchip_usb2phy_probe(struct platform_device *pdev) | |||
1183 | phy_set_drvdata(rport->phy, rport); | 1183 | phy_set_drvdata(rport->phy, rport); |
1184 | 1184 | ||
1185 | /* initialize otg/host port separately */ | 1185 | /* initialize otg/host port separately */ |
1186 | if (!of_node_cmp(child_np->name, "host-port")) { | 1186 | if (of_node_name_eq(child_np, "host-port")) { |
1187 | ret = rockchip_usb2phy_host_port_init(rphy, rport, | 1187 | ret = rockchip_usb2phy_host_port_init(rphy, rport, |
1188 | child_np); | 1188 | child_np); |
1189 | if (ret) | 1189 | 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) | |||
1176 | for_each_available_child_of_node(np, child_np) { | 1176 | for_each_available_child_of_node(np, child_np) { |
1177 | struct phy *phy; | 1177 | struct phy *phy; |
1178 | 1178 | ||
1179 | if (!of_node_cmp(child_np->name, "dp-port")) | 1179 | if (of_node_name_eq(child_np, "dp-port")) |
1180 | phy = devm_phy_create(dev, child_np, | 1180 | phy = devm_phy_create(dev, child_np, |
1181 | &rockchip_dp_phy_ops); | 1181 | &rockchip_dp_phy_ops); |
1182 | else if (!of_node_cmp(child_np->name, "usb3-port")) | 1182 | else if (of_node_name_eq(child_np, "usb3-port")) |
1183 | phy = devm_phy_create(dev, child_np, | 1183 | phy = devm_phy_create(dev, child_np, |
1184 | &rockchip_usb3_phy_ops); | 1184 | &rockchip_usb3_phy_ops); |
1185 | else | 1185 | else |