Commit 0c298bdc authored by Takashi Iwai's avatar Takashi Iwai

ALSA: firewire: Remove superfluous snd_info_register() calls

The calls of snd_info_register() are superfluous and should be avoided
at the procfs creation time.  They are called at the end of the whole
initialization via snd_card_register().  This patch drops such
superfluous calls.
Reviewed-by: default avatarTakashi Sakamoto <o-takashi@sakamocchi.jp>
Tested-by: default avatarTakashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 348c5ad5
...@@ -163,12 +163,8 @@ add_node(struct snd_bebob *bebob, struct snd_info_entry *root, const char *name, ...@@ -163,12 +163,8 @@ add_node(struct snd_bebob *bebob, struct snd_info_entry *root, const char *name,
struct snd_info_entry *entry; struct snd_info_entry *entry;
entry = snd_info_create_card_entry(bebob->card, name, root); entry = snd_info_create_card_entry(bebob->card, name, root);
if (entry == NULL) if (entry)
return;
snd_info_set_text_ops(entry, bebob, op); snd_info_set_text_ops(entry, bebob, op);
if (snd_info_register(entry) < 0)
snd_info_free_entry(entry);
} }
void snd_bebob_proc_init(struct snd_bebob *bebob) void snd_bebob_proc_init(struct snd_bebob *bebob)
...@@ -184,10 +180,6 @@ void snd_bebob_proc_init(struct snd_bebob *bebob) ...@@ -184,10 +180,6 @@ void snd_bebob_proc_init(struct snd_bebob *bebob)
if (root == NULL) if (root == NULL)
return; return;
root->mode = S_IFDIR | 0555; root->mode = S_IFDIR | 0555;
if (snd_info_register(root) < 0) {
snd_info_free_entry(root);
return;
}
add_node(bebob, root, "clock", proc_read_clock); add_node(bebob, root, "clock", proc_read_clock);
add_node(bebob, root, "firmware", proc_read_hw_info); add_node(bebob, root, "firmware", proc_read_hw_info);
......
...@@ -285,12 +285,8 @@ static void add_node(struct snd_dice *dice, struct snd_info_entry *root, ...@@ -285,12 +285,8 @@ static void add_node(struct snd_dice *dice, struct snd_info_entry *root,
struct snd_info_entry *entry; struct snd_info_entry *entry;
entry = snd_info_create_card_entry(dice->card, name, root); entry = snd_info_create_card_entry(dice->card, name, root);
if (!entry) if (entry)
return;
snd_info_set_text_ops(entry, dice, op); snd_info_set_text_ops(entry, dice, op);
if (snd_info_register(entry) < 0)
snd_info_free_entry(entry);
} }
void snd_dice_create_proc(struct snd_dice *dice) void snd_dice_create_proc(struct snd_dice *dice)
...@@ -306,10 +302,6 @@ void snd_dice_create_proc(struct snd_dice *dice) ...@@ -306,10 +302,6 @@ void snd_dice_create_proc(struct snd_dice *dice)
if (!root) if (!root)
return; return;
root->mode = S_IFDIR | 0555; root->mode = S_IFDIR | 0555;
if (snd_info_register(root) < 0) {
snd_info_free_entry(root);
return;
}
add_node(dice, root, "dice", dice_proc_read); add_node(dice, root, "dice", dice_proc_read);
add_node(dice, root, "formation", dice_proc_read_formation); add_node(dice, root, "formation", dice_proc_read_formation);
......
...@@ -80,20 +80,8 @@ void snd_dg00x_proc_init(struct snd_dg00x *dg00x) ...@@ -80,20 +80,8 @@ void snd_dg00x_proc_init(struct snd_dg00x *dg00x)
return; return;
root->mode = S_IFDIR | 0555; root->mode = S_IFDIR | 0555;
if (snd_info_register(root) < 0) {
snd_info_free_entry(root);
return;
}
entry = snd_info_create_card_entry(dg00x->card, "clock", root); entry = snd_info_create_card_entry(dg00x->card, "clock", root);
if (entry == NULL) { if (entry)
snd_info_free_entry(root);
return;
}
snd_info_set_text_ops(entry, dg00x, proc_read_clock); snd_info_set_text_ops(entry, dg00x, proc_read_clock);
if (snd_info_register(entry) < 0) {
snd_info_free_entry(entry);
snd_info_free_entry(root);
}
} }
...@@ -41,12 +41,8 @@ static void add_node(struct snd_ff *ff, struct snd_info_entry *root, ...@@ -41,12 +41,8 @@ static void add_node(struct snd_ff *ff, struct snd_info_entry *root,
struct snd_info_entry *entry; struct snd_info_entry *entry;
entry = snd_info_create_card_entry(ff->card, name, root); entry = snd_info_create_card_entry(ff->card, name, root);
if (entry == NULL) if (entry)
return;
snd_info_set_text_ops(entry, ff, op); snd_info_set_text_ops(entry, ff, op);
if (snd_info_register(entry) < 0)
snd_info_free_entry(entry);
} }
void snd_ff_proc_init(struct snd_ff *ff) void snd_ff_proc_init(struct snd_ff *ff)
...@@ -62,10 +58,6 @@ void snd_ff_proc_init(struct snd_ff *ff) ...@@ -62,10 +58,6 @@ void snd_ff_proc_init(struct snd_ff *ff)
if (root == NULL) if (root == NULL)
return; return;
root->mode = S_IFDIR | 0555; root->mode = S_IFDIR | 0555;
if (snd_info_register(root) < 0) {
snd_info_free_entry(root);
return;
}
add_node(ff, root, "status", proc_dump_status); add_node(ff, root, "status", proc_dump_status);
} }
...@@ -199,12 +199,8 @@ add_node(struct snd_efw *efw, struct snd_info_entry *root, const char *name, ...@@ -199,12 +199,8 @@ add_node(struct snd_efw *efw, struct snd_info_entry *root, const char *name,
struct snd_info_entry *entry; struct snd_info_entry *entry;
entry = snd_info_create_card_entry(efw->card, name, root); entry = snd_info_create_card_entry(efw->card, name, root);
if (entry == NULL) if (entry)
return;
snd_info_set_text_ops(entry, efw, op); snd_info_set_text_ops(entry, efw, op);
if (snd_info_register(entry) < 0)
snd_info_free_entry(entry);
} }
void snd_efw_proc_init(struct snd_efw *efw) void snd_efw_proc_init(struct snd_efw *efw)
...@@ -220,10 +216,6 @@ void snd_efw_proc_init(struct snd_efw *efw) ...@@ -220,10 +216,6 @@ void snd_efw_proc_init(struct snd_efw *efw)
if (root == NULL) if (root == NULL)
return; return;
root->mode = S_IFDIR | 0555; root->mode = S_IFDIR | 0555;
if (snd_info_register(root) < 0) {
snd_info_free_entry(root);
return;
}
add_node(efw, root, "clock", proc_read_clock); add_node(efw, root, "clock", proc_read_clock);
add_node(efw, root, "firmware", proc_read_hwinfo); add_node(efw, root, "firmware", proc_read_hwinfo);
......
...@@ -87,12 +87,8 @@ static void add_node(struct snd_motu *motu, struct snd_info_entry *root, ...@@ -87,12 +87,8 @@ static void add_node(struct snd_motu *motu, struct snd_info_entry *root,
struct snd_info_entry *entry; struct snd_info_entry *entry;
entry = snd_info_create_card_entry(motu->card, name, root); entry = snd_info_create_card_entry(motu->card, name, root);
if (entry == NULL) if (entry)
return;
snd_info_set_text_ops(entry, motu, op); snd_info_set_text_ops(entry, motu, op);
if (snd_info_register(entry) < 0)
snd_info_free_entry(entry);
} }
void snd_motu_proc_init(struct snd_motu *motu) void snd_motu_proc_init(struct snd_motu *motu)
...@@ -108,10 +104,6 @@ void snd_motu_proc_init(struct snd_motu *motu) ...@@ -108,10 +104,6 @@ void snd_motu_proc_init(struct snd_motu *motu)
if (root == NULL) if (root == NULL)
return; return;
root->mode = S_IFDIR | 0555; root->mode = S_IFDIR | 0555;
if (snd_info_register(root) < 0) {
snd_info_free_entry(root);
return;
}
add_node(motu, root, "clock", proc_read_clock); add_node(motu, root, "clock", proc_read_clock);
add_node(motu, root, "format", proc_read_format); add_node(motu, root, "format", proc_read_format);
......
...@@ -83,12 +83,8 @@ static void add_node(struct snd_oxfw *oxfw, struct snd_info_entry *root, ...@@ -83,12 +83,8 @@ static void add_node(struct snd_oxfw *oxfw, struct snd_info_entry *root,
struct snd_info_entry *entry; struct snd_info_entry *entry;
entry = snd_info_create_card_entry(oxfw->card, name, root); entry = snd_info_create_card_entry(oxfw->card, name, root);
if (entry == NULL) if (entry)
return;
snd_info_set_text_ops(entry, oxfw, op); snd_info_set_text_ops(entry, oxfw, op);
if (snd_info_register(entry) < 0)
snd_info_free_entry(entry);
} }
void snd_oxfw_proc_init(struct snd_oxfw *oxfw) void snd_oxfw_proc_init(struct snd_oxfw *oxfw)
...@@ -104,10 +100,6 @@ void snd_oxfw_proc_init(struct snd_oxfw *oxfw) ...@@ -104,10 +100,6 @@ void snd_oxfw_proc_init(struct snd_oxfw *oxfw)
if (root == NULL) if (root == NULL)
return; return;
root->mode = S_IFDIR | 0555; root->mode = S_IFDIR | 0555;
if (snd_info_register(root) < 0) {
snd_info_free_entry(root);
return;
}
add_node(oxfw, root, "formation", proc_read_formation); add_node(oxfw, root, "formation", proc_read_formation);
} }
...@@ -58,12 +58,8 @@ static void add_node(struct snd_tscm *tscm, struct snd_info_entry *root, ...@@ -58,12 +58,8 @@ static void add_node(struct snd_tscm *tscm, struct snd_info_entry *root,
struct snd_info_entry *entry; struct snd_info_entry *entry;
entry = snd_info_create_card_entry(tscm->card, name, root); entry = snd_info_create_card_entry(tscm->card, name, root);
if (entry == NULL) if (entry)
return;
snd_info_set_text_ops(entry, tscm, op); snd_info_set_text_ops(entry, tscm, op);
if (snd_info_register(entry) < 0)
snd_info_free_entry(entry);
} }
void snd_tscm_proc_init(struct snd_tscm *tscm) void snd_tscm_proc_init(struct snd_tscm *tscm)
...@@ -79,10 +75,6 @@ void snd_tscm_proc_init(struct snd_tscm *tscm) ...@@ -79,10 +75,6 @@ void snd_tscm_proc_init(struct snd_tscm *tscm)
if (root == NULL) if (root == NULL)
return; return;
root->mode = S_IFDIR | 0555; root->mode = S_IFDIR | 0555;
if (snd_info_register(root) < 0) {
snd_info_free_entry(root);
return;
}
add_node(tscm, root, "firmware", proc_read_firmware); add_node(tscm, root, "firmware", proc_read_firmware);
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment