spi/omap-100k: Convert to devm_clk_get()
authorMark Brown <broonie@linaro.org>
Wed, 10 Jul 2013 15:07:51 +0000 (16:07 +0100)
committerMark Brown <broonie@linaro.org>
Mon, 15 Jul 2013 10:39:30 +0000 (11:39 +0100)
Signed-off-by: Mark Brown <broonie@linaro.org>
drivers/spi/spi-omap-100k.c

index d4fcca9dc8e5a89399ebc1963690e25e8d4d3d00..691ef3f199ff7409cacee7538ad3a0293a4c2b92 100644 (file)
@@ -443,33 +443,29 @@ static int omap1_spi100k_probe(struct platform_device *pdev)
         */
        spi100k->base = (void __iomem *) pdev->dev.platform_data;
 
-       spi100k->ick = clk_get(&pdev->dev, "ick");
+       spi100k->ick = devm_clk_get(&pdev->dev, "ick");
        if (IS_ERR(spi100k->ick)) {
                dev_dbg(&pdev->dev, "can't get spi100k_ick\n");
                status = PTR_ERR(spi100k->ick);
-               goto err1;
+               goto err;
        }
 
-       spi100k->fck = clk_get(&pdev->dev, "fck");
+       spi100k->fck = devm_clk_get(&pdev->dev, "fck");
        if (IS_ERR(spi100k->fck)) {
                dev_dbg(&pdev->dev, "can't get spi100k_fck\n");
                status = PTR_ERR(spi100k->fck);
-               goto err2;
+               goto err;
        }
 
        status = spi_register_master(master);
        if (status < 0)
-               goto err3;
+               goto err;
 
        spi100k->state = SPI_RUNNING;
 
        return status;
 
-err3:
-       clk_put(spi100k->fck);
-err2:
-       clk_put(spi100k->ick);
-err1:
+err:
        spi_master_put(master);
        return status;
 }
@@ -487,9 +483,6 @@ static int omap1_spi100k_remove(struct platform_device *pdev)
        if (status != 0)
                return status;
 
-       clk_put(spi100k->fck);
-       clk_put(spi100k->ick);
-
        r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 
        spi_unregister_master(master);