Skip to contentSkip to conversation

ide: Use of_node_name_eq for node name comparisons

PATCH Applied Rob Herring 2 participants 2 messages Dec 5, 2018 – Dec 23, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ide: 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.

Cc "David S. Miller" <[email protected]>
Cc Benjamin Herrenschmidt <[email protected]>
Cc Paul Mackerras <[email protected]>
Cc Michael Ellerman <[email protected]>
---
 drivers/ide/pmac.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/ide/pmac.c +1 -1
index c5b902b86b44..ec46aa84d18d 100644
@@ -1045,7 +1045,7 @@ static int pmac_ide_setup_device(pmac_ide_hwif_t *pmif, struct ide_hw *hw)
 		d.port_ops = &pmac_ide_ata4_port_ops;
 		d.udma_mask = ATA_UDMA5;
 	} else if (of_device_is_compatible(np, "keylargo-ata")) {
-		if (strcmp(np->name, "ata-4") == 0) {
+		if (of_node_name_eq(np, "ata-4")) {
 			pmif->kind = controller_kl_ata4;
 			d.port_ops = &pmac_ide_ata4_port_ops;
 			d.udma_mask = ATA_UDMA4;
Signature · 1 line
2.19.1
#1 lore raw
Quoted 10 lines · Rob Herring

Convert string compares of DT node names to use of_node_name_eq helper instead. This removes direct access to the node name pointer.

Cc "David S. Miller" <[email protected]>
Cc Benjamin Herrenschmidt <[email protected]>
Cc Paul Mackerras <[email protected]>
Cc Michael Ellerman <[email protected]>

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/c1fa31b0fc90a80d64a334e5d35dca

cheers