From: Johan Hovold <johan@kernel.org>
To: Mark Brown <broonie@kernel.org>
Cc: Eddie James <eajames@linux.ibm.com>,
Yang Shen <shenyang39@huawei.com>,
Neil Armstrong <neil.armstrong@linaro.org>,
Kevin Hilman <khilman@baylibre.com>,
linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org,
Johan Hovold <johan@kernel.org>
Subject: [PATCH 03/12] spi: clps711x: switch to managed controller allocation
Date: Mon, 11 May 2026 17:03:59 +0200 [thread overview]
Message-ID: <20260511150408.796155-4-johan@kernel.org> (raw)
In-Reply-To: <20260511150408.796155-1-johan@kernel.org>
Switch to device managed controller allocation for consistency and to
simplify error handling.
Signed-off-by: Johan Hovold <johan@kernel.org>
---
drivers/spi/spi-clps711x.c | 31 +++++++++----------------------
1 file changed, 9 insertions(+), 22 deletions(-)
diff --git a/drivers/spi/spi-clps711x.c b/drivers/spi/spi-clps711x.c
index d6458e59d41b..382c3c81c4b9 100644
--- a/drivers/spi/spi-clps711x.c
+++ b/drivers/spi/spi-clps711x.c
@@ -99,7 +99,7 @@ static int spi_clps711x_probe(struct platform_device *pdev)
if (irq < 0)
return irq;
- host = spi_alloc_host(&pdev->dev, sizeof(*hw));
+ host = devm_spi_alloc_host(&pdev->dev, sizeof(*hw));
if (!host)
return -ENOMEM;
@@ -113,22 +113,16 @@ static int spi_clps711x_probe(struct platform_device *pdev)
hw = spi_controller_get_devdata(host);
hw->spi_clk = devm_clk_get(&pdev->dev, NULL);
- if (IS_ERR(hw->spi_clk)) {
- ret = PTR_ERR(hw->spi_clk);
- goto err_out;
- }
+ if (IS_ERR(hw->spi_clk))
+ return PTR_ERR(hw->spi_clk);
hw->syscon = syscon_regmap_lookup_by_phandle(np, "syscon");
- if (IS_ERR(hw->syscon)) {
- ret = PTR_ERR(hw->syscon);
- goto err_out;
- }
+ if (IS_ERR(hw->syscon))
+ return PTR_ERR(hw->syscon);
hw->syncio = devm_platform_ioremap_resource(pdev, 0);
- if (IS_ERR(hw->syncio)) {
- ret = PTR_ERR(hw->syncio);
- goto err_out;
- }
+ if (IS_ERR(hw->syncio))
+ return PTR_ERR(hw->syncio);
/* Disable extended mode due hardware problems */
regmap_update_bits(hw->syscon, SYSCON_OFFSET, SYSCON3_ADCCON, 0);
@@ -139,16 +133,9 @@ static int spi_clps711x_probe(struct platform_device *pdev)
ret = devm_request_irq(&pdev->dev, irq, spi_clps711x_isr, 0,
dev_name(&pdev->dev), host);
if (ret)
- goto err_out;
+ return ret;
- ret = devm_spi_register_controller(&pdev->dev, host);
- if (!ret)
- return 0;
-
-err_out:
- spi_controller_put(host);
-
- return ret;
+ return devm_spi_register_controller(&pdev->dev, host);
}
static const struct of_device_id clps711x_spi_dt_ids[] = {
--
2.53.0
next prev parent reply other threads:[~2026-05-11 15:04 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-11 15:03 [PATCH 00/12] spi: switch to managed controller allocation (part 3/3) Johan Hovold
2026-05-11 15:03 ` [PATCH 01/12] spi: altera-platform: switch to managed controller allocation Johan Hovold
2026-05-11 15:03 ` [PATCH 02/12] spi: armada-3700: " Johan Hovold
2026-05-11 15:03 ` Johan Hovold [this message]
2026-05-11 15:04 ` [PATCH 04/12] spi: falcon: " Johan Hovold
2026-05-11 15:04 ` [PATCH 05/12] spi: fsi: " Johan Hovold
2026-05-11 15:04 ` [PATCH 06/12] spi: hisi-sfc-v3xx: " Johan Hovold
2026-05-11 15:04 ` [PATCH 07/12] spi: jcore: " Johan Hovold
2026-05-11 15:04 ` [PATCH 08/12] spi: lp8841-rtc: " Johan Hovold
2026-05-11 15:04 ` [PATCH 09/12] spi: lp8841-rtc: drop unused ifdef Johan Hovold
2026-05-11 15:04 ` [PATCH 10/12] spi: meson-spifc: switch to managed controller allocation Johan Hovold
2026-05-11 15:04 ` [PATCH 11/12] spi: mux: " Johan Hovold
2026-05-11 15:04 ` [PATCH 12/12] spi: xlp: " Johan Hovold
2026-05-18 9:31 ` [PATCH 00/12] spi: switch to managed controller allocation (part 3/3) Mark Brown
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=20260511150408.796155-4-johan@kernel.org \
--to=johan@kernel.org \
--cc=broonie@kernel.org \
--cc=eajames@linux.ibm.com \
--cc=khilman@baylibre.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-spi@vger.kernel.org \
--cc=neil.armstrong@linaro.org \
--cc=shenyang39@huawei.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.