X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?p=pandora-kernel.git;a=blobdiff_plain;f=drivers%2Fspi%2Fspi-pl022.c;h=1ab2fa0d37fd7d0d6dea52e0dd801cbd8a4cea52;hp=078338f59481ad5068bae19640721fc0d15aa55e;hb=7ff6bcf048e6a9849ea0b44269fa4c1c72869db2;hpb=92b97f0aaccbf9de4a29696e6253bf82e8850d1d diff --git a/drivers/spi/spi-pl022.c b/drivers/spi/spi-pl022.c index 078338f59481..1ab2fa0d37fd 100644 --- a/drivers/spi/spi-pl022.c +++ b/drivers/spi/spi-pl022.c @@ -2187,6 +2187,13 @@ pl022_probe(struct amba_device *adev, const struct amba_id *id) dev_err(&adev->dev, "could not retrieve SSP/SPI bus clock\n"); goto err_no_clk; } + + status = clk_prepare(pl022->clk); + if (status) { + dev_err(&adev->dev, "could not prepare SSP/SPI bus clock\n"); + goto err_clk_prep; + } + /* Disable SSP */ writew((readw(SSP_CR1(pl022->virtbase)) & (~SSP_CR1_MASK_SSE)), SSP_CR1(pl022->virtbase)); @@ -2238,6 +2245,8 @@ pl022_probe(struct amba_device *adev, const struct amba_id *id) pl022_dma_remove(pl022); free_irq(adev->irq[0], pl022); err_no_irq: + clk_unprepare(pl022->clk); + err_clk_prep: clk_put(pl022->clk); err_no_clk: iounmap(pl022->virtbase); @@ -2271,6 +2280,7 @@ pl022_remove(struct amba_device *adev) pl022_dma_remove(pl022); free_irq(adev->irq[0], pl022); clk_disable(pl022->clk); + clk_unprepare(pl022->clk); clk_put(pl022->clk); iounmap(pl022->virtbase); amba_release_regions(adev); @@ -2282,14 +2292,14 @@ pl022_remove(struct amba_device *adev) } #ifdef CONFIG_SUSPEND -static int pl011_suspend(struct device *dev) +static int pl022_suspend(struct device *dev) { struct pl022 *pl022 = dev_get_drvdata(dev); int status = 0; status = stop_queue(pl022); if (status) { - dev_warn(&adev->dev, "suspend cannot stop queue\n"); + dev_warn(dev, "suspend cannot stop queue\n"); return status; } @@ -2298,7 +2308,7 @@ static int pl011_suspend(struct device *dev) load_ssp_default_config(pl022); amba_pclk_disable(pl022->adev); amba_vcore_disable(pl022->adev); - dev_dbg(&adev->dev, "suspended\n"); + dev_dbg(dev, "suspended\n"); return 0; }