+static int dsp_kfunc_probe_devices(struct omap_dsp *dsp)
+{
+ struct dsp_kfunc_device *p;
+ int ret, fail = 0;
+
+ mutex_lock(&dsp->lock);
+ list_for_each_entry(p, dsp->kdev_list, entry) {
+ if (p->probe == NULL)
+ continue;
+ ret = p->probe(p);
+ if (ret) {
+ printk(KERN_ERR
+ "probing %s failed\n", p->name);
+ fail++;
+ }
+ }
+ mutex_unlock(&dsp->lock);
+
+ pr_debug("%s() fail:%d\n", __FUNCTION__, fail);
+
+ return fail;
+}
+
+static int dsp_kfunc_remove_devices(struct omap_dsp *dsp)
+{
+ struct dsp_kfunc_device *p;
+ int ret, fail = 0;
+
+ mutex_lock(&dsp->lock);
+ list_for_each_entry_reverse(p, dsp->kdev_list, entry) {
+ if (p->remove == NULL)
+ continue;
+ ret = p->remove(p);
+ if (ret) {
+ printk(KERN_ERR
+ "removing %s failed\n", p->name);
+ fail++;
+ }
+ }
+ mutex_unlock(&dsp->lock);
+
+ pr_debug("%s() fail:%d\n", __FUNCTION__, fail);
+
+ return fail;
+}
+
+static int dsp_kfunc_enable_devices(struct omap_dsp *dsp, int type, int stage)
+{
+ struct dsp_kfunc_device *p;
+ int ret, fail = 0;
+
+ mutex_lock(&dsp->lock);
+ list_for_each_entry(p, dsp->kdev_list, entry) {
+ if ((p->type != type) || (p->enable == NULL))
+ continue;
+ ret = p->enable(p, stage);
+ if (ret) {
+ printk(KERN_ERR
+ "enabling %s failed\n", p->name);
+ fail++;
+ }
+ }
+ mutex_unlock(&dsp->lock);
+
+ pr_debug("%s(%d) fail:%d\n", __FUNCTION__, type, fail);
+
+ return fail;
+}
+
+static int dsp_kfunc_disable_devices(struct omap_dsp *dsp, int type, int stage)
+{
+ struct dsp_kfunc_device *p;
+ int ret, fail = 0;
+
+ mutex_lock(&dsp->lock);
+ list_for_each_entry_reverse(p, omap_dsp->kdev_list, entry) {
+ if ((p->type != type) || (p->disable == NULL))
+ continue;
+ ret = p->disable(p, stage);
+ if (ret) {
+ printk(KERN_ERR
+ "disabling %s failed\n", p->name);
+ fail++;
+ }
+ }
+ mutex_unlock(&dsp->lock);
+
+ pr_debug("%s(%d) fail:%d\n", __FUNCTION__, type, fail);
+
+ return fail;
+}
+