Skip to content

Commit

Permalink
spi: omap-uwire: use devm_ functions
Browse files Browse the repository at this point in the history
This patch introduces the use of devm_clk_get and devm_ioremap instead
of the unmanaged interfaces and removes the corresponding free function
calls.

Signed-off-by: Himangi Saraogi <himangi774@gmail.com>
Acked-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Mark Brown <broonie@linaro.org>
  • Loading branch information
Himangi Saraogi authored and Mark Brown committed Jun 21, 2014
1 parent 7171511 commit b3f6a57
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions drivers/spi/spi-omap-uwire.c
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,6 @@ static void uwire_off(struct uwire_spi *uwire)
{
uwire_write_reg(UWIRE_SR3, 0);
clk_disable(uwire->ck);
clk_put(uwire->ck);
spi_master_put(uwire->bitbang.master);
}

Expand All @@ -463,7 +462,7 @@ static int uwire_probe(struct platform_device *pdev)

uwire = spi_master_get_devdata(master);

uwire_base = ioremap(UWIRE_BASE_PHYS, UWIRE_IO_SIZE);
uwire_base = devm_ioremap(&pdev->dev, UWIRE_BASE_PHYS, UWIRE_IO_SIZE);
if (!uwire_base) {
dev_dbg(&pdev->dev, "can't ioremap UWIRE\n");
spi_master_put(master);
Expand All @@ -472,12 +471,11 @@ static int uwire_probe(struct platform_device *pdev)

platform_set_drvdata(pdev, uwire);

uwire->ck = clk_get(&pdev->dev, "fck");
uwire->ck = devm_clk_get(&pdev->dev, "fck");
if (IS_ERR(uwire->ck)) {
status = PTR_ERR(uwire->ck);
dev_dbg(&pdev->dev, "no functional clock?\n");
spi_master_put(master);
iounmap(uwire_base);
return status;
}
clk_enable(uwire->ck);
Expand Down Expand Up @@ -507,7 +505,6 @@ static int uwire_probe(struct platform_device *pdev)
status = spi_bitbang_start(&uwire->bitbang);
if (status < 0) {
uwire_off(uwire);
iounmap(uwire_base);
}
return status;
}
Expand All @@ -520,7 +517,6 @@ static int uwire_remove(struct platform_device *pdev)

spi_bitbang_stop(&uwire->bitbang);
uwire_off(uwire);
iounmap(uwire_base);
return 0;
}

Expand Down

0 comments on commit b3f6a57

Please sign in to comment.