diff options
| author | Andy Shevchenko <[email protected]> | 2023-07-10 15:49:18 +0000 |
|---|---|---|
| committer | Mark Brown <[email protected]> | 2023-07-10 17:27:42 +0000 |
| commit | fbab5b2c09060e8034fee6ec2df69a62594fb7db (patch) | |
| tree | 9ced565720446d20620911854fa8fcb7b7ce399c /drivers/spi/spi.c | |
| parent | Linux 6.5-rc1 (diff) | |
| download | kernel-fbab5b2c09060e8034fee6ec2df69a62594fb7db.tar.gz kernel-fbab5b2c09060e8034fee6ec2df69a62594fb7db.zip | |
spi: Remove unneeded OF node NULL checks
In the couple of places the NULL check of OF node is implied by the call
that takes it as a parameter. Drop the respective duplicate checks.
Signed-off-by: Andy Shevchenko <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
Diffstat (limited to 'drivers/spi/spi.c')
| -rw-r--r-- | drivers/spi/spi.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c index 9291b2a0e887..8f3282a71c63 100644 --- a/drivers/spi/spi.c +++ b/drivers/spi/spi.c @@ -2399,9 +2399,6 @@ static void of_register_spi_devices(struct spi_controller *ctlr) struct spi_device *spi; struct device_node *nc; - if (!ctlr->dev.of_node) - return; - for_each_available_child_of_node(ctlr->dev.of_node, nc) { if (of_node_test_and_set_flag(nc, OF_POPULATED)) continue; @@ -3134,7 +3131,7 @@ int spi_register_controller(struct spi_controller *ctlr) if (WARN(id < 0, "couldn't get idr")) return id == -ENOSPC ? -EBUSY : id; ctlr->bus_num = id; - } else if (ctlr->dev.of_node) { + } else { /* Allocate dynamic bus number using Linux idr */ id = of_alias_get_id(ctlr->dev.of_node, "spi"); if (id >= 0) { |
