Skip to content

Commit 49b9137

Browse files
bpankajlgregkh
authored andcommitted
staging: greybus: audio: remove redundant slot field
gb_audio_manager_module_descriptor's intf_id field maintains the information about the interface on which module is connected hence having an extra slot field is redundant. Thus remove the slot field and its associated code. Signed-off-by: Pankaj Bharadiya <[email protected]> Acked-by: Viresh Kumar <[email protected]> Reviewed-by: Vaibhav Agarwal <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 73270bb commit 49b9137

File tree

5 files changed

+4
-23
lines changed

5 files changed

+4
-23
lines changed

drivers/staging/greybus/audio_codec.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,6 @@ struct gbaudio_module_info {
158158
int dev_id; /* check if it should be bundle_id/hd_cport_id */
159159
int vid;
160160
int pid;
161-
int slot;
162161
int type;
163162
int set_uevent;
164163
char vstr[NAME_SIZE];

drivers/staging/greybus/audio_manager.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818

1919
struct gb_audio_manager_module_descriptor {
2020
char name[GB_AUDIO_MANAGER_MODULE_NAME_LEN];
21-
int slot;
2221
int vid;
2322
int pid;
2423
int intf_id;

drivers/staging/greybus/audio_manager_module.c

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -81,16 +81,6 @@ static ssize_t gb_audio_module_name_show(
8181
static struct gb_audio_manager_module_attribute gb_audio_module_name_attribute =
8282
__ATTR(name, 0664, gb_audio_module_name_show, NULL);
8383

84-
static ssize_t gb_audio_module_slot_show(
85-
struct gb_audio_manager_module *module,
86-
struct gb_audio_manager_module_attribute *attr, char *buf)
87-
{
88-
return sprintf(buf, "%d", module->desc.slot);
89-
}
90-
91-
static struct gb_audio_manager_module_attribute gb_audio_module_slot_attribute =
92-
__ATTR(slot, 0664, gb_audio_module_slot_show, NULL);
93-
9484
static ssize_t gb_audio_module_vid_show(
9585
struct gb_audio_manager_module *module,
9686
struct gb_audio_manager_module_attribute *attr, char *buf)
@@ -146,7 +136,6 @@ static struct gb_audio_manager_module_attribute
146136

147137
static struct attribute *gb_audio_module_default_attrs[] = {
148138
&gb_audio_module_name_attribute.attr,
149-
&gb_audio_module_slot_attribute.attr,
150139
&gb_audio_module_vid_attribute.attr,
151140
&gb_audio_module_pid_attribute.attr,
152141
&gb_audio_module_intf_id_attribute.attr,
@@ -164,7 +153,6 @@ static struct kobj_type gb_audio_module_type = {
164153
static void send_add_uevent(struct gb_audio_manager_module *module)
165154
{
166155
char name_string[128];
167-
char slot_string[64];
168156
char vid_string[64];
169157
char pid_string[64];
170158
char intf_id_string[64];
@@ -173,7 +161,6 @@ static void send_add_uevent(struct gb_audio_manager_module *module)
173161

174162
char *envp[] = {
175163
name_string,
176-
slot_string,
177164
vid_string,
178165
pid_string,
179166
intf_id_string,
@@ -183,7 +170,6 @@ static void send_add_uevent(struct gb_audio_manager_module *module)
183170
};
184171

185172
snprintf(name_string, 128, "NAME=%s", module->desc.name);
186-
snprintf(slot_string, 64, "SLOT=%d", module->desc.slot);
187173
snprintf(vid_string, 64, "VID=%d", module->desc.vid);
188174
snprintf(pid_string, 64, "PID=%d", module->desc.pid);
189175
snprintf(intf_id_string, 64, "INTF_ID=%d", module->desc.intf_id);
@@ -246,10 +232,9 @@ int gb_audio_manager_module_create(
246232

247233
void gb_audio_manager_module_dump(struct gb_audio_manager_module *module)
248234
{
249-
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",
235+
pr_info("audio module #%d name=%s vid=%d pid=%d intf_id=%d i/p devices=0x%X o/p devices=0x%X\n",
250236
module->id,
251237
module->desc.name,
252-
module->desc.slot,
253238
module->desc.vid,
254239
module->desc.pid,
255240
module->desc.intf_id,

drivers/staging/greybus/audio_manager_sysfs.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,9 @@ static ssize_t manager_sysfs_add_store(
2020

2121
int num = sscanf(buf,
2222
"name=%" GB_AUDIO_MANAGER_MODULE_NAME_LEN_SSCANF "s "
23-
"slot=%d vid=%d pid=%d intf_id=%d i/p devices=0x%X"
24-
"o/p devices=0x%X",
25-
desc.name, &desc.slot, &desc.vid, &desc.pid,
26-
&desc.intf_id, &desc.ip_devices, &desc.op_devices);
23+
"vid=%d pid=%d intf_id=%d i/p devices=0x%X o/p devices=0x%X",
24+
desc.name, &desc.vid, &desc.pid, &desc.intf_id,
25+
&desc.ip_devices, &desc.op_devices);
2726

2827
if (num != 7)
2928
return -EINVAL;

drivers/staging/greybus/audio_module.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,6 @@ static int gb_audio_probe(struct gb_bundle *bundle,
345345
dev_dbg(dev, "Inform set_event:%d to above layer\n", 1);
346346
/* prepare for the audio manager */
347347
strlcpy(desc.name, gbmodule->name, GB_AUDIO_MANAGER_MODULE_NAME_LEN);
348-
desc.slot = 1; /* todo */
349348
desc.vid = 2; /* todo */
350349
desc.pid = 3; /* todo */
351350
desc.intf_id = gbmodule->dev_id;

0 commit comments

Comments
 (0)