diff options
Diffstat (limited to 'drivers/spi/spi-s3c24xx.c')
-rw-r--r-- | drivers/spi/spi-s3c24xx.c | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/drivers/spi/spi-s3c24xx.c b/drivers/spi/spi-s3c24xx.c index bed23384dfab..e713737d784f 100644 --- a/drivers/spi/spi-s3c24xx.c +++ b/drivers/spi/spi-s3c24xx.c | |||
@@ -10,7 +10,6 @@ | |||
10 | */ | 10 | */ |
11 | 11 | ||
12 | #include <linux/spinlock.h> | 12 | #include <linux/spinlock.h> |
13 | #include <linux/workqueue.h> | ||
14 | #include <linux/interrupt.h> | 13 | #include <linux/interrupt.h> |
15 | #include <linux/delay.h> | 14 | #include <linux/delay.h> |
16 | #include <linux/errno.h> | 15 | #include <linux/errno.h> |
@@ -183,11 +182,11 @@ static int s3c24xx_spi_setup(struct spi_device *spi) | |||
183 | 182 | ||
184 | /* allocate settings on the first call */ | 183 | /* allocate settings on the first call */ |
185 | if (!cs) { | 184 | if (!cs) { |
186 | cs = kzalloc(sizeof(struct s3c24xx_spi_devstate), GFP_KERNEL); | 185 | cs = devm_kzalloc(&spi->dev, |
187 | if (!cs) { | 186 | sizeof(struct s3c24xx_spi_devstate), |
188 | dev_err(&spi->dev, "no memory for controller state\n"); | 187 | GFP_KERNEL); |
188 | if (!cs) | ||
189 | return -ENOMEM; | 189 | return -ENOMEM; |
190 | } | ||
191 | 190 | ||
192 | cs->spcon = SPCON_DEFAULT; | 191 | cs->spcon = SPCON_DEFAULT; |
193 | cs->hz = -1; | 192 | cs->hz = -1; |
@@ -209,11 +208,6 @@ static int s3c24xx_spi_setup(struct spi_device *spi) | |||
209 | return 0; | 208 | return 0; |
210 | } | 209 | } |
211 | 210 | ||
212 | static void s3c24xx_spi_cleanup(struct spi_device *spi) | ||
213 | { | ||
214 | kfree(spi->controller_state); | ||
215 | } | ||
216 | |||
217 | static inline unsigned int hw_txbyte(struct s3c24xx_spi *hw, int count) | 211 | static inline unsigned int hw_txbyte(struct s3c24xx_spi *hw, int count) |
218 | { | 212 | { |
219 | return hw->tx ? hw->tx[count] : 0; | 213 | return hw->tx ? hw->tx[count] : 0; |
@@ -543,7 +537,6 @@ static int s3c24xx_spi_probe(struct platform_device *pdev) | |||
543 | hw->bitbang.txrx_bufs = s3c24xx_spi_txrx; | 537 | hw->bitbang.txrx_bufs = s3c24xx_spi_txrx; |
544 | 538 | ||
545 | hw->master->setup = s3c24xx_spi_setup; | 539 | hw->master->setup = s3c24xx_spi_setup; |
546 | hw->master->cleanup = s3c24xx_spi_cleanup; | ||
547 | 540 | ||
548 | dev_dbg(hw->dev, "bitbang at %p\n", &hw->bitbang); | 541 | dev_dbg(hw->dev, "bitbang at %p\n", &hw->bitbang); |
549 | 542 | ||