Skip to content

Commit

Permalink
spi: dw-mmio: prepare the clock before enabling
Browse files Browse the repository at this point in the history
This is required for common clock support.

Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Signed-off-by: Mark Brown <broonie@linaro.org>
  • Loading branch information
Baruch Siach authored and Mark Brown committed Dec 31, 2013
1 parent 04f421e commit 020fe3f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/spi/spi-dw-mmio.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ static int dw_spi_mmio_probe(struct platform_device *pdev)
dwsmmio->clk = devm_clk_get(&pdev->dev, NULL);
if (IS_ERR(dwsmmio->clk))
return PTR_ERR(dwsmmio->clk);
ret = clk_enable(dwsmmio->clk);
ret = clk_prepare_enable(dwsmmio->clk);
if (ret)
return ret;

Expand All @@ -78,15 +78,15 @@ static int dw_spi_mmio_probe(struct platform_device *pdev)
return 0;

out:
clk_disable(dwsmmio->clk);
clk_disable_unprepare(dwsmmio->clk);
return ret;
}

static int dw_spi_mmio_remove(struct platform_device *pdev)
{
struct dw_spi_mmio *dwsmmio = platform_get_drvdata(pdev);

clk_disable(dwsmmio->clk);
clk_disable_unprepare(dwsmmio->clk);
dw_spi_remove_host(&dwsmmio->dws);

return 0;
Expand Down

0 comments on commit 020fe3f

Please sign in to comment.