提交 8a6b5214 编写于 作者: L Linus Torvalds

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
...@@ -438,7 +438,7 @@ static int __devinit bcm63xx_spi_probe(struct platform_device *pdev) ...@@ -438,7 +438,7 @@ static int __devinit bcm63xx_spi_probe(struct platform_device *pdev)
static int __devexit bcm63xx_spi_remove(struct platform_device *pdev) static int __devexit bcm63xx_spi_remove(struct platform_device *pdev)
{ {
struct spi_master *master = platform_get_drvdata(pdev); struct spi_master *master = spi_master_get(platform_get_drvdata(pdev));
struct bcm63xx_spi *bs = spi_master_get_devdata(master); struct bcm63xx_spi *bs = spi_master_get_devdata(master);
spi_unregister_master(master); spi_unregister_master(master);
...@@ -452,6 +452,8 @@ static int __devexit bcm63xx_spi_remove(struct platform_device *pdev) ...@@ -452,6 +452,8 @@ static int __devexit bcm63xx_spi_remove(struct platform_device *pdev)
platform_set_drvdata(pdev, 0); platform_set_drvdata(pdev, 0);
spi_master_put(master);
return 0; return 0;
} }
......
...@@ -533,7 +533,6 @@ static int __devexit mcfqspi_remove(struct platform_device *pdev) ...@@ -533,7 +533,6 @@ static int __devexit mcfqspi_remove(struct platform_device *pdev)
iounmap(mcfqspi->iobase); iounmap(mcfqspi->iobase);
release_mem_region(res->start, resource_size(res)); release_mem_region(res->start, resource_size(res));
spi_unregister_master(master); spi_unregister_master(master);
spi_master_put(master);
return 0; return 0;
} }
...@@ -541,7 +540,7 @@ static int __devexit mcfqspi_remove(struct platform_device *pdev) ...@@ -541,7 +540,7 @@ static int __devexit mcfqspi_remove(struct platform_device *pdev)
#ifdef CONFIG_PM_SLEEP #ifdef CONFIG_PM_SLEEP
static int mcfqspi_suspend(struct device *dev) static int mcfqspi_suspend(struct device *dev)
{ {
struct spi_master *master = spi_master_get(dev_get_drvdata(dev)); struct spi_master *master = dev_get_drvdata(dev);
struct mcfqspi *mcfqspi = spi_master_get_devdata(master); struct mcfqspi *mcfqspi = spi_master_get_devdata(master);
spi_master_suspend(master); spi_master_suspend(master);
...@@ -553,7 +552,7 @@ static int mcfqspi_suspend(struct device *dev) ...@@ -553,7 +552,7 @@ static int mcfqspi_suspend(struct device *dev)
static int mcfqspi_resume(struct device *dev) static int mcfqspi_resume(struct device *dev)
{ {
struct spi_master *master = spi_master_get(dev_get_drvdata(dev)); struct spi_master *master = dev_get_drvdata(dev);
struct mcfqspi *mcfqspi = spi_master_get_devdata(master); struct mcfqspi *mcfqspi = spi_master_get_devdata(master);
spi_master_resume(master); spi_master_resume(master);
......
...@@ -1228,18 +1228,16 @@ static int __devinit omap2_mcspi_probe(struct platform_device *pdev) ...@@ -1228,18 +1228,16 @@ static int __devinit omap2_mcspi_probe(struct platform_device *pdev)
status = spi_register_master(master); status = spi_register_master(master);
if (status < 0) if (status < 0)
goto err_spi_register; goto disable_pm;
return status; return status;
err_spi_register:
spi_master_put(master);
disable_pm: disable_pm:
pm_runtime_disable(&pdev->dev); pm_runtime_disable(&pdev->dev);
dma_chnl_free: dma_chnl_free:
kfree(mcspi->dma_channels); kfree(mcspi->dma_channels);
free_master: free_master:
kfree(master); spi_master_put(master);
platform_set_drvdata(pdev, NULL); platform_set_drvdata(pdev, NULL);
return status; return status;
} }
......
...@@ -2053,7 +2053,6 @@ pl022_probe(struct amba_device *adev, const struct amba_id *id) ...@@ -2053,7 +2053,6 @@ pl022_probe(struct amba_device *adev, const struct amba_id *id)
printk(KERN_INFO "pl022: mapped registers from 0x%08x to %p\n", printk(KERN_INFO "pl022: mapped registers from 0x%08x to %p\n",
adev->res.start, pl022->virtbase); adev->res.start, pl022->virtbase);
pm_runtime_enable(dev);
pm_runtime_resume(dev); pm_runtime_resume(dev);
pl022->clk = clk_get(&adev->dev, NULL); pl022->clk = clk_get(&adev->dev, NULL);
......
...@@ -1479,40 +1479,40 @@ static const struct dev_pm_ops s3c64xx_spi_pm = { ...@@ -1479,40 +1479,40 @@ static const struct dev_pm_ops s3c64xx_spi_pm = {
s3c64xx_spi_runtime_resume, NULL) s3c64xx_spi_runtime_resume, NULL)
}; };
struct s3c64xx_spi_port_config s3c2443_spi_port_config = { static struct s3c64xx_spi_port_config s3c2443_spi_port_config = {
.fifo_lvl_mask = { 0x7f }, .fifo_lvl_mask = { 0x7f },
.rx_lvl_offset = 13, .rx_lvl_offset = 13,
.tx_st_done = 21, .tx_st_done = 21,
.high_speed = true, .high_speed = true,
}; };
struct s3c64xx_spi_port_config s3c6410_spi_port_config = { static struct s3c64xx_spi_port_config s3c6410_spi_port_config = {
.fifo_lvl_mask = { 0x7f, 0x7F }, .fifo_lvl_mask = { 0x7f, 0x7F },
.rx_lvl_offset = 13, .rx_lvl_offset = 13,
.tx_st_done = 21, .tx_st_done = 21,
}; };
struct s3c64xx_spi_port_config s5p64x0_spi_port_config = { static struct s3c64xx_spi_port_config s5p64x0_spi_port_config = {
.fifo_lvl_mask = { 0x1ff, 0x7F }, .fifo_lvl_mask = { 0x1ff, 0x7F },
.rx_lvl_offset = 15, .rx_lvl_offset = 15,
.tx_st_done = 25, .tx_st_done = 25,
}; };
struct s3c64xx_spi_port_config s5pc100_spi_port_config = { static struct s3c64xx_spi_port_config s5pc100_spi_port_config = {
.fifo_lvl_mask = { 0x7f, 0x7F }, .fifo_lvl_mask = { 0x7f, 0x7F },
.rx_lvl_offset = 13, .rx_lvl_offset = 13,
.tx_st_done = 21, .tx_st_done = 21,
.high_speed = true, .high_speed = true,
}; };
struct s3c64xx_spi_port_config s5pv210_spi_port_config = { static struct s3c64xx_spi_port_config s5pv210_spi_port_config = {
.fifo_lvl_mask = { 0x1ff, 0x7F }, .fifo_lvl_mask = { 0x1ff, 0x7F },
.rx_lvl_offset = 15, .rx_lvl_offset = 15,
.tx_st_done = 25, .tx_st_done = 25,
.high_speed = true, .high_speed = true,
}; };
struct s3c64xx_spi_port_config exynos4_spi_port_config = { static struct s3c64xx_spi_port_config exynos4_spi_port_config = {
.fifo_lvl_mask = { 0x1ff, 0x7F, 0x7F }, .fifo_lvl_mask = { 0x1ff, 0x7F, 0x7F },
.rx_lvl_offset = 15, .rx_lvl_offset = 15,
.tx_st_done = 25, .tx_st_done = 25,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册