This is mostly preparation for another patch that takes these functions into use from omap_sr_enable and omap_sr_disable. Signed-off-by: Jarkko Nikula <jhnikula@xxxxxxxxx> --- arch/arm/mach-omap2/smartreflex.c | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-) diff --git a/arch/arm/mach-omap2/smartreflex.c b/arch/arm/mach-omap2/smartreflex.c index d94894a..11741d8 100644 --- a/arch/arm/mach-omap2/smartreflex.c +++ b/arch/arm/mach-omap2/smartreflex.c @@ -229,6 +229,9 @@ static void sr_start_vddautocomp(struct omap_sr *sr) static void sr_stop_vddautocomp(struct omap_sr *sr) { + if (!sr->autocomp_active) + return; + if (!sr_class || !(sr_class->disable)) { dev_warn(&sr->pdev->dev, "%s: smartreflex class driver not registered\n", @@ -236,10 +239,8 @@ static void sr_stop_vddautocomp(struct omap_sr *sr) return; } - if (sr->autocomp_active) { - sr_class->disable(sr->voltdm, 1); + if (!sr_class->disable(sr->voltdm, 1)) sr->autocomp_active = false; - } } /* -- 1.7.2.3 -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html