From: Tomi Valkeinen Date: Fri, 3 May 2013 10:35:07 +0000 (+0300) Subject: OMAPDSS: CORE: use devm_regulator_get X-Git-Tag: firefly_0821_release~176^2~5753^2~3^2~27 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=51930bba8e9a19401247a4147daa828851d400ce;p=firefly-linux-kernel-4.4.55.git OMAPDSS: CORE: use devm_regulator_get Use devm_regulator_get() instead of regulator_get() to simplify code. Signed-off-by: Tomi Valkeinen --- diff --git a/drivers/video/omap2/dss/core.c b/drivers/video/omap2/dss/core.c index 831abec565f2..7b2df2ff5667 100644 --- a/drivers/video/omap2/dss/core.c +++ b/drivers/video/omap2/dss/core.c @@ -88,7 +88,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; @@ -102,7 +102,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; @@ -664,16 +664,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();