]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/spi/spi-s3c24xx.c
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux...
[karo-tx-linux.git] / drivers / spi / spi-s3c24xx.c
index bed23384dfab5858f91c612f352df3a7af7b4aed..e713737d784fa0291b8cd92b61eb76c8d2ac3f4a 100644 (file)
@@ -10,7 +10,6 @@
 */
 
 #include <linux/spinlock.h>
-#include <linux/workqueue.h>
 #include <linux/interrupt.h>
 #include <linux/delay.h>
 #include <linux/errno.h>
@@ -183,11 +182,11 @@ static int s3c24xx_spi_setup(struct spi_device *spi)
 
        /* allocate settings on the first call */
        if (!cs) {
-               cs = kzalloc(sizeof(struct s3c24xx_spi_devstate), GFP_KERNEL);
-               if (!cs) {
-                       dev_err(&spi->dev, "no memory for controller state\n");
+               cs = devm_kzalloc(&spi->dev,
+                                 sizeof(struct s3c24xx_spi_devstate),
+                                 GFP_KERNEL);
+               if (!cs)
                        return -ENOMEM;
-               }
 
                cs->spcon = SPCON_DEFAULT;
                cs->hz = -1;
@@ -209,11 +208,6 @@ static int s3c24xx_spi_setup(struct spi_device *spi)
        return 0;
 }
 
-static void s3c24xx_spi_cleanup(struct spi_device *spi)
-{
-       kfree(spi->controller_state);
-}
-
 static inline unsigned int hw_txbyte(struct s3c24xx_spi *hw, int count)
 {
        return hw->tx ? hw->tx[count] : 0;
@@ -543,7 +537,6 @@ static int s3c24xx_spi_probe(struct platform_device *pdev)
        hw->bitbang.txrx_bufs      = s3c24xx_spi_txrx;
 
        hw->master->setup  = s3c24xx_spi_setup;
-       hw->master->cleanup = s3c24xx_spi_cleanup;
 
        dev_dbg(hw->dev, "bitbang at %p\n", &hw->bitbang);