Use devm_regulator_get() instead of regulator_get() to simplify code.

Signed-off-by: Tomi Valkeinen <tomi.valkei...@ti.com>
---
 drivers/video/omap2/dss/core.c | 14 ++------------
 1 file changed, 2 insertions(+), 12 deletions(-)

diff --git a/drivers/video/omap2/dss/core.c b/drivers/video/omap2/dss/core.c
index 4bd8f79..f64d0ac 100644
--- a/drivers/video/omap2/dss/core.c
+++ b/drivers/video/omap2/dss/core.c
@@ -80,7 +80,7 @@ struct regulator *dss_get_vdds_dsi(void)
        if (core.vdds_dsi_reg != NULL)
                return core.vdds_dsi_reg;
 
-       reg = regulator_get(&core.pdev->dev, "vdds_dsi");
+       reg = devm_regulator_get(&core.pdev->dev, "vdds_dsi");
        if (!IS_ERR(reg))
                core.vdds_dsi_reg = reg;
 
@@ -94,7 +94,7 @@ struct regulator *dss_get_vdds_sdi(void)
        if (core.vdds_sdi_reg != NULL)
                return core.vdds_sdi_reg;
 
-       reg = regulator_get(&core.pdev->dev, "vdds_sdi");
+       reg = devm_regulator_get(&core.pdev->dev, "vdds_sdi");
        if (!IS_ERR(reg))
                core.vdds_sdi_reg = reg;
 
@@ -654,16 +654,6 @@ static int __init omap_dss_init(void)
 
 static void __exit omap_dss_exit(void)
 {
-       if (core.vdds_dsi_reg != NULL) {
-               regulator_put(core.vdds_dsi_reg);
-               core.vdds_dsi_reg = NULL;
-       }
-
-       if (core.vdds_sdi_reg != NULL) {
-               regulator_put(core.vdds_sdi_reg);
-               core.vdds_sdi_reg = NULL;
-       }
-
        omap_dss_unregister_drivers();
 
        omap_dss_bus_unregister();
-- 
1.8.1.2

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to