diff mbox series

scsi: Use of_node_name_eq for node name comparisons

Message ID 20181205195050.4759-23-robh@kernel.org (mailing list archive)
State Accepted
Commit 4b66810303f507a56d07ba9b1b264cd51c41fed6
Headers show
Series scsi: Use of_node_name_eq for node name comparisons | expand

Commit Message

Rob Herring (Arm) Dec. 5, 2018, 7:50 p.m. UTC
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: "James E.J. Bottomley" <jejb@linux.vnet.ibm.com>
Cc: "Martin K. Petersen" <martin.petersen@oracle.com>
Cc: linux-scsi@vger.kernel.org
Signed-off-by: Rob Herring <robh@kernel.org>
---
 drivers/scsi/sun_esp.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

Comments

Martin K. Petersen Dec. 8, 2018, 2:57 a.m. UTC | #1
Rob,

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

Applied to 4.21/scsi-queue, thanks.
diff mbox series

Patch

diff --git a/drivers/scsi/sun_esp.c b/drivers/scsi/sun_esp.c
index a11efbcb7f8b..c71bd01fef94 100644
--- a/drivers/scsi/sun_esp.c
+++ b/drivers/scsi/sun_esp.c
@@ -529,11 +529,10 @@  static int esp_sbus_probe(struct platform_device *op)
 	int hme = 0;
 	int ret;
 
-	if (dp->parent &&
-	    (!strcmp(dp->parent->name, "espdma") ||
-	     !strcmp(dp->parent->name, "dma")))
+	if (of_node_name_eq(dp->parent, "espdma") ||
+	    of_node_name_eq(dp->parent, "dma"))
 		dma_node = dp->parent;
-	else if (!strcmp(dp->name, "SUNW,fas")) {
+	else if (of_node_name_eq(dp, "SUNW,fas")) {
 		dma_node = op->dev.of_node;
 		hme = 1;
 	}