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>
This commit is contained in:
@@ -124,7 +124,6 @@ extern struct mpc8xxx_spi_probe_info *to_of_pinfo(
|
||||
extern int mpc8xxx_spi_bufs(struct mpc8xxx_spi *mspi,
|
||||
struct spi_transfer *t, unsigned int len);
|
||||
extern int mpc8xxx_spi_transfer(struct spi_device *spi, struct spi_message *m);
|
||||
extern void mpc8xxx_spi_cleanup(struct spi_device *spi);
|
||||
extern const char *mpc8xxx_spi_strmode(unsigned int flags);
|
||||
extern int mpc8xxx_spi_probe(struct device *dev, struct resource *mem,
|
||||
unsigned int irq);
|
||||
|
Reference in New Issue
Block a user