On Sun, Dec 16, 2018 at 01:36:19PM +0100, Christian Gromm wrote:
> @@ -571,6 +600,39 @@ static int audio_probe_channel(struct most_interface 
> *iface, int channel_id,
>               return -EINVAL;
>       }
>  
> +     ret = split_arg_list(arg_list, &card_name, &ch_num, &sample_res,
> +                          &create);
> +     if (ret < 0)
> +             return ret;
> +
> +     list_for_each_entry(adpt, &adpt_list, list) {
> +             if (adpt->iface != iface)
> +                     continue;
> +             if (adpt->registered)
> +                     return -ENOSPC;
> +             adpt->pcm_dev_idx++;
> +             goto skip_adpt_alloc;
> +     }
> +     adpt = kzalloc(sizeof(*adpt), GFP_KERNEL);
> +     if (!adpt)
> +             return -ENOMEM;
> +
> +     adpt->iface = iface;
> +     INIT_LIST_HEAD(&adpt->dev_list);
> +     iface->priv = adpt;
> +     list_add_tail(&adpt->list, &adpt_list);
> +     ret = snd_card_new(&iface->dev, -1, card_name, THIS_MODULE,
> +                        sizeof(*channel), &adpt->card);
> +     if (ret < 0)
> +             return ret;

goto free_adpt;

> +     snprintf(adpt->card->driver, sizeof(adpt->card->driver),
> +              "%s", DRIVER_NAME);
> +     snprintf(adpt->card->shortname, sizeof(adpt->card->shortname),
> +              "Microchip MOST:%d", adpt->card->number);
> +     snprintf(adpt->card->longname, sizeof(adpt->card->longname),
> +              "%s at %s, ch %d", adpt->card->shortname, iface->description,
> +              channel_id);
> +skip_adpt_alloc:

_______________________________________________
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Reply via email to