diff options
author | Axel Lin | 2014-03-30 10:43:23 +0200 |
---|---|---|
committer | Mark Brown | 2014-04-14 18:18:55 +0200 |
commit | abcadeb255074d1351d110ef696b647859fa3d5b (patch) | |
tree | 9324e03772f0f65e838764d6bd91b517f4e0b38b /drivers/spi/spi-fsl-lib.c | |
parent | Linux 3.15-rc1 (diff) | |
download | kernel-qcow2-linux-abcadeb255074d1351d110ef696b647859fa3d5b.tar.gz kernel-qcow2-linux-abcadeb255074d1351d110ef696b647859fa3d5b.tar.xz kernel-qcow2-linux-abcadeb255074d1351d110ef696b647859fa3d5b.zip |
spi: fsl: Kill mpc8xxx_spi_cleanup and convert fsl_espi_setup to use devm_kzalloc
In current code, master->cleanup and master->setup are not set in the same
function. This makes it hard to read and not good for code maintain.
One example is in fsl-spi.c, master->cleanup is overrided in mpc8xxx_spi_probe()
which leads to a memory leak.
This patch removes mpc8xxx_spi_cleanup() and converts fsl_espi_setup to use
devm_kzalloc so we don't need to take care of freeing memory.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'drivers/spi/spi-fsl-lib.c')
-rw-r--r-- | drivers/spi/spi-fsl-lib.c | 6 |
1 files changed, 0 insertions, 6 deletions
diff --git a/drivers/spi/spi-fsl-lib.c b/drivers/spi/spi-fsl-lib.c index e5d45fca3551..95212ea96c8d 100644 --- a/drivers/spi/spi-fsl-lib.c +++ b/drivers/spi/spi-fsl-lib.c @@ -99,11 +99,6 @@ int mpc8xxx_spi_transfer(struct spi_device *spi, return 0; } -void mpc8xxx_spi_cleanup(struct spi_device *spi) -{ - kfree(spi->controller_state); -} - const char *mpc8xxx_spi_strmode(unsigned int flags) { if (flags & SPI_QE_CPU_MODE) { @@ -134,7 +129,6 @@ int mpc8xxx_spi_probe(struct device *dev, struct resource *mem, | SPI_LSB_FIRST | SPI_LOOP; master->transfer = mpc8xxx_spi_transfer; - master->cleanup = mpc8xxx_spi_cleanup; master->dev.of_node = dev->of_node; mpc8xxx_spi = spi_master_get_devdata(master); |