spi: fsl: Kill mpc8xxx_spi_cleanup and convert fsl_espi_setup to use devm_kzalloc
authorAxel Lin <axel.lin@ingics.com>
Sun, 30 Mar 2014 08:43:23 +0000 (16:43 +0800)
committerMark Brown <broonie@linaro.org>
Mon, 14 Apr 2014 16:18:55 +0000 (17:18 +0100)
commitabcadeb255074d1351d110ef696b647859fa3d5b
tree9324e03772f0f65e838764d6bd91b517f4e0b38b
parentc9eaa447e77efe77b7fa4c953bd62de8297fd6c5
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>
drivers/spi/spi-fsl-espi.c
drivers/spi/spi-fsl-lib.c
drivers/spi/spi-fsl-lib.h