From d0af1bd5f6f44971bea2e45acfe07de629734a3e Mon Sep 17 00:00:00 2001 From: Pankaj Bharadiya Date: Sun, 16 Oct 2016 15:29:14 +0530 Subject: [PATCH] staging: greybus: audio: Rename cport with intf_id gb_audio_manager_module_descriptor's cport field is actually used to manage and pass interface id to user space. Thus rename gb_audio_manager_module_descriptor's 'cport' field and few other things to avoid confusion. Signed-off-by: Pankaj Bharadiya Reviewed-by: Vaibhav Agarwal Acked-by: Viresh Kumar Signed-off-by: Greg Kroah-Hartman --- drivers/staging/greybus/audio_manager.h | 2 +- .../staging/greybus/audio_manager_module.c | 20 +++++++++---------- drivers/staging/greybus/audio_manager_sysfs.c | 4 ++-- drivers/staging/greybus/audio_module.c | 2 +- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/drivers/staging/greybus/audio_manager.h b/drivers/staging/greybus/audio_manager.h index c4ca09754a6a..056088eb12fe 100644 --- a/drivers/staging/greybus/audio_manager.h +++ b/drivers/staging/greybus/audio_manager.h @@ -21,7 +21,7 @@ struct gb_audio_manager_module_descriptor { int slot; int vid; int pid; - int cport; + int intf_id; unsigned int ip_devices; unsigned int op_devices; }; diff --git a/drivers/staging/greybus/audio_manager_module.c b/drivers/staging/greybus/audio_manager_module.c index a10e96ad79c1..2bf40a90368d 100644 --- a/drivers/staging/greybus/audio_manager_module.c +++ b/drivers/staging/greybus/audio_manager_module.c @@ -111,16 +111,16 @@ static ssize_t gb_audio_module_pid_show( static struct gb_audio_manager_module_attribute gb_audio_module_pid_attribute = __ATTR(pid, 0664, gb_audio_module_pid_show, NULL); -static ssize_t gb_audio_module_cport_show( +static ssize_t gb_audio_module_intf_id_show( struct gb_audio_manager_module *module, struct gb_audio_manager_module_attribute *attr, char *buf) { - return sprintf(buf, "%d", module->desc.cport); + return sprintf(buf, "%d", module->desc.intf_id); } static struct gb_audio_manager_module_attribute - gb_audio_module_cport_attribute = - __ATTR(cport, 0664, gb_audio_module_cport_show, NULL); + gb_audio_module_intf_id_attribute = + __ATTR(intf_id, 0664, gb_audio_module_intf_id_show, NULL); static ssize_t gb_audio_module_ip_devices_show( struct gb_audio_manager_module *module, @@ -149,7 +149,7 @@ static struct attribute *gb_audio_module_default_attrs[] = { &gb_audio_module_slot_attribute.attr, &gb_audio_module_vid_attribute.attr, &gb_audio_module_pid_attribute.attr, - &gb_audio_module_cport_attribute.attr, + &gb_audio_module_intf_id_attribute.attr, &gb_audio_module_ip_devices_attribute.attr, &gb_audio_module_op_devices_attribute.attr, NULL, /* need to NULL terminate the list of attributes */ @@ -167,7 +167,7 @@ static void send_add_uevent(struct gb_audio_manager_module *module) char slot_string[64]; char vid_string[64]; char pid_string[64]; - char cport_string[64]; + char intf_id_string[64]; char ip_devices_string[64]; char op_devices_string[64]; @@ -176,7 +176,7 @@ static void send_add_uevent(struct gb_audio_manager_module *module) slot_string, vid_string, pid_string, - cport_string, + intf_id_string, ip_devices_string, op_devices_string, NULL @@ -186,7 +186,7 @@ static void send_add_uevent(struct gb_audio_manager_module *module) snprintf(slot_string, 64, "SLOT=%d", module->desc.slot); snprintf(vid_string, 64, "VID=%d", module->desc.vid); snprintf(pid_string, 64, "PID=%d", module->desc.pid); - snprintf(cport_string, 64, "CPORT=%d", module->desc.cport); + snprintf(intf_id_string, 64, "INTF_ID=%d", module->desc.intf_id); snprintf(ip_devices_string, 64, "I/P DEVICES=0x%X", module->desc.ip_devices); snprintf(op_devices_string, 64, "O/P DEVICES=0x%X", @@ -246,13 +246,13 @@ int gb_audio_manager_module_create( void gb_audio_manager_module_dump(struct gb_audio_manager_module *module) { - pr_info("audio module #%d name=%s slot=%d vid=%d pid=%d cport=%d i/p devices=0x%X o/p devices=0x%X\n", + pr_info("audio module #%d name=%s slot=%d vid=%d pid=%d intf_id=%d i/p devices=0x%X o/p devices=0x%X\n", module->id, module->desc.name, module->desc.slot, module->desc.vid, module->desc.pid, - module->desc.cport, + module->desc.intf_id, module->desc.ip_devices, module->desc.op_devices); } diff --git a/drivers/staging/greybus/audio_manager_sysfs.c b/drivers/staging/greybus/audio_manager_sysfs.c index 376e17cb6cd7..fc0aca6fe912 100644 --- a/drivers/staging/greybus/audio_manager_sysfs.c +++ b/drivers/staging/greybus/audio_manager_sysfs.c @@ -20,10 +20,10 @@ static ssize_t manager_sysfs_add_store( int num = sscanf(buf, "name=%" GB_AUDIO_MANAGER_MODULE_NAME_LEN_SSCANF "s " - "slot=%d vid=%d pid=%d cport=%d i/p devices=0x%X" + "slot=%d vid=%d pid=%d intf_id=%d i/p devices=0x%X" "o/p devices=0x%X", desc.name, &desc.slot, &desc.vid, &desc.pid, - &desc.cport, &desc.ip_devices, &desc.op_devices); + &desc.intf_id, &desc.ip_devices, &desc.op_devices); if (num != 7) return -EINVAL; diff --git a/drivers/staging/greybus/audio_module.c b/drivers/staging/greybus/audio_module.c index ae1c0fa85752..45b2519322c3 100644 --- a/drivers/staging/greybus/audio_module.c +++ b/drivers/staging/greybus/audio_module.c @@ -348,7 +348,7 @@ static int gb_audio_probe(struct gb_bundle *bundle, desc.slot = 1; /* todo */ desc.vid = 2; /* todo */ desc.pid = 3; /* todo */ - desc.cport = gbmodule->dev_id; + desc.intf_id = gbmodule->dev_id; desc.op_devices = gbmodule->op_devices; desc.ip_devices = gbmodule->ip_devices; gbmodule->manager_id = gb_audio_manager_add(&desc);