goto _err;
}
+ /* no-op check, remove the plugin */
+ if (priv->map_items == 0 && priv->remap_items == 0) {
+ remap_free(priv);
+ *handlep = child;
+ return 0;
+ }
+
priv->map_read_queue = calloc(priv->map_items, sizeof(priv->map_read_queue[0]));
if (priv->map_read_queue == NULL) {
result = -ENOMEM;
SNDERR("child is not defined");
return -EINVAL;
}
- if (!remap && !map) {
- SNDERR("remap or create section is not defined");
- return -EINVAL;
- }
err = _snd_ctl_open_child(&cctl, root, child, mode, conf);
if (err < 0)
return err;
+ /* no-op, remove the plugin */
+ if (!remap && !map) {
+ *handlep = cctl;
+ return 0;
+ }
err = snd_ctl_remap_open(handlep, name, remap, map, cctl, mode);
if (err < 0)
snd_ctl_close(cctl);