diff mbox series

[v1,2/2] spi: Deduplicate deferred probe checks in spi_probe()

Message ID 20241208195635.1271656-3-andriy.shevchenko@linux.intel.com (mailing list archive)
State Accepted
Commit 0020c9d2d572b49c55b2e1fabe6f6687e11a3ced
Headers show
Series spi: Unify and simplify fwnode related checks | expand

Commit Message

Andy Shevchenko Dec. 8, 2024, 4:03 p.m. UTC
Deduplicate deferred probe checks in spi_probe() and enable
the error message for ACPI case as well.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/spi/spi.c | 17 ++++++-----------
 1 file changed, 6 insertions(+), 11 deletions(-)
diff mbox series

Patch

diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
index 88f785b9e6ec..e0f79773be70 100644
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
@@ -417,19 +417,14 @@  static int spi_probe(struct device *dev)
 	if (ret)
 		return ret;
 
-	if (is_of_node(fwnode)) {
+	if (is_of_node(fwnode))
 		spi->irq = of_irq_get(dev->of_node, 0);
-		if (spi->irq == -EPROBE_DEFER)
-			return dev_err_probe(dev, -EPROBE_DEFER, "Failed to get irq\n");
-		if (spi->irq < 0)
-			spi->irq = 0;
-	} else if (is_acpi_device_node(fwnode) && spi->irq < 0) {
+	else if (is_acpi_device_node(fwnode) && spi->irq < 0)
 		spi->irq = acpi_dev_gpio_irq_get(to_acpi_device_node(fwnode), 0);
-		if (spi->irq == -EPROBE_DEFER)
-			return -EPROBE_DEFER;
-		if (spi->irq < 0)
-			spi->irq = 0;
-	}
+	if (spi->irq == -EPROBE_DEFER)
+		return dev_err_probe(dev, spi->irq, "Failed to get irq\n");
+	if (spi->irq < 0)
+		spi->irq = 0;
 
 	ret = dev_pm_domain_attach(dev, true);
 	if (ret)