mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Mark Brown <broonie@kernel.org>,
	linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Subject: [PATCH v1 2/2] spi: Deduplicate deferred probe checks in spi_probe()
Date: Sun,  8 Dec 2024 18:03:17 +0200	[thread overview]
Message-ID: <20241208195635.1271656-3-andriy.shevchenko@linux.intel.com> (raw)
In-Reply-To: <20241208195635.1271656-1-andriy.shevchenko@linux.intel.com>

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 --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)
-- 
2.43.0.rc1.1336.g36b5255a03ac


  parent reply	other threads:[~2024-12-08 19:56 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-08 16:03 [PATCH v1 0/2] spi: Unify and simplify fwnode related checks Andy Shevchenko
2024-12-08 16:03 ` [PATCH v1 1/2] spi: Unify firmware node type checks Andy Shevchenko
2024-12-08 16:03 ` Andy Shevchenko [this message]
2024-12-10 18:05 ` [PATCH v1 0/2] spi: Unify and simplify fwnode related checks Mark Brown
2024-12-11  4:12 ` Mukesh Kumar Savaliya
2024-12-11 10:59   ` Andy Shevchenko
2024-12-11 11:33     ` Andy Shevchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241208195635.1271656-3-andriy.shevchenko@linux.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=broonie@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®