Skip to content

Commit b046d24

Browse files
committed
ALSA: core: Remove superfluous exit calls for proc entries
Since each proc entry is freed automatically by the parent, we don't have to take care of its life cycle any longer. This allows us to reduce a few more lines of codes. Acked-by: Jaroslav Kysela <perex@perex.cz> Signed-off-by: Takashi Iwai <tiwai@suse.de>
1 parent 644dbd6 commit b046d24

5 files changed

Lines changed: 1 addition & 47 deletions

File tree

‎include/sound/core.h‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -224,16 +224,13 @@ void *snd_lookup_oss_minor_data(unsigned int minor, int type);
224224
#endif
225225

226226
int snd_minor_info_init(void);
227-
int snd_minor_info_done(void);
228227

229228
/* sound_oss.c */
230229

231230
#ifdef CONFIG_SND_OSSEMUL
232231
int snd_minor_info_oss_init(void);
233-
int snd_minor_info_oss_done(void);
234232
#else
235233
static inline int snd_minor_info_oss_init(void) { return 0; }
236-
static inline int snd_minor_info_oss_done(void) { return 0; }
237234
#endif
238235

239236
/* memory.c */
@@ -262,7 +259,6 @@ int snd_card_free_when_closed(struct snd_card *card);
262259
void snd_card_set_id(struct snd_card *card, const char *id);
263260
int snd_card_register(struct snd_card *card);
264261
int snd_card_info_init(void);
265-
int snd_card_info_done(void);
266262
int snd_card_add_dev_attr(struct snd_card *card,
267263
const struct attribute_group *group);
268264
int snd_component_add(struct snd_card *card, const char *component);

‎sound/core/info.c‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -495,9 +495,6 @@ int __init snd_info_init(void)
495495

496496
int __exit snd_info_done(void)
497497
{
498-
snd_card_info_done();
499-
snd_minor_info_oss_done();
500-
snd_minor_info_done();
501498
snd_info_free_entry(snd_proc_root);
502499
return 0;
503500
}

‎sound/core/init.c‎

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -783,8 +783,6 @@ int snd_card_register(struct snd_card *card)
783783
EXPORT_SYMBOL(snd_card_register);
784784

785785
#ifdef CONFIG_PROC_FS
786-
static struct snd_info_entry *snd_card_info_entry;
787-
788786
static void snd_card_info_read(struct snd_info_entry *entry,
789787
struct snd_info_buffer *buffer)
790788
{
@@ -810,7 +808,6 @@ static void snd_card_info_read(struct snd_info_entry *entry,
810808
}
811809

812810
#ifdef CONFIG_SND_OSSEMUL
813-
814811
void snd_card_info_read_oss(struct snd_info_buffer *buffer)
815812
{
816813
int idx, count;
@@ -832,7 +829,6 @@ void snd_card_info_read_oss(struct snd_info_buffer *buffer)
832829
#endif
833830

834831
#ifdef MODULE
835-
static struct snd_info_entry *snd_card_module_info_entry;
836832
static void snd_card_module_info_read(struct snd_info_entry *entry,
837833
struct snd_info_buffer *buffer)
838834
{
@@ -861,31 +857,18 @@ int __init snd_card_info_init(void)
861857
snd_info_free_entry(entry);
862858
return -ENOMEM;
863859
}
864-
snd_card_info_entry = entry;
865860

866861
#ifdef MODULE
867862
entry = snd_info_create_module_entry(THIS_MODULE, "modules", NULL);
868863
if (entry) {
869864
entry->c.text.read = snd_card_module_info_read;
870865
if (snd_info_register(entry) < 0)
871866
snd_info_free_entry(entry);
872-
else
873-
snd_card_module_info_entry = entry;
874867
}
875868
#endif
876869

877870
return 0;
878871
}
879-
880-
int __exit snd_card_info_done(void)
881-
{
882-
snd_info_free_entry(snd_card_info_entry);
883-
#ifdef MODULE
884-
snd_info_free_entry(snd_card_module_info_entry);
885-
#endif
886-
return 0;
887-
}
888-
889872
#endif /* CONFIG_PROC_FS */
890873

891874
/**

‎sound/core/sound.c‎

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -334,9 +334,6 @@ EXPORT_SYMBOL(snd_unregister_device);
334334
/*
335335
* INFO PART
336336
*/
337-
338-
static struct snd_info_entry *snd_minor_info_entry;
339-
340337
static const char *snd_device_type_name(int type)
341338
{
342339
switch (type) {
@@ -396,13 +393,6 @@ int __init snd_minor_info_init(void)
396393
entry = NULL;
397394
}
398395
}
399-
snd_minor_info_entry = entry;
400-
return 0;
401-
}
402-
403-
int __exit snd_minor_info_done(void)
404-
{
405-
snd_info_free_entry(snd_minor_info_entry);
406396
return 0;
407397
}
408398
#endif /* CONFIG_PROC_FS */

‎sound/core/sound_oss.c‎

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -214,9 +214,6 @@ EXPORT_SYMBOL(snd_unregister_oss_device);
214214
*/
215215

216216
#ifdef CONFIG_PROC_FS
217-
218-
static struct snd_info_entry *snd_minor_info_oss_entry;
219-
220217
static const char *snd_oss_device_type_name(int type)
221218
{
222219
switch (type) {
@@ -265,18 +262,9 @@ int __init snd_minor_info_oss_init(void)
265262
entry = snd_info_create_module_entry(THIS_MODULE, "devices", snd_oss_root);
266263
if (entry) {
267264
entry->c.text.read = snd_minor_info_oss_read;
268-
if (snd_info_register(entry) < 0) {
265+
if (snd_info_register(entry) < 0)
269266
snd_info_free_entry(entry);
270-
entry = NULL;
271-
}
272267
}
273-
snd_minor_info_oss_entry = entry;
274-
return 0;
275-
}
276-
277-
int __exit snd_minor_info_oss_done(void)
278-
{
279-
snd_info_free_entry(snd_minor_info_oss_entry);
280268
return 0;
281269
}
282270
#endif /* CONFIG_PROC_FS */

0 commit comments

Comments
 (0)