From: Johan Hovold <johan@kernel.org>
To: Mark Brown <broonie@kernel.org>
Cc: linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org,
Johan Hovold <johan@kernel.org>
Subject: [PATCH v2 2/3] spi: omap2-mcspi: clean up error labels
Date: Thu, 30 Apr 2026 14:01:59 +0200 [thread overview]
Message-ID: <20260430120200.249323-3-johan@kernel.org> (raw)
In-Reply-To: <20260430120200.249323-1-johan@kernel.org>
Clean up the error labels by adding a common prefix and naming them
after what they do.
Signed-off-by: Johan Hovold <johan@kernel.org>
---
drivers/spi/spi-omap2-mcspi.c | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
diff --git a/drivers/spi/spi-omap2-mcspi.c b/drivers/spi/spi-omap2-mcspi.c
index 60c05eb91781..59ebdf7edbd2 100644
--- a/drivers/spi/spi-omap2-mcspi.c
+++ b/drivers/spi/spi-omap2-mcspi.c
@@ -1553,26 +1553,27 @@ static int omap2_mcspi_probe(struct platform_device *pdev)
status = omap2_mcspi_request_dma(mcspi,
&mcspi->dma_channels[i]);
if (status == -EPROBE_DEFER)
- goto free_ctlr;
+ goto err_release_dma;
}
status = platform_get_irq(pdev, 0);
if (status < 0)
- goto free_ctlr;
+ goto err_release_dma;
+
init_completion(&mcspi->txdone);
status = devm_request_irq(&pdev->dev, status,
omap2_mcspi_irq_handler, 0, pdev->name,
mcspi);
if (status) {
dev_err(&pdev->dev, "Cannot request IRQ");
- goto free_ctlr;
+ goto err_release_dma;
}
mcspi->ref_clk = devm_clk_get_optional_enabled(&pdev->dev, NULL);
if (IS_ERR(mcspi->ref_clk)) {
status = PTR_ERR(mcspi->ref_clk);
dev_err_probe(&pdev->dev, status, "Failed to get ref_clk");
- goto free_ctlr;
+ goto err_release_dma;
}
if (mcspi->ref_clk)
mcspi->ref_clk_hz = clk_get_rate(mcspi->ref_clk);
@@ -1587,19 +1588,19 @@ static int omap2_mcspi_probe(struct platform_device *pdev)
status = omap2_mcspi_controller_setup(mcspi);
if (status < 0)
- goto disable_pm;
+ goto err_disable_rpm;
status = spi_register_controller(ctlr);
if (status < 0)
- goto disable_pm;
+ goto err_disable_rpm;
return status;
-disable_pm:
+err_disable_rpm:
pm_runtime_dont_use_autosuspend(&pdev->dev);
pm_runtime_put_sync(&pdev->dev);
pm_runtime_disable(&pdev->dev);
-free_ctlr:
+err_release_dma:
omap2_mcspi_release_dma(ctlr);
return status;
--
2.53.0
next prev parent reply other threads:[~2026-04-30 12:03 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-30 12:01 [PATCH v2 0/3] spi: omap2-mcspi: switch to managed controller allocation Johan Hovold
2026-04-30 12:01 ` [PATCH v2 1/3] " Johan Hovold
2026-04-30 12:01 ` Johan Hovold [this message]
2026-04-30 12:02 ` [PATCH v2 3/3] spi: omap2-mcspi: clean up probe return value Johan Hovold
2026-05-04 13:12 ` [PATCH v2 0/3] spi: omap2-mcspi: switch to managed controller allocation 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=20260430120200.249323-3-johan@kernel.org \
--to=johan@kernel.org \
--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