aboutsummaryrefslogtreecommitdiffstats
path: root/sound/core/hwdep.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2005-12-01 04:42:42 -0500
committerJaroslav Kysela <perex@suse.cz>2006-01-03 06:30:02 -0500
commite28563cceb9f258ebe3c50fc27d8f4ff0ac4bfa4 (patch)
treeb69095abb998dedc2953368ba2c75978d80f644a /sound/core/hwdep.c
parent7cd01dd840824e7c6023ad1dbfdb94a2183a7adb (diff)
[ALSA] Optimize for config without PROC_FS
Modules: HWDEP Midlevel,ALSA Core,PCM Midlevel,Timer Midlevel Optimize the code when compiled without CONFIG_PROC_FS. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/core/hwdep.c')
-rw-r--r--sound/core/hwdep.c33
1 files changed, 23 insertions, 10 deletions
diff --git a/sound/core/hwdep.c b/sound/core/hwdep.c
index b8c0c8c4d126..618c43be0bc3 100644
--- a/sound/core/hwdep.c
+++ b/sound/core/hwdep.c
@@ -458,6 +458,7 @@ static int snd_hwdep_dev_unregister(struct snd_device *device)
458 return snd_hwdep_free(hwdep); 458 return snd_hwdep_free(hwdep);
459} 459}
460 460
461#ifdef CONFIG_PROC_FS
461/* 462/*
462 * Info interface 463 * Info interface
463 */ 464 */
@@ -477,13 +478,9 @@ static void snd_hwdep_proc_read(struct snd_info_entry *entry,
477 up(&register_mutex); 478 up(&register_mutex);
478} 479}
479 480
480/* 481static struct snd_info_entry *snd_hwdep_proc_entry;
481 * ENTRY functions
482 */
483 482
484static struct snd_info_entry *snd_hwdep_proc_entry = NULL; 483static void __init snd_hwdep_proc_init(void)
485
486static int __init alsa_hwdep_init(void)
487{ 484{
488 struct snd_info_entry *entry; 485 struct snd_info_entry *entry;
489 486
@@ -496,6 +493,25 @@ static int __init alsa_hwdep_init(void)
496 } 493 }
497 } 494 }
498 snd_hwdep_proc_entry = entry; 495 snd_hwdep_proc_entry = entry;
496}
497
498static void __exit snd_hwdep_proc_done(void)
499{
500 snd_info_unregister(snd_hwdep_proc_entry);
501}
502#else /* !CONFIG_PROC_FS */
503#define snd_hwdep_proc_init()
504#define snd_hwdep_proc_done()
505#endif /* CONFIG_PROC_FS */
506
507
508/*
509 * ENTRY functions
510 */
511
512static int __init alsa_hwdep_init(void)
513{
514 snd_hwdep_proc_init();
499 snd_ctl_register_ioctl(snd_hwdep_control_ioctl); 515 snd_ctl_register_ioctl(snd_hwdep_control_ioctl);
500 snd_ctl_register_ioctl_compat(snd_hwdep_control_ioctl); 516 snd_ctl_register_ioctl_compat(snd_hwdep_control_ioctl);
501 return 0; 517 return 0;
@@ -505,10 +521,7 @@ static void __exit alsa_hwdep_exit(void)
505{ 521{
506 snd_ctl_unregister_ioctl(snd_hwdep_control_ioctl); 522 snd_ctl_unregister_ioctl(snd_hwdep_control_ioctl);
507 snd_ctl_unregister_ioctl_compat(snd_hwdep_control_ioctl); 523 snd_ctl_unregister_ioctl_compat(snd_hwdep_control_ioctl);
508 if (snd_hwdep_proc_entry) { 524 snd_hwdep_proc_done();
509 snd_info_unregister(snd_hwdep_proc_entry);
510 snd_hwdep_proc_entry = NULL;
511 }
512} 525}
513 526
514module_init(alsa_hwdep_init) 527module_init(alsa_hwdep_init)