diff options
Diffstat (limited to 'drivers/spi')
-rw-r--r-- | drivers/spi/spi-s3c24xx.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/drivers/spi/spi-s3c24xx.c b/drivers/spi/spi-s3c24xx.c index bed23384dfab..6db14e53af17 100644 --- a/drivers/spi/spi-s3c24xx.c +++ b/drivers/spi/spi-s3c24xx.c | |||
@@ -183,7 +183,9 @@ static int s3c24xx_spi_setup(struct spi_device *spi) | |||
183 | 183 | ||
184 | /* allocate settings on the first call */ | 184 | /* allocate settings on the first call */ |
185 | if (!cs) { | 185 | if (!cs) { |
186 | cs = kzalloc(sizeof(struct s3c24xx_spi_devstate), GFP_KERNEL); | 186 | cs = devm_kzalloc(&spi->dev, |
187 | sizeof(struct s3c24xx_spi_devstate), | ||
188 | GFP_KERNEL); | ||
187 | if (!cs) { | 189 | if (!cs) { |
188 | dev_err(&spi->dev, "no memory for controller state\n"); | 190 | dev_err(&spi->dev, "no memory for controller state\n"); |
189 | return -ENOMEM; | 191 | return -ENOMEM; |
@@ -209,11 +211,6 @@ static int s3c24xx_spi_setup(struct spi_device *spi) | |||
209 | return 0; | 211 | return 0; |
210 | } | 212 | } |
211 | 213 | ||
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) | 214 | static inline unsigned int hw_txbyte(struct s3c24xx_spi *hw, int count) |
218 | { | 215 | { |
219 | return hw->tx ? hw->tx[count] : 0; | 216 | return hw->tx ? hw->tx[count] : 0; |
@@ -543,7 +540,6 @@ static int s3c24xx_spi_probe(struct platform_device *pdev) | |||
543 | hw->bitbang.txrx_bufs = s3c24xx_spi_txrx; | 540 | hw->bitbang.txrx_bufs = s3c24xx_spi_txrx; |
544 | 541 | ||
545 | hw->master->setup = s3c24xx_spi_setup; | 542 | hw->master->setup = s3c24xx_spi_setup; |
546 | hw->master->cleanup = s3c24xx_spi_cleanup; | ||
547 | 543 | ||
548 | dev_dbg(hw->dev, "bitbang at %p\n", &hw->bitbang); | 544 | dev_dbg(hw->dev, "bitbang at %p\n", &hw->bitbang); |
549 | 545 | ||