[PATCH 3/6] staging: most: sound: rename variable

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

 



Since the channels of a MOST device are now being represented as
individual PCM devices of one sound card, the variable card_name is not
suitable anymore to describe them. Therefore, this patch renames the
variable to device_name.

Signed-off-by: Christian Gromm <christian.gromm@xxxxxxxxxxxxx>
---
 drivers/staging/most/sound/sound.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/most/sound/sound.c b/drivers/staging/most/sound/sound.c
index 6db726b..988cc55 100644
--- a/drivers/staging/most/sound/sound.c
+++ b/drivers/staging/most/sound/sound.c
@@ -471,14 +471,14 @@ static const struct snd_pcm_ops pcm_ops = {
 	.page       = snd_pcm_lib_get_vmalloc_page,
 };
 
-static int split_arg_list(char *buf, char **card_name, u16 *ch_num,
+static int split_arg_list(char *buf, char **device_name, u16 *ch_num,
 			  char **sample_res, u8 *create)
 {
 	char *num;
 	int ret;
 
-	*card_name = strsep(&buf, ".");
-	if (!*card_name) {
+	*device_name = strsep(&buf, ".");
+	if (!*device_name) {
 		pr_err("Missing sound card name\n");
 		return -EIO;
 	}
@@ -587,7 +587,7 @@ static int audio_probe_channel(struct most_interface *iface, int channel_id,
 	int capture_count = 0;
 	int ret;
 	int direction;
-	char *card_name;
+	char *device_name;
 	u16 ch_num;
 	u8 create = 0;
 	char *sample_res;
@@ -600,7 +600,7 @@ 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,
+	ret = split_arg_list(arg_list, &device_name, &ch_num, &sample_res,
 			     &create);
 	if (ret < 0)
 		return ret;
@@ -622,7 +622,7 @@ static int audio_probe_channel(struct most_interface *iface, int channel_id,
 	adpt->pcm_dev_idx = 0;
 	INIT_LIST_HEAD(&adpt->dev_list);
 	iface->priv = adpt;
-	ret = snd_card_new(&iface->dev, -1, card_name, THIS_MODULE,
+	ret = snd_card_new(&iface->dev, -1, device_name, THIS_MODULE,
 			   sizeof(*channel), &adpt->card);
 	if (ret < 0)
 		return ret;
@@ -663,14 +663,14 @@ static int audio_probe_channel(struct most_interface *iface, int channel_id,
 	if (ret)
 		goto err_free_adpt;
 
-	ret = snd_pcm_new(adpt->card, card_name, adpt->pcm_dev_idx,
+	ret = snd_pcm_new(adpt->card, device_name, adpt->pcm_dev_idx,
 			  playback_count, capture_count, &pcm);
 
 	if (ret < 0)
 		goto err_free_adpt;
 
 	pcm->private_data = channel;
-
+	snprintf(pcm->name, sizeof(device_name), device_name);
 	snd_pcm_set_ops(pcm, direction, &pcm_ops);
 
 	if (create) {
-- 
2.7.4

_______________________________________________
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