Re: [PATCH v2 1/6] staging: most: sound: create one sound card w/ multiple PCM devices per MOST device

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux