@@ -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;
- }
}
/*