Skip to contentSkip to conversation

spi: mpc5xxx-psc: Fix compile error

PATCH In review Andi Shyti 2 participants 2 messages Mar 12, 2023 – Mar 13, 2023 SPI

lore
Share & tools
lore

Andi Shyti

author
#0 lore raw

PATCH 1/1 spi: mpc5xxx-psc: Fix compile error

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")
Cc Andy Shevchenko <[email protected]>
---
 drivers/spi/spi-mpc512x-psc.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
drivers/spi/spi-mpc512x-psc.c +2 -6
index 77a228f633d1..0b86f1804682 100644
@@ -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[] = {
Signature · 1 line
2.39.2
#1 lore raw
Quoted 10 lines · 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.

https://lore.kernel.org/all/[email protected]/

Best regards,
Krzysztof