aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/spi
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/spi')
-rw-r--r--drivers/spi/Kconfig2
-rw-r--r--drivers/spi/spi-fsl-espi.c3
-rw-r--r--drivers/spi/spi-fsl-spi.c3
-rw-r--r--drivers/spi/spi-mpc512x-psc.c3
-rw-r--r--drivers/spi/spi-mpc52xx-psc.c3
-rw-r--r--drivers/spi/spi-mpc52xx.c6
-rw-r--r--drivers/spi/spi-omap2-mcspi.c26
-rw-r--r--drivers/spi/spi-sh.c6
-rw-r--r--drivers/spi/spi-txx9.c3
9 files changed, 28 insertions, 27 deletions
diff --git a/drivers/spi/Kconfig b/drivers/spi/Kconfig
index efe1960af2b3..60f2b41c7310 100644
--- a/drivers/spi/Kconfig
+++ b/drivers/spi/Kconfig
@@ -383,7 +383,7 @@ config SPI_RSPI
383 383
384config SPI_QUP 384config SPI_QUP
385 tristate "Qualcomm SPI controller with QUP interface" 385 tristate "Qualcomm SPI controller with QUP interface"
386 depends on ARCH_MSM_DT || (ARM && COMPILE_TEST) 386 depends on ARCH_QCOM || (ARM && COMPILE_TEST)
387 help 387 help
388 Qualcomm Universal Peripheral (QUP) core is an AHB slave that 388 Qualcomm Universal Peripheral (QUP) core is an AHB slave that
389 provides a common data path (an output FIFO and an input FIFO) 389 provides a common data path (an output FIFO and an input FIFO)
diff --git a/drivers/spi/spi-fsl-espi.c b/drivers/spi/spi-fsl-espi.c
index 6fb2b75df821..e767f5831b9c 100644
--- a/drivers/spi/spi-fsl-espi.c
+++ b/drivers/spi/spi-fsl-espi.c
@@ -441,7 +441,8 @@ static void fsl_espi_do_one_msg(struct spi_message *m)
441 441
442 m->actual_length = espi_trans.actual_length; 442 m->actual_length = espi_trans.actual_length;
443 m->status = espi_trans.status; 443 m->status = espi_trans.status;
444 m->complete(m->context); 444 if (m->complete)
445 m->complete(m->context);
445} 446}
446 447
447static int fsl_espi_setup(struct spi_device *spi) 448static int fsl_espi_setup(struct spi_device *spi)
diff --git a/drivers/spi/spi-fsl-spi.c b/drivers/spi/spi-fsl-spi.c
index f35488ed62a9..b3e7775034db 100644
--- a/drivers/spi/spi-fsl-spi.c
+++ b/drivers/spi/spi-fsl-spi.c
@@ -408,7 +408,8 @@ static void fsl_spi_do_one_msg(struct spi_message *m)
408 } 408 }
409 409
410 m->status = status; 410 m->status = status;
411 m->complete(m->context); 411 if (m->complete)
412 m->complete(m->context);
412 413
413 if (status || !cs_change) { 414 if (status || !cs_change) {
414 ndelay(nsecs); 415 ndelay(nsecs);
diff --git a/drivers/spi/spi-mpc512x-psc.c b/drivers/spi/spi-mpc512x-psc.c
index 3822eef2ef9d..577d23a12763 100644
--- a/drivers/spi/spi-mpc512x-psc.c
+++ b/drivers/spi/spi-mpc512x-psc.c
@@ -300,7 +300,8 @@ static int mpc512x_psc_spi_msg_xfer(struct spi_master *master,
300 } 300 }
301 301
302 m->status = status; 302 m->status = status;
303 m->complete(m->context); 303 if (m->complete)
304 m->complete(m->context);
304 305
305 if (status || !cs_change) 306 if (status || !cs_change)
306 mpc512x_psc_spi_deactivate_cs(spi); 307 mpc512x_psc_spi_deactivate_cs(spi);
diff --git a/drivers/spi/spi-mpc52xx-psc.c b/drivers/spi/spi-mpc52xx-psc.c
index 3d18d9351185..de532aa11d34 100644
--- a/drivers/spi/spi-mpc52xx-psc.c
+++ b/drivers/spi/spi-mpc52xx-psc.c
@@ -247,7 +247,8 @@ static void mpc52xx_psc_spi_work(struct work_struct *work)
247 } 247 }
248 248
249 m->status = status; 249 m->status = status;
250 m->complete(m->context); 250 if (m->complete)
251 m->complete(m->context);
251 252
252 if (status || !cs_change) 253 if (status || !cs_change)
253 mpc52xx_psc_spi_deactivate_cs(spi); 254 mpc52xx_psc_spi_deactivate_cs(spi);
diff --git a/drivers/spi/spi-mpc52xx.c b/drivers/spi/spi-mpc52xx.c
index aac2a5ddd964..b07db4b62d80 100644
--- a/drivers/spi/spi-mpc52xx.c
+++ b/drivers/spi/spi-mpc52xx.c
@@ -234,7 +234,8 @@ static int mpc52xx_spi_fsmstate_transfer(int irq, struct mpc52xx_spi *ms,
234 dev_err(&ms->master->dev, "mode fault\n"); 234 dev_err(&ms->master->dev, "mode fault\n");
235 mpc52xx_spi_chipsel(ms, 0); 235 mpc52xx_spi_chipsel(ms, 0);
236 ms->message->status = -EIO; 236 ms->message->status = -EIO;
237 ms->message->complete(ms->message->context); 237 if (ms->message->complete)
238 ms->message->complete(ms->message->context);
238 ms->state = mpc52xx_spi_fsmstate_idle; 239 ms->state = mpc52xx_spi_fsmstate_idle;
239 return FSM_CONTINUE; 240 return FSM_CONTINUE;
240 } 241 }
@@ -288,7 +289,8 @@ mpc52xx_spi_fsmstate_wait(int irq, struct mpc52xx_spi *ms, u8 status, u8 data)
288 ms->msg_count++; 289 ms->msg_count++;
289 mpc52xx_spi_chipsel(ms, 0); 290 mpc52xx_spi_chipsel(ms, 0);
290 ms->message->status = 0; 291 ms->message->status = 0;
291 ms->message->complete(ms->message->context); 292 if (ms->message->complete)
293 ms->message->complete(ms->message->context);
292 ms->state = mpc52xx_spi_fsmstate_idle; 294 ms->state = mpc52xx_spi_fsmstate_idle;
293 return FSM_CONTINUE; 295 return FSM_CONTINUE;
294 } 296 }
diff --git a/drivers/spi/spi-omap2-mcspi.c b/drivers/spi/spi-omap2-mcspi.c
index 2941c5b96ebc..4dc77df38864 100644
--- a/drivers/spi/spi-omap2-mcspi.c
+++ b/drivers/spi/spi-omap2-mcspi.c
@@ -1379,12 +1379,13 @@ static int omap2_mcspi_probe(struct platform_device *pdev)
1379 1379
1380 INIT_LIST_HEAD(&mcspi->ctx.cs); 1380 INIT_LIST_HEAD(&mcspi->ctx.cs);
1381 1381
1382 mcspi->dma_channels = kcalloc(master->num_chipselect, 1382 mcspi->dma_channels = devm_kcalloc(&pdev->dev, master->num_chipselect,
1383 sizeof(struct omap2_mcspi_dma), 1383 sizeof(struct omap2_mcspi_dma),
1384 GFP_KERNEL); 1384 GFP_KERNEL);
1385 1385 if (mcspi->dma_channels == NULL) {
1386 if (mcspi->dma_channels == NULL) 1386 status = -ENOMEM;
1387 goto free_master; 1387 goto free_master;
1388 }
1388 1389
1389 for (i = 0; i < master->num_chipselect; i++) { 1390 for (i = 0; i < master->num_chipselect; i++) {
1390 char *dma_rx_ch_name = mcspi->dma_channels[i].dma_rx_ch_name; 1391 char *dma_rx_ch_name = mcspi->dma_channels[i].dma_rx_ch_name;
@@ -1426,7 +1427,7 @@ static int omap2_mcspi_probe(struct platform_device *pdev)
1426 } 1427 }
1427 1428
1428 if (status < 0) 1429 if (status < 0)
1429 goto dma_chnl_free; 1430 goto free_master;
1430 1431
1431 pm_runtime_use_autosuspend(&pdev->dev); 1432 pm_runtime_use_autosuspend(&pdev->dev);
1432 pm_runtime_set_autosuspend_delay(&pdev->dev, SPI_AUTOSUSPEND_TIMEOUT); 1433 pm_runtime_set_autosuspend_delay(&pdev->dev, SPI_AUTOSUSPEND_TIMEOUT);
@@ -1444,8 +1445,6 @@ static int omap2_mcspi_probe(struct platform_device *pdev)
1444 1445
1445disable_pm: 1446disable_pm:
1446 pm_runtime_disable(&pdev->dev); 1447 pm_runtime_disable(&pdev->dev);
1447dma_chnl_free:
1448 kfree(mcspi->dma_channels);
1449free_master: 1448free_master:
1450 spi_master_put(master); 1449 spi_master_put(master);
1451 return status; 1450 return status;
@@ -1453,19 +1452,12 @@ free_master:
1453 1452
1454static int omap2_mcspi_remove(struct platform_device *pdev) 1453static int omap2_mcspi_remove(struct platform_device *pdev)
1455{ 1454{
1456 struct spi_master *master; 1455 struct spi_master *master = platform_get_drvdata(pdev);
1457 struct omap2_mcspi *mcspi; 1456 struct omap2_mcspi *mcspi = spi_master_get_devdata(master);
1458 struct omap2_mcspi_dma *dma_channels;
1459
1460 master = platform_get_drvdata(pdev);
1461 mcspi = spi_master_get_devdata(master);
1462 dma_channels = mcspi->dma_channels;
1463 1457
1464 pm_runtime_put_sync(mcspi->dev); 1458 pm_runtime_put_sync(mcspi->dev);
1465 pm_runtime_disable(&pdev->dev); 1459 pm_runtime_disable(&pdev->dev);
1466 1460
1467 kfree(dma_channels);
1468
1469 return 0; 1461 return 0;
1470} 1462}
1471 1463
diff --git a/drivers/spi/spi-sh.c b/drivers/spi/spi-sh.c
index f6f2c7010177..03edf5ed0e9f 100644
--- a/drivers/spi/spi-sh.c
+++ b/drivers/spi/spi-sh.c
@@ -322,7 +322,8 @@ static void spi_sh_work(struct work_struct *work)
322 spin_lock_irqsave(&ss->lock, flags); 322 spin_lock_irqsave(&ss->lock, flags);
323 323
324 mesg->status = 0; 324 mesg->status = 0;
325 mesg->complete(mesg->context); 325 if (mesg->complete)
326 mesg->complete(mesg->context);
326 } 327 }
327 328
328 clear_fifo(ss); 329 clear_fifo(ss);
@@ -340,7 +341,8 @@ static void spi_sh_work(struct work_struct *work)
340 341
341 error: 342 error:
342 mesg->status = ret; 343 mesg->status = ret;
343 mesg->complete(mesg->context); 344 if (mesg->complete)
345 mesg->complete(mesg->context);
344 346
345 spi_sh_clear_bit(ss, SPI_SH_SSA | SPI_SH_SSDB | SPI_SH_SSD, 347 spi_sh_clear_bit(ss, SPI_SH_SSA | SPI_SH_SSDB | SPI_SH_SSD,
346 SPI_SH_CR1); 348 SPI_SH_CR1);
diff --git a/drivers/spi/spi-txx9.c b/drivers/spi/spi-txx9.c
index 820b499816f8..5f183baa91a9 100644
--- a/drivers/spi/spi-txx9.c
+++ b/drivers/spi/spi-txx9.c
@@ -262,7 +262,8 @@ static void txx9spi_work_one(struct txx9spi *c, struct spi_message *m)
262 262
263exit: 263exit:
264 m->status = status; 264 m->status = status;
265 m->complete(m->context); 265 if (m->complete)
266 m->complete(m->context);
266 267
267 /* normally deactivate chipselect ... unless no error and 268 /* normally deactivate chipselect ... unless no error and
268 * cs_change has hinted that the next message will probably 269 * cs_change has hinted that the next message will probably