aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/spi/spi-dw.c
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@ingics.com>2014-03-25 00:44:13 -0400
committerMark Brown <broonie@linaro.org>2014-03-28 07:48:55 -0400
commitc63f5da00845143de621e991ea186be0829647ee (patch)
tree6f5095de47a8364eb5e2b27093746f28fe503bef /drivers/spi/spi-dw.c
parent765ee709eb40abf0c43c6d864ac6f01677b7fd5a (diff)
spi: dw: Don't call kfree for memory allocated by devm_kzalloc
With devm_kzalloc, the memory is automatically freed when spi_device detach from the bus. Fixes: commit 43f627ac9de42 (spi: dw: fix memory leak on error path) Signed-off-by: Axel Lin <axel.lin@ingics.com> Acked-by: Baruch Siach <baruch@tkos.co.il> Signed-off-by: Mark Brown <broonie@linaro.org> Cc: stabe@vger.kernel.org
Diffstat (limited to 'drivers/spi/spi-dw.c')
-rw-r--r--drivers/spi/spi-dw.c7
1 files changed, 0 insertions, 7 deletions
diff --git a/drivers/spi/spi-dw.c b/drivers/spi/spi-dw.c
index 9e4a0aa7d341..79fd1fa95bf2 100644
--- a/drivers/spi/spi-dw.c
+++ b/drivers/spi/spi-dw.c
@@ -665,12 +665,6 @@ static int dw_spi_setup(struct spi_device *spi)
665 return 0; 665 return 0;
666} 666}
667 667
668static void dw_spi_cleanup(struct spi_device *spi)
669{
670 struct chip_data *chip = spi_get_ctldata(spi);
671 kfree(chip);
672}
673
674static int init_queue(struct dw_spi *dws) 668static int init_queue(struct dw_spi *dws)
675{ 669{
676 INIT_LIST_HEAD(&dws->queue); 670 INIT_LIST_HEAD(&dws->queue);
@@ -800,7 +794,6 @@ int dw_spi_add_host(struct device *dev, struct dw_spi *dws)
800 master->bits_per_word_mask = SPI_BPW_MASK(8) | SPI_BPW_MASK(16); 794 master->bits_per_word_mask = SPI_BPW_MASK(8) | SPI_BPW_MASK(16);
801 master->bus_num = dws->bus_num; 795 master->bus_num = dws->bus_num;
802 master->num_chipselect = dws->num_cs; 796 master->num_chipselect = dws->num_cs;
803 master->cleanup = dw_spi_cleanup;
804 master->setup = dw_spi_setup; 797 master->setup = dw_spi_setup;
805 master->transfer = dw_spi_transfer; 798 master->transfer = dw_spi_transfer;
806 master->max_speed_hz = dws->max_freq; 799 master->max_speed_hz = dws->max_freq;