}
EXPORT_SYMBOL_GPL(dapm_reg_event);
+static int dapm_widget_power_check(struct snd_soc_dapm_widget *w)
+{
+ if (w->force)
+ return 1;
+ else
+ return w->power_check(w);
+}
+
/* Generic check to see if a widget should be powered.
*/
static int dapm_generic_check_power(struct snd_soc_dapm_widget *w)
if (!path->sink)
continue;
- if (path->sink->force) {
- power = 1;
- break;
- }
-
- if (path->sink->power_check &&
- path->sink->power_check(path->sink)) {
+ if (dapm_widget_power_check(path->sink)) {
power = 1;
break;
}
break;
default:
- if (!w->force)
- power = w->power_check(w);
- else
- power = 1;
+ power = dapm_widget_power_check(w);
dapm_widget_set_power(w, power, up_list, down_list);
break;