Skip to content

Commit 25c56c8

Browse files
robherringbroonie
authored andcommitted
spi: Convert to using %pOF instead of full_name
Now that we have a custom printf format specifier, convert users of full_name to use %pOF instead. This is preparation to remove storing of the full path string for each node. Signed-off-by: Rob Herring <[email protected]> Reviewed-by: Geert Uytterhoeven <[email protected]> Signed-off-by: Mark Brown <[email protected]>
1 parent 5771a8c commit 25c56c8

File tree

2 files changed

+13
-18
lines changed

2 files changed

+13
-18
lines changed

drivers/spi/spi-orion.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -669,8 +669,8 @@ static int orion_spi_probe(struct platform_device *pdev)
669669
status = of_property_read_u32(np, "reg", &cs);
670670
if (status) {
671671
dev_err(&pdev->dev,
672-
"%s has no valid 'reg' property (%d)\n",
673-
np->full_name, status);
672+
"%pOF has no valid 'reg' property (%d)\n",
673+
np, status);
674674
status = 0;
675675
continue;
676676
}

drivers/spi/spi.c

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1583,8 +1583,8 @@ static int of_spi_parse_dt(struct spi_controller *ctlr, struct spi_device *spi,
15831583

15841584
if (spi_controller_is_slave(ctlr)) {
15851585
if (strcmp(nc->name, "slave")) {
1586-
dev_err(&ctlr->dev, "%s is not called 'slave'\n",
1587-
nc->full_name);
1586+
dev_err(&ctlr->dev, "%pOF is not called 'slave'\n",
1587+
nc);
15881588
return -EINVAL;
15891589
}
15901590
return 0;
@@ -1593,8 +1593,8 @@ static int of_spi_parse_dt(struct spi_controller *ctlr, struct spi_device *spi,
15931593
/* Device address */
15941594
rc = of_property_read_u32(nc, "reg", &value);
15951595
if (rc) {
1596-
dev_err(&ctlr->dev, "%s has no valid 'reg' property (%d)\n",
1597-
nc->full_name, rc);
1596+
dev_err(&ctlr->dev, "%pOF has no valid 'reg' property (%d)\n",
1597+
nc, rc);
15981598
return rc;
15991599
}
16001600
spi->chip_select = value;
@@ -1603,8 +1603,7 @@ static int of_spi_parse_dt(struct spi_controller *ctlr, struct spi_device *spi,
16031603
rc = of_property_read_u32(nc, "spi-max-frequency", &value);
16041604
if (rc) {
16051605
dev_err(&ctlr->dev,
1606-
"%s has no valid 'spi-max-frequency' property (%d)\n",
1607-
nc->full_name, rc);
1606+
"%pOF has no valid 'spi-max-frequency' property (%d)\n", nc, rc);
16081607
return rc;
16091608
}
16101609
spi->max_speed_hz = value;
@@ -1621,8 +1620,7 @@ of_register_spi_device(struct spi_controller *ctlr, struct device_node *nc)
16211620
/* Alloc an spi_device */
16221621
spi = spi_alloc_device(ctlr);
16231622
if (!spi) {
1624-
dev_err(&ctlr->dev, "spi_device alloc error for %s\n",
1625-
nc->full_name);
1623+
dev_err(&ctlr->dev, "spi_device alloc error for %pOF\n", nc);
16261624
rc = -ENOMEM;
16271625
goto err_out;
16281626
}
@@ -1631,8 +1629,7 @@ of_register_spi_device(struct spi_controller *ctlr, struct device_node *nc)
16311629
rc = of_modalias_node(nc, spi->modalias,
16321630
sizeof(spi->modalias));
16331631
if (rc < 0) {
1634-
dev_err(&ctlr->dev, "cannot find modalias for %s\n",
1635-
nc->full_name);
1632+
dev_err(&ctlr->dev, "cannot find modalias for %pOF\n", nc);
16361633
goto err_out;
16371634
}
16381635

@@ -1647,8 +1644,7 @@ of_register_spi_device(struct spi_controller *ctlr, struct device_node *nc)
16471644
/* Register the new device */
16481645
rc = spi_add_device(spi);
16491646
if (rc) {
1650-
dev_err(&ctlr->dev, "spi_device register error %s\n",
1651-
nc->full_name);
1647+
dev_err(&ctlr->dev, "spi_device register error %pOF\n", nc);
16521648
goto err_of_node_put;
16531649
}
16541650

@@ -1682,8 +1678,7 @@ static void of_register_spi_devices(struct spi_controller *ctlr)
16821678
spi = of_register_spi_device(ctlr, nc);
16831679
if (IS_ERR(spi)) {
16841680
dev_warn(&ctlr->dev,
1685-
"Failed to create SPI device for %s\n",
1686-
nc->full_name);
1681+
"Failed to create SPI device for %pOF\n", nc);
16871682
of_node_clear_flag(nc, OF_POPULATED);
16881683
}
16891684
}
@@ -3311,8 +3306,8 @@ static int of_spi_notify(struct notifier_block *nb, unsigned long action,
33113306
put_device(&ctlr->dev);
33123307

33133308
if (IS_ERR(spi)) {
3314-
pr_err("%s: failed to create for '%s'\n",
3315-
__func__, rd->dn->full_name);
3309+
pr_err("%s: failed to create for '%pOF'\n",
3310+
__func__, rd->dn);
33163311
of_node_clear_flag(rd->dn, OF_POPULATED);
33173312
return notifier_from_errno(PTR_ERR(spi));
33183313
}

0 commit comments

Comments
 (0)