Skip to content

Commit

Permalink
Merge tag 'spi-3.6' of git://git.kernel.org/pub/scm/linux/kernel/git/…
Browse files Browse the repository at this point in the history
…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
  • Loading branch information
Linus Torvalds committed Aug 20, 2012
2 parents fd4d332 + af36107 commit 8a6b521
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 15 deletions.
4 changes: 3 additions & 1 deletion drivers/spi/spi-bcm63xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ static int __devinit bcm63xx_spi_probe(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);

spi_unregister_master(master);
Expand All @@ -452,6 +452,8 @@ static int __devexit bcm63xx_spi_remove(struct platform_device *pdev)

platform_set_drvdata(pdev, 0);

spi_master_put(master);

return 0;
}

Expand Down
5 changes: 2 additions & 3 deletions drivers/spi/spi-coldfire-qspi.c
Original file line number Diff line number Diff line change
Expand Up @@ -533,15 +533,14 @@ static int __devexit mcfqspi_remove(struct platform_device *pdev)
iounmap(mcfqspi->iobase);
release_mem_region(res->start, resource_size(res));
spi_unregister_master(master);
spi_master_put(master);

return 0;
}

#ifdef CONFIG_PM_SLEEP
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);

spi_master_suspend(master);
Expand All @@ -553,7 +552,7 @@ static int mcfqspi_suspend(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);

spi_master_resume(master);
Expand Down
6 changes: 2 additions & 4 deletions drivers/spi/spi-omap2-mcspi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1228,18 +1228,16 @@ static int __devinit omap2_mcspi_probe(struct platform_device *pdev)

status = spi_register_master(master);
if (status < 0)
goto err_spi_register;
goto disable_pm;

return status;

err_spi_register:
spi_master_put(master);
disable_pm:
pm_runtime_disable(&pdev->dev);
dma_chnl_free:
kfree(mcspi->dma_channels);
free_master:
kfree(master);
spi_master_put(master);
platform_set_drvdata(pdev, NULL);
return status;
}
Expand Down
1 change: 0 additions & 1 deletion drivers/spi/spi-pl022.c
Original file line number Diff line number Diff line change
Expand Up @@ -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",
adev->res.start, pl022->virtbase);

pm_runtime_enable(dev);
pm_runtime_resume(dev);

pl022->clk = clk_get(&adev->dev, NULL);
Expand Down
12 changes: 6 additions & 6 deletions drivers/spi/spi-s3c64xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -1479,40 +1479,40 @@ static const struct dev_pm_ops s3c64xx_spi_pm = {
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 },
.rx_lvl_offset = 13,
.tx_st_done = 21,
.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 },
.rx_lvl_offset = 13,
.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 },
.rx_lvl_offset = 15,
.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 },
.rx_lvl_offset = 13,
.tx_st_done = 21,
.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 },
.rx_lvl_offset = 15,
.tx_st_done = 25,
.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 },
.rx_lvl_offset = 15,
.tx_st_done = 25,
Expand Down

0 comments on commit 8a6b521

Please sign in to comment.