mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] spi: axi-spi-engine: remove platform_set_drvdata()
@ 2024-06-26 19:45 David Lechner
  2024-06-27  5:39 ` Nuno Sá
  2024-06-27 13:10 ` Mark Brown
  0 siblings, 2 replies; 3+ messages in thread
From: David Lechner @ 2024-06-26 19:45 UTC (permalink / raw)
  To: Mark Brown
  Cc: David Lechner, Michael Hennerich, Nuno Sá, linux-spi, linux-kernel

platform_get_drvdata() is never called in the AXI SPI Engine driver, so
platform_set_drvdata() is not needed. Remove it. This also lets us
avoid the final error check in the probe function.

Signed-off-by: David Lechner <dlechner@baylibre.com>
---
 drivers/spi/spi-axi-spi-engine.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/drivers/spi/spi-axi-spi-engine.c b/drivers/spi/spi-axi-spi-engine.c
index 103a68bd4f19..447e5a962dee 100644
--- a/drivers/spi/spi-axi-spi-engine.c
+++ b/drivers/spi/spi-axi-spi-engine.c
@@ -700,13 +700,7 @@ static int spi_engine_probe(struct platform_device *pdev)
 	if (host->max_speed_hz == 0)
 		return dev_err_probe(&pdev->dev, -EINVAL, "spi_clk rate is 0");
 
-	ret = devm_spi_register_controller(&pdev->dev, host);
-	if (ret)
-		return ret;
-
-	platform_set_drvdata(pdev, host);
-
-	return 0;
+	return devm_spi_register_controller(&pdev->dev, host);
 }
 
 static const struct of_device_id spi_engine_match_table[] = {

---
base-commit: f66ed82666bc582434d57359d2d83d6f40c925e4
change-id: 20240626-spi-axi-spi-engine-remove-drvdata-cf390daaa2ab


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

end of thread, other threads:[~2024-06-27 13:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-06-26 19:45 [PATCH] spi: axi-spi-engine: remove platform_set_drvdata() David Lechner
2024-06-27  5:39 ` Nuno Sá
2024-06-27 13:10 ` Mark Brown

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®