LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH V1] spi: tegra114: set master cleanup and also invoke it on probe error
@ 2019-05-23  1:29 Sowjanya Komatineni
  2019-05-23 13:49 ` Applied "spi: tegra114: set master cleanup and also invoke it on probe error" to the spi tree Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Sowjanya Komatineni @ 2019-05-23  1:29 UTC (permalink / raw)
  To: thierry.reding, jonathanh, ldewangan, broonie, natechancellor
  Cc: linux-tegra, linux-kernel, linux-spi, Sowjanya Komatineni

This patch sets master cleanup and also invokes tegra spi clean on
tegra spi probe failure to release tegra spi client data.

Signed-off-by: Sowjanya Komatineni <skomatineni@nvidia.com>
---
 drivers/spi/spi-tegra114.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/spi/spi-tegra114.c b/drivers/spi/spi-tegra114.c
index 253a7f182fc9..15f9368fc0f8 100644
--- a/drivers/spi/spi-tegra114.c
+++ b/drivers/spi/spi-tegra114.c
@@ -966,6 +966,8 @@ static int tegra_spi_setup(struct spi_device *spi)
 	ret = pm_runtime_get_sync(tspi->dev);
 	if (ret < 0) {
 		dev_err(tspi->dev, "pm runtime failed, e = %d\n", ret);
+		if (cdata)
+			tegra_spi_cleanup(spi);
 		return ret;
 	}
 
@@ -1331,6 +1333,7 @@ static int tegra_spi_probe(struct platform_device *pdev)
 			    SPI_TX_DUAL | SPI_RX_DUAL | SPI_3WIRE;
 	master->bits_per_word_mask = SPI_BPW_RANGE_MASK(4, 32);
 	master->setup = tegra_spi_setup;
+	master->cleanup = tegra_spi_cleanup;
 	master->transfer_one_message = tegra_spi_transfer_one_message;
 	master->set_cs_timing = tegra_spi_set_hw_cs_timing;
 	master->num_chipselect = MAX_CHIP_SELECT;
-- 
2.7.4


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

end of thread, other threads:[~2019-05-23 13:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-23  1:29 [PATCH V1] spi: tegra114: set master cleanup and also invoke it on probe error Sowjanya Komatineni
2019-05-23 13:49 ` Applied "spi: tegra114: set master cleanup and also invoke it on probe error" to the spi tree Mark Brown

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).