aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-08-20 16:05:27 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-08-20 16:05:27 -0400
commit8a6b52140fc41fc5ed7251556035a069486979ab (patch)
tree0629ed347e012158002964de7dfbaa34e0d23d32
parentfd4d3328b28354475234275eefdd3125c6a54ed7 (diff)
parentaf36107968f1b5faab0e4a0cc44fa4498c63f017 (diff)
Merge tag 'spi-3.6' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/misc
Pull spi fixes from Mark Brown: "Grant is still away so another pull request with some fairly minor fixes, the most notable of which are several fixes for some common error patterns with the reference counting spi_master_get/put do." * tag 'spi-3.6' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/misc: spi/coldfire-qspi: Drop extra calls to spi_master_get in suspend/resume functions spi: spi-coldfire-qspi: Drop extra spi_master_put in device remove function spi/pl022: fix spi-pl022 pm enable at probe spi/bcm63xx: Ensure that memory is freed only after it is no longer used spi: omap2-mcspi: Fix the error handling in probe spi/s3c64xx: Add missing static storage class specifiers
-rw-r--r--drivers/spi/spi-bcm63xx.c4
-rw-r--r--drivers/spi/spi-coldfire-qspi.c5
-rw-r--r--drivers/spi/spi-omap2-mcspi.c6
-rw-r--r--drivers/spi/spi-pl022.c1
-rw-r--r--drivers/spi/spi-s3c64xx.c12
5 files changed, 13 insertions, 15 deletions
diff --git a/drivers/spi/spi-bcm63xx.c b/drivers/spi/spi-bcm63xx.c
index 6e25ef1bce91..ea0aaa3f13d0 100644
--- a/drivers/spi/spi-bcm63xx.c
+++ b/drivers/spi/spi-bcm63xx.c
@@ -438,7 +438,7 @@ out:
438 438
439static int __devexit bcm63xx_spi_remove(struct platform_device *pdev) 439static int __devexit bcm63xx_spi_remove(struct platform_device *pdev)
440{ 440{
441 struct spi_master *master = platform_get_drvdata(pdev); 441 struct spi_master *master = spi_master_get(platform_get_drvdata(pdev));
442 struct bcm63xx_spi *bs = spi_master_get_devdata(master); 442 struct bcm63xx_spi *bs = spi_master_get_devdata(master);
443 443
444 spi_unregister_master(master); 444 spi_unregister_master(master);
@@ -452,6 +452,8 @@ static int __devexit bcm63xx_spi_remove(struct platform_device *pdev)
452 452
453 platform_set_drvdata(pdev, 0); 453 platform_set_drvdata(pdev, 0);
454 454
455 spi_master_put(master);
456
455 return 0; 457 return 0;
456} 458}
457 459
diff --git a/drivers/spi/spi-coldfire-qspi.c b/drivers/spi/spi-coldfire-qspi.c
index b2d4b9e4e010..764bfee75920 100644
--- a/drivers/spi/spi-coldfire-qspi.c
+++ b/drivers/spi/spi-coldfire-qspi.c
@@ -533,7 +533,6 @@ static int __devexit mcfqspi_remove(struct platform_device *pdev)
533 iounmap(mcfqspi->iobase); 533 iounmap(mcfqspi->iobase);
534 release_mem_region(res->start, resource_size(res)); 534 release_mem_region(res->start, resource_size(res));
535 spi_unregister_master(master); 535 spi_unregister_master(master);
536 spi_master_put(master);
537 536
538 return 0; 537 return 0;
539} 538}
@@ -541,7 +540,7 @@ static int __devexit mcfqspi_remove(struct platform_device *pdev)
541#ifdef CONFIG_PM_SLEEP 540#ifdef CONFIG_PM_SLEEP
542static int mcfqspi_suspend(struct device *dev) 541static int mcfqspi_suspend(struct device *dev)
543{ 542{
544 struct spi_master *master = spi_master_get(dev_get_drvdata(dev)); 543 struct spi_master *master = dev_get_drvdata(dev);
545 struct mcfqspi *mcfqspi = spi_master_get_devdata(master); 544 struct mcfqspi *mcfqspi = spi_master_get_devdata(master);
546 545
547 spi_master_suspend(master); 546 spi_master_suspend(master);
@@ -553,7 +552,7 @@ static int mcfqspi_suspend(struct device *dev)
553 552
554static int mcfqspi_resume(struct device *dev) 553static int mcfqspi_resume(struct device *dev)
555{ 554{
556 struct spi_master *master = spi_master_get(dev_get_drvdata(dev)); 555 struct spi_master *master = dev_get_drvdata(dev);
557 struct mcfqspi *mcfqspi = spi_master_get_devdata(master); 556 struct mcfqspi *mcfqspi = spi_master_get_devdata(master);
558 557
559 spi_master_resume(master); 558 spi_master_resume(master);
diff --git a/drivers/spi/spi-omap2-mcspi.c b/drivers/spi/spi-omap2-mcspi.c
index bc4778175e34..b2fb141da375 100644
--- a/drivers/spi/spi-omap2-mcspi.c
+++ b/drivers/spi/spi-omap2-mcspi.c
@@ -1228,18 +1228,16 @@ static int __devinit omap2_mcspi_probe(struct platform_device *pdev)
1228 1228
1229 status = spi_register_master(master); 1229 status = spi_register_master(master);
1230 if (status < 0) 1230 if (status < 0)
1231 goto err_spi_register; 1231 goto disable_pm;
1232 1232
1233 return status; 1233 return status;
1234 1234
1235err_spi_register:
1236 spi_master_put(master);
1237disable_pm: 1235disable_pm:
1238 pm_runtime_disable(&pdev->dev); 1236 pm_runtime_disable(&pdev->dev);
1239dma_chnl_free: 1237dma_chnl_free:
1240 kfree(mcspi->dma_channels); 1238 kfree(mcspi->dma_channels);
1241free_master: 1239free_master:
1242 kfree(master); 1240 spi_master_put(master);
1243 platform_set_drvdata(pdev, NULL); 1241 platform_set_drvdata(pdev, NULL);
1244 return status; 1242 return status;
1245} 1243}
diff --git a/drivers/spi/spi-pl022.c b/drivers/spi/spi-pl022.c
index aab518ec2bbc..6abbe23c39b4 100644
--- a/drivers/spi/spi-pl022.c
+++ b/drivers/spi/spi-pl022.c
@@ -2053,7 +2053,6 @@ pl022_probe(struct amba_device *adev, const struct amba_id *id)
2053 printk(KERN_INFO "pl022: mapped registers from 0x%08x to %p\n", 2053 printk(KERN_INFO "pl022: mapped registers from 0x%08x to %p\n",
2054 adev->res.start, pl022->virtbase); 2054 adev->res.start, pl022->virtbase);
2055 2055
2056 pm_runtime_enable(dev);
2057 pm_runtime_resume(dev); 2056 pm_runtime_resume(dev);
2058 2057
2059 pl022->clk = clk_get(&adev->dev, NULL); 2058 pl022->clk = clk_get(&adev->dev, NULL);
diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c
index cfa2c35dfeed..d1c8441f638c 100644
--- a/drivers/spi/spi-s3c64xx.c
+++ b/drivers/spi/spi-s3c64xx.c
@@ -1479,40 +1479,40 @@ static const struct dev_pm_ops s3c64xx_spi_pm = {
1479 s3c64xx_spi_runtime_resume, NULL) 1479 s3c64xx_spi_runtime_resume, NULL)
1480}; 1480};
1481 1481
1482struct s3c64xx_spi_port_config s3c2443_spi_port_config = { 1482static struct s3c64xx_spi_port_config s3c2443_spi_port_config = {
1483 .fifo_lvl_mask = { 0x7f }, 1483 .fifo_lvl_mask = { 0x7f },
1484 .rx_lvl_offset = 13, 1484 .rx_lvl_offset = 13,
1485 .tx_st_done = 21, 1485 .tx_st_done = 21,
1486 .high_speed = true, 1486 .high_speed = true,
1487}; 1487};
1488 1488
1489struct s3c64xx_spi_port_config s3c6410_spi_port_config = { 1489static struct s3c64xx_spi_port_config s3c6410_spi_port_config = {
1490 .fifo_lvl_mask = { 0x7f, 0x7F }, 1490 .fifo_lvl_mask = { 0x7f, 0x7F },
1491 .rx_lvl_offset = 13, 1491 .rx_lvl_offset = 13,
1492 .tx_st_done = 21, 1492 .tx_st_done = 21,
1493}; 1493};
1494 1494
1495struct s3c64xx_spi_port_config s5p64x0_spi_port_config = { 1495static struct s3c64xx_spi_port_config s5p64x0_spi_port_config = {
1496 .fifo_lvl_mask = { 0x1ff, 0x7F }, 1496 .fifo_lvl_mask = { 0x1ff, 0x7F },
1497 .rx_lvl_offset = 15, 1497 .rx_lvl_offset = 15,
1498 .tx_st_done = 25, 1498 .tx_st_done = 25,
1499}; 1499};
1500 1500
1501struct s3c64xx_spi_port_config s5pc100_spi_port_config = { 1501static struct s3c64xx_spi_port_config s5pc100_spi_port_config = {
1502 .fifo_lvl_mask = { 0x7f, 0x7F }, 1502 .fifo_lvl_mask = { 0x7f, 0x7F },
1503 .rx_lvl_offset = 13, 1503 .rx_lvl_offset = 13,
1504 .tx_st_done = 21, 1504 .tx_st_done = 21,
1505 .high_speed = true, 1505 .high_speed = true,
1506}; 1506};
1507 1507
1508struct s3c64xx_spi_port_config s5pv210_spi_port_config = { 1508static struct s3c64xx_spi_port_config s5pv210_spi_port_config = {
1509 .fifo_lvl_mask = { 0x1ff, 0x7F }, 1509 .fifo_lvl_mask = { 0x1ff, 0x7F },
1510 .rx_lvl_offset = 15, 1510 .rx_lvl_offset = 15,
1511 .tx_st_done = 25, 1511 .tx_st_done = 25,
1512 .high_speed = true, 1512 .high_speed = true,
1513}; 1513};
1514 1514
1515struct s3c64xx_spi_port_config exynos4_spi_port_config = { 1515static struct s3c64xx_spi_port_config exynos4_spi_port_config = {
1516 .fifo_lvl_mask = { 0x1ff, 0x7F, 0x7F }, 1516 .fifo_lvl_mask = { 0x1ff, 0x7F, 0x7F },
1517 .rx_lvl_offset = 15, 1517 .rx_lvl_offset = 15,
1518 .tx_st_done = 25, 1518 .tx_st_done = 25,