linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] spi: mpc5xxx-psc: Fix compile error
@ 2023-03-12 13:39 Andi Shyti
  2023-03-13  7:41 ` Krzysztof Kozlowski
  0 siblings, 1 reply; 2+ messages in thread
From: Andi Shyti @ 2023-03-12 13:39 UTC (permalink / raw)
  To: linux-spi, linux-kernel; +Cc: Mark Brown, Andy Shevchenko, Andi Shyti

Commit 9e21720a4958 ("spi: mpc5xxx-psc: use
devm_clk_get_enabled() for core clock") has made use of the
devm_clk_get_enabled(), but it actually forgot to remove a couple
of goto's, triggering the following compile error:

drivers/spi/spi-mpc512x-psc.c: In function ‘mpc512x_psc_spi_of_probe’:
drivers/spi/spi-mpc512x-psc.c:518:17: error: label ‘free_ipg_clock’ used but not defined
  518 |                 goto free_ipg_clock;

Replace those goto's with actual returns.

Fixes: 9e21720a4958 ("spi: mpc5xxx-psc: use devm_clk_get_enabled() for core clock")
Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/spi/spi-mpc512x-psc.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/spi/spi-mpc512x-psc.c b/drivers/spi/spi-mpc512x-psc.c
index 77a228f633d1..0b86f1804682 100644
--- a/drivers/spi/spi-mpc512x-psc.c
+++ b/drivers/spi/spi-mpc512x-psc.c
@@ -511,13 +511,9 @@ static int mpc512x_psc_spi_of_probe(struct platform_device *pdev)
 
 	ret = mpc512x_psc_spi_port_config(master, mps);
 	if (ret < 0)
-		goto free_ipg_clock;
-
-	ret = devm_spi_register_master(dev, master);
-	if (ret < 0)
-		goto free_ipg_clock;
+		return ret;
 
-	return ret;
+	return devm_spi_register_master(dev, master);
 }
 
 static const struct of_device_id mpc512x_psc_spi_of_match[] = {
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] spi: mpc5xxx-psc: Fix compile error
  2023-03-12 13:39 [PATCH] spi: mpc5xxx-psc: Fix compile error Andi Shyti
@ 2023-03-13  7:41 ` Krzysztof Kozlowski
  0 siblings, 0 replies; 2+ messages in thread
From: Krzysztof Kozlowski @ 2023-03-13  7:41 UTC (permalink / raw)
  To: Andi Shyti, linux-spi, linux-kernel; +Cc: Mark Brown, Andy Shevchenko

On 12/03/2023 14:39, Andi Shyti wrote:
> Commit 9e21720a4958 ("spi: mpc5xxx-psc: use
> devm_clk_get_enabled() for core clock") has made use of the
> devm_clk_get_enabled(), but it actually forgot to remove a couple
> of goto's, triggering the following compile error:
> 
> drivers/spi/spi-mpc512x-psc.c: In function ‘mpc512x_psc_spi_of_probe’:
> drivers/spi/spi-mpc512x-psc.c:518:17: error: label ‘free_ipg_clock’ used but not defined
>   518 |                 goto free_ipg_clock;
> 
> Replace those goto's with actual returns.

https://lore.kernel.org/all/20230310111544.57342-1-andriy.shevchenko@linux.intel.com/

Best regards,
Krzysztof


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-03-13  7:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-12 13:39 [PATCH] spi: mpc5xxx-psc: Fix compile error Andi Shyti
2023-03-13  7:41 ` Krzysztof Kozlowski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).