Skip to content

Commit

Permalink
spi: Use of_node_name_eq for node name comparisons
Browse files Browse the repository at this point in the history
Convert string compares of DT node names to use of_node_name_eq helper
instead. This removes direct access to the node name pointer.

Signed-off-by: Rob Herring <robh@kernel.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
  • Loading branch information
Rob Herring authored and Mark Brown committed Dec 6, 2018
1 parent ae218f7 commit 194276b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/spi/spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1666,7 +1666,7 @@ static int of_spi_parse_dt(struct spi_controller *ctlr, struct spi_device *spi,
}

if (spi_controller_is_slave(ctlr)) {
if (strcmp(nc->name, "slave")) {
if (!of_node_name_eq(nc, "slave")) {
dev_err(&ctlr->dev, "%pOF is not called 'slave'\n",
nc);
return -EINVAL;
Expand Down

0 comments on commit 194276b

Please sign in to comment.