aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/spi/spi-s3c24xx.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/spi/spi-s3c24xx.c')
-rw-r--r--drivers/spi/spi-s3c24xx.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/drivers/spi/spi-s3c24xx.c b/drivers/spi/spi-s3c24xx.c
index bed23384dfab..381d4af149fc 100644
--- a/drivers/spi/spi-s3c24xx.c
+++ b/drivers/spi/spi-s3c24xx.c
@@ -183,11 +183,11 @@ 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 if (!cs) { 187 sizeof(struct s3c24xx_spi_devstate),
188 dev_err(&spi->dev, "no memory for controller state\n"); 188 GFP_KERNEL);
189 if (!cs)
189 return -ENOMEM; 190 return -ENOMEM;
190 }
191 191
192 cs->spcon = SPCON_DEFAULT; 192 cs->spcon = SPCON_DEFAULT;
193 cs->hz = -1; 193 cs->hz = -1;
@@ -209,11 +209,6 @@ static int s3c24xx_spi_setup(struct spi_device *spi)
209 return 0; 209 return 0;
210} 210}
211 211
212static void s3c24xx_spi_cleanup(struct spi_device *spi)
213{
214 kfree(spi->controller_state);
215}
216
217static inline unsigned int hw_txbyte(struct s3c24xx_spi *hw, int count) 212static inline unsigned int hw_txbyte(struct s3c24xx_spi *hw, int count)
218{ 213{
219 return hw->tx ? hw->tx[count] : 0; 214 return hw->tx ? hw->tx[count] : 0;
@@ -543,7 +538,6 @@ static int s3c24xx_spi_probe(struct platform_device *pdev)
543 hw->bitbang.txrx_bufs = s3c24xx_spi_txrx; 538 hw->bitbang.txrx_bufs = s3c24xx_spi_txrx;
544 539
545 hw->master->setup = s3c24xx_spi_setup; 540 hw->master->setup = s3c24xx_spi_setup;
546 hw->master->cleanup = s3c24xx_spi_cleanup;
547 541
548 dev_dbg(hw->dev, "bitbang at %p\n", &hw->bitbang); 542 dev_dbg(hw->dev, "bitbang at %p\n", &hw->bitbang);
549 543