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 <pankaj.bharadiya@gmail.com>
Reviewed-by: Vaibhav Agarwal <vaibhav.sr@gmail.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Pankaj Bharadiya 2016-10-16 15:29:14 +05:30 committed by Greg Kroah-Hartman
parent 08f2a14c97
commit d0af1bd5f6
4 changed files with 14 additions and 14 deletions

View File

@ -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;
};

View File

@ -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);
}

View File

@ -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;

View File

@ -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);