]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
ALSA: firewire: Remove superfluous snd_info_register() calls
authorTakashi Iwai <tiwai@suse.de>
Tue, 5 Feb 2019 11:34:12 +0000 (12:34 +0100)
committerTakashi Iwai <tiwai@suse.de>
Wed, 6 Feb 2019 17:11:38 +0000 (18:11 +0100)
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: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Tested-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/firewire/bebob/bebob_proc.c
sound/firewire/dice/dice-proc.c
sound/firewire/digi00x/digi00x-proc.c
sound/firewire/fireface/ff-proc.c
sound/firewire/fireworks/fireworks_proc.c
sound/firewire/motu/motu-proc.c
sound/firewire/oxfw/oxfw-proc.c
sound/firewire/tascam/tascam-proc.c

index 8096891af9137a509e415cea4242a639a21c329b..05e2a1c6326cb597af0d3061f47db5c019a1246c 100644 (file)
@@ -163,12 +163,8 @@ add_node(struct snd_bebob *bebob, struct snd_info_entry *root, const char *name,
        struct snd_info_entry *entry;
 
        entry = snd_info_create_card_entry(bebob->card, name, root);
-       if (entry == NULL)
-               return;
-
-       snd_info_set_text_ops(entry, bebob, op);
-       if (snd_info_register(entry) < 0)
-               snd_info_free_entry(entry);
+       if (entry)
+               snd_info_set_text_ops(entry, bebob, op);
 }
 
 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)
                return;
        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, "firmware", proc_read_hw_info);
index bb870fc73f99f08ac34d4a921c88c8f26a63b4b7..9b1d509c6320c528f76520432409ad7f300b4be3 100644 (file)
@@ -285,12 +285,8 @@ static void add_node(struct snd_dice *dice, struct snd_info_entry *root,
        struct snd_info_entry *entry;
 
        entry = snd_info_create_card_entry(dice->card, name, root);
-       if (!entry)
-               return;
-
-       snd_info_set_text_ops(entry, dice, op);
-       if (snd_info_register(entry) < 0)
-               snd_info_free_entry(entry);
+       if (entry)
+               snd_info_set_text_ops(entry, dice, op);
 }
 
 void snd_dice_create_proc(struct snd_dice *dice)
@@ -306,10 +302,6 @@ void snd_dice_create_proc(struct snd_dice *dice)
        if (!root)
                return;
        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, "formation", dice_proc_read_formation);
index 6996d5a6ff5f7ce61cb97a803a18313cd46bc3f9..d22e8675b10fa02012b5a33689d1866615fb880e 100644 (file)
@@ -80,20 +80,8 @@ void snd_dg00x_proc_init(struct snd_dg00x *dg00x)
                return;
 
        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);
-       if (entry == NULL) {
-               snd_info_free_entry(root);
-               return;
-       }
-
-       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);
-       }
+       if (entry)
+               snd_info_set_text_ops(entry, dg00x, proc_read_clock);
 }
index a55e68ec18321013c223413a8705b71e417e938e..b886b541c94baaa5e16e8515990510e0662f9bae 100644 (file)
@@ -41,12 +41,8 @@ static void add_node(struct snd_ff *ff, struct snd_info_entry *root,
        struct snd_info_entry *entry;
 
        entry = snd_info_create_card_entry(ff->card, name, root);
-       if (entry == NULL)
-               return;
-
-       snd_info_set_text_ops(entry, ff, op);
-       if (snd_info_register(entry) < 0)
-               snd_info_free_entry(entry);
+       if (entry)
+               snd_info_set_text_ops(entry, ff, op);
 }
 
 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)
                return;
        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);
 }
index 779ecec5af62abc8b4bad53bbecb1b07049e01d5..9fa5c34a95726ad5850bdc44c4f42459ba2e3ad5 100644 (file)
@@ -199,12 +199,8 @@ add_node(struct snd_efw *efw, struct snd_info_entry *root, const char *name,
        struct snd_info_entry *entry;
 
        entry = snd_info_create_card_entry(efw->card, name, root);
-       if (entry == NULL)
-               return;
-
-       snd_info_set_text_ops(entry, efw, op);
-       if (snd_info_register(entry) < 0)
-               snd_info_free_entry(entry);
+       if (entry)
+               snd_info_set_text_ops(entry, efw, op);
 }
 
 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)
                return;
        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, "firmware", proc_read_hwinfo);
index ab6830a6d242f00048d3451549bb50b81f9e6fad..94327853620a3d357768d739d596ba16302babbd 100644 (file)
@@ -87,12 +87,8 @@ static void add_node(struct snd_motu *motu, struct snd_info_entry *root,
        struct snd_info_entry *entry;
 
        entry = snd_info_create_card_entry(motu->card, name, root);
-       if (entry == NULL)
-               return;
-
-       snd_info_set_text_ops(entry, motu, op);
-       if (snd_info_register(entry) < 0)
-               snd_info_free_entry(entry);
+       if (entry)
+               snd_info_set_text_ops(entry, motu, op);
 }
 
 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)
                return;
        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, "format", proc_read_format);
index 27dac071bc7394969c671c9406b93f917c498766..644107e3782e854aad3018b35d812b8ee0ba08c4 100644 (file)
@@ -83,12 +83,8 @@ static void add_node(struct snd_oxfw *oxfw, struct snd_info_entry *root,
        struct snd_info_entry *entry;
 
        entry = snd_info_create_card_entry(oxfw->card, name, root);
-       if (entry == NULL)
-               return;
-
-       snd_info_set_text_ops(entry, oxfw, op);
-       if (snd_info_register(entry) < 0)
-               snd_info_free_entry(entry);
+       if (entry)
+               snd_info_set_text_ops(entry, oxfw, op);
 }
 
 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)
                return;
        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);
 }
index fee3bf32a0daa2747b367f67fed759de3fa18507..8bc8d277394a332d8c32fc1a8a488b5a98f784ce 100644 (file)
@@ -58,12 +58,8 @@ static void add_node(struct snd_tscm *tscm, struct snd_info_entry *root,
        struct snd_info_entry *entry;
 
        entry = snd_info_create_card_entry(tscm->card, name, root);
-       if (entry == NULL)
-               return;
-
-       snd_info_set_text_ops(entry, tscm, op);
-       if (snd_info_register(entry) < 0)
-               snd_info_free_entry(entry);
+       if (entry)
+               snd_info_set_text_ops(entry, tscm, op);
 }
 
 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)
                return;
        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);
 }