summaryrefslogtreecommitdiffstats
path: root/drivers/spi
diff options
context:
space:
mode:
authorSowjanya Komatineni <skomatineni@nvidia.com>2019-05-22 18:29:04 -0700
committerMark Brown <broonie@kernel.org>2019-05-23 14:39:46 +0100
commit0e896f380b845d3fb889f27eb6026cd494bb3cd8 (patch)
treeeb0f35e58c024f14829cbb76a138d23960201d55 /drivers/spi
parentcc0f6e96c4fd01fe1f935014c8c87ac6e994324c (diff)
downloadblackbird-op-linux-0e896f380b845d3fb889f27eb6026cd494bb3cd8.tar.gz
blackbird-op-linux-0e896f380b845d3fb889f27eb6026cd494bb3cd8.zip
spi: tegra114: set master cleanup and also invoke it on probe error
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> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/spi')
-rw-r--r--drivers/spi/spi-tegra114.c3
1 files changed, 3 insertions, 0 deletions
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;
OpenPOWER on IntegriCloud