aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2005-12-01 04:43:51 -0500
committerJaroslav Kysela <perex@suse.cz>2006-01-03 06:30:05 -0500
commit04f141a8800d022981f0405a8d307c98aba55105 (patch)
tree2083ebe4a2959d57db1c016f1b8fa396e5c3f2af /sound
parente28563cceb9f258ebe3c50fc27d8f4ff0ac4bfa4 (diff)
[ALSA] Optimize for config without PROC_FS (seq and oss parts)
Modules: ALSA<-OSS emulation,ALSA sequencer,ALSA<-OSS sequencer Optimize the code when compiled without CONFIG_PROC_FS (in seq and oss emulation parts). Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound')
-rw-r--r--sound/core/oss/mixer_oss.c5
-rw-r--r--sound/core/oss/pcm_oss.c5
-rw-r--r--sound/core/seq/oss/seq_oss.c14
-rw-r--r--sound/core/seq/oss/seq_oss_init.c3
-rw-r--r--sound/core/seq/oss/seq_oss_midi.c3
-rw-r--r--sound/core/seq/oss/seq_oss_readq.c2
-rw-r--r--sound/core/seq/oss/seq_oss_synth.c3
-rw-r--r--sound/core/seq/seq_clientmgr.c3
-rw-r--r--sound/core/seq/seq_device.c8
-rw-r--r--sound/core/seq/seq_info.c13
-rw-r--r--sound/core/seq/seq_info.h6
-rw-r--r--sound/core/seq/seq_queue.c3
-rw-r--r--sound/core/seq/seq_timer.c3
13 files changed, 50 insertions, 21 deletions
diff --git a/sound/core/oss/mixer_oss.c b/sound/core/oss/mixer_oss.c
index 2d7a42014f51..f08e65a2bffe 100644
--- a/sound/core/oss/mixer_oss.c
+++ b/sound/core/oss/mixer_oss.c
@@ -1053,6 +1053,7 @@ static int snd_mixer_oss_build_input(struct snd_mixer_oss *mixer, struct snd_mix
1053 return 0; 1053 return 0;
1054} 1054}
1055 1055
1056#ifdef CONFIG_PROC_FS
1056/* 1057/*
1057 */ 1058 */
1058#define MIXER_VOL(name) [SOUND_MIXER_##name] = #name 1059#define MIXER_VOL(name) [SOUND_MIXER_##name] = #name
@@ -1200,6 +1201,10 @@ static void snd_mixer_oss_proc_done(struct snd_mixer_oss *mixer)
1200 mixer->proc_entry = NULL; 1201 mixer->proc_entry = NULL;
1201 } 1202 }
1202} 1203}
1204#else /* !CONFIG_PROC_FS */
1205#define snd_mixer_oss_proc_init(mix)
1206#define snd_mixer_oss_proc_done(mix)
1207#endif /* CONFIG_PROC_FS */
1203 1208
1204static void snd_mixer_oss_build(struct snd_mixer_oss *mixer) 1209static void snd_mixer_oss_build(struct snd_mixer_oss *mixer)
1205{ 1210{
diff --git a/sound/core/oss/pcm_oss.c b/sound/core/oss/pcm_oss.c
index 2ae283c7b28a..16df1246a131 100644
--- a/sound/core/oss/pcm_oss.c
+++ b/sound/core/oss/pcm_oss.c
@@ -2269,6 +2269,7 @@ static int snd_pcm_oss_mmap(struct file *file, struct vm_area_struct *area)
2269 return 0; 2269 return 0;
2270} 2270}
2271 2271
2272#ifdef CONFIG_PROC_FS
2272/* 2273/*
2273 * /proc interface 2274 * /proc interface
2274 */ 2275 */
@@ -2420,6 +2421,10 @@ static void snd_pcm_oss_proc_done(struct snd_pcm *pcm)
2420 } 2421 }
2421 } 2422 }
2422} 2423}
2424#else /* !CONFIG_PROC_FS */
2425#define snd_pcm_oss_proc_init(pcm)
2426#define snd_pcm_oss_proc_done(pcm)
2427#endif /* CONFIG_PROC_FS */
2423 2428
2424/* 2429/*
2425 * ENTRY functions 2430 * ENTRY functions
diff --git a/sound/core/seq/oss/seq_oss.c b/sound/core/seq/oss/seq_oss.c
index 4b51ab56507b..c98f0ba13810 100644
--- a/sound/core/seq/oss/seq_oss.c
+++ b/sound/core/seq/oss/seq_oss.c
@@ -52,8 +52,13 @@ int seq_oss_debug = 0;
52 */ 52 */
53static int register_device(void); 53static int register_device(void);
54static void unregister_device(void); 54static void unregister_device(void);
55#ifdef CONFIG_PROC_FS
55static int register_proc(void); 56static int register_proc(void);
56static void unregister_proc(void); 57static void unregister_proc(void);
58#else
59static inline int register_proc(void) { return 0; }
60static inline void unregister_proc(void) {}
61#endif
57 62
58static int odev_open(struct inode *inode, struct file *file); 63static int odev_open(struct inode *inode, struct file *file);
59static int odev_release(struct inode *inode, struct file *file); 64static int odev_release(struct inode *inode, struct file *file);
@@ -61,9 +66,6 @@ static ssize_t odev_read(struct file *file, char __user *buf, size_t count, loff
61static ssize_t odev_write(struct file *file, const char __user *buf, size_t count, loff_t *offset); 66static ssize_t odev_write(struct file *file, const char __user *buf, size_t count, loff_t *offset);
62static long odev_ioctl(struct file *file, unsigned int cmd, unsigned long arg); 67static long odev_ioctl(struct file *file, unsigned int cmd, unsigned long arg);
63static unsigned int odev_poll(struct file *file, poll_table * wait); 68static unsigned int odev_poll(struct file *file, poll_table * wait);
64#ifdef CONFIG_PROC_FS
65static void info_read(struct snd_info_entry *entry, struct snd_info_buffer *buf);
66#endif
67 69
68 70
69/* 71/*
@@ -276,12 +278,10 @@ info_read(struct snd_info_entry *entry, struct snd_info_buffer *buf)
276 up(&register_mutex); 278 up(&register_mutex);
277} 279}
278 280
279#endif /* CONFIG_PROC_FS */
280 281
281static int __init 282static int __init
282register_proc(void) 283register_proc(void)
283{ 284{
284#ifdef CONFIG_PROC_FS
285 struct snd_info_entry *entry; 285 struct snd_info_entry *entry;
286 286
287 entry = snd_info_create_module_entry(THIS_MODULE, SNDRV_SEQ_OSS_PROCNAME, snd_seq_root); 287 entry = snd_info_create_module_entry(THIS_MODULE, SNDRV_SEQ_OSS_PROCNAME, snd_seq_root);
@@ -297,16 +297,14 @@ register_proc(void)
297 return -ENOMEM; 297 return -ENOMEM;
298 } 298 }
299 info_entry = entry; 299 info_entry = entry;
300#endif
301 return 0; 300 return 0;
302} 301}
303 302
304static void 303static void
305unregister_proc(void) 304unregister_proc(void)
306{ 305{
307#ifdef CONFIG_PROC_FS
308 if (info_entry) 306 if (info_entry)
309 snd_info_unregister(info_entry); 307 snd_info_unregister(info_entry);
310 info_entry = NULL; 308 info_entry = NULL;
311#endif
312} 309}
310#endif /* CONFIG_PROC_FS */
diff --git a/sound/core/seq/oss/seq_oss_init.c b/sound/core/seq/oss/seq_oss_init.c
index 1d4473eadcf3..97e2493e931f 100644
--- a/sound/core/seq/oss/seq_oss_init.c
+++ b/sound/core/seq/oss/seq_oss_init.c
@@ -502,6 +502,7 @@ snd_seq_oss_reset(struct seq_oss_devinfo *dp)
502} 502}
503 503
504 504
505#ifdef CONFIG_PROC_FS
505/* 506/*
506 * misc. functions for proc interface 507 * misc. functions for proc interface
507 */ 508 */
@@ -552,4 +553,4 @@ snd_seq_oss_system_info_read(struct snd_info_buffer *buf)
552 snd_seq_oss_readq_info_read(dp->readq, buf); 553 snd_seq_oss_readq_info_read(dp->readq, buf);
553 } 554 }
554} 555}
555 556#endif /* CONFIG_PROC_FS */
diff --git a/sound/core/seq/oss/seq_oss_midi.c b/sound/core/seq/oss/seq_oss_midi.c
index eb7ae990965c..0a711d2d04f0 100644
--- a/sound/core/seq/oss/seq_oss_midi.c
+++ b/sound/core/seq/oss/seq_oss_midi.c
@@ -668,6 +668,7 @@ snd_seq_oss_midi_make_info(struct seq_oss_devinfo *dp, int dev, struct midi_info
668} 668}
669 669
670 670
671#ifdef CONFIG_PROC_FS
671/* 672/*
672 * proc interface 673 * proc interface
673 */ 674 */
@@ -707,4 +708,4 @@ snd_seq_oss_midi_info_read(struct snd_info_buffer *buf)
707 snd_use_lock_free(&mdev->use_lock); 708 snd_use_lock_free(&mdev->use_lock);
708 } 709 }
709} 710}
710 711#endif /* CONFIG_PROC_FS */
diff --git a/sound/core/seq/oss/seq_oss_readq.c b/sound/core/seq/oss/seq_oss_readq.c
index abc70078add3..f5de79f29f1e 100644
--- a/sound/core/seq/oss/seq_oss_readq.c
+++ b/sound/core/seq/oss/seq_oss_readq.c
@@ -222,6 +222,7 @@ snd_seq_oss_readq_put_timestamp(struct seq_oss_readq *q, unsigned long curt, int
222} 222}
223 223
224 224
225#ifdef CONFIG_PROC_FS
225/* 226/*
226 * proc interface 227 * proc interface
227 */ 228 */
@@ -232,3 +233,4 @@ snd_seq_oss_readq_info_read(struct seq_oss_readq *q, struct snd_info_buffer *buf
232 (waitqueue_active(&q->midi_sleep) ? "sleeping":"running"), 233 (waitqueue_active(&q->midi_sleep) ? "sleeping":"running"),
233 q->qlen, q->input_time); 234 q->qlen, q->input_time);
234} 235}
236#endif /* CONFIG_PROC_FS */
diff --git a/sound/core/seq/oss/seq_oss_synth.c b/sound/core/seq/oss/seq_oss_synth.c
index 0b6025c92b9e..ab570a0a6183 100644
--- a/sound/core/seq/oss/seq_oss_synth.c
+++ b/sound/core/seq/oss/seq_oss_synth.c
@@ -621,6 +621,7 @@ snd_seq_oss_synth_make_info(struct seq_oss_devinfo *dp, int dev, struct synth_in
621} 621}
622 622
623 623
624#ifdef CONFIG_PROC_FS
624/* 625/*
625 * proc interface 626 * proc interface
626 */ 627 */
@@ -648,4 +649,4 @@ snd_seq_oss_synth_info_read(struct snd_info_buffer *buf)
648 snd_use_lock_free(&rec->use_lock); 649 snd_use_lock_free(&rec->use_lock);
649 } 650 }
650} 651}
651 652#endif /* CONFIG_PROC_FS */
diff --git a/sound/core/seq/seq_clientmgr.c b/sound/core/seq/seq_clientmgr.c
index 2a9c6b316b14..9c32fd262f8d 100644
--- a/sound/core/seq/seq_clientmgr.c
+++ b/sound/core/seq/seq_clientmgr.c
@@ -2413,6 +2413,7 @@ int snd_seq_kernel_client_write_poll(int clientid, struct file *file, poll_table
2413 2413
2414/*---------------------------------------------------------------------------*/ 2414/*---------------------------------------------------------------------------*/
2415 2415
2416#ifdef CONFIG_PROC_FS
2416/* 2417/*
2417 * /proc interface 2418 * /proc interface
2418 */ 2419 */
@@ -2518,7 +2519,7 @@ void snd_seq_info_clients_read(struct snd_info_entry *entry,
2518 snd_seq_client_unlock(client); 2519 snd_seq_client_unlock(client);
2519 } 2520 }
2520} 2521}
2521 2522#endif /* CONFIG_PROC_FS */
2522 2523
2523/*---------------------------------------------------------------------------*/ 2524/*---------------------------------------------------------------------------*/
2524 2525
diff --git a/sound/core/seq/seq_device.c b/sound/core/seq/seq_device.c
index 3f935a18b5e7..9ece443fba55 100644
--- a/sound/core/seq/seq_device.c
+++ b/sound/core/seq/seq_device.c
@@ -78,7 +78,9 @@ struct ops_list {
78static LIST_HEAD(opslist); 78static LIST_HEAD(opslist);
79static int num_ops; 79static int num_ops;
80static DECLARE_MUTEX(ops_mutex); 80static DECLARE_MUTEX(ops_mutex);
81#ifdef CONFIG_PROC_FS
81static struct snd_info_entry *info_entry = NULL; 82static struct snd_info_entry *info_entry = NULL;
83#endif
82 84
83/* 85/*
84 * prototypes 86 * prototypes
@@ -100,6 +102,7 @@ static void remove_drivers(void);
100 * show all drivers and their status 102 * show all drivers and their status
101 */ 103 */
102 104
105#ifdef CONFIG_PROC_FS
103static void snd_seq_device_info(struct snd_info_entry *entry, 106static void snd_seq_device_info(struct snd_info_entry *entry,
104 struct snd_info_buffer *buffer) 107 struct snd_info_buffer *buffer)
105{ 108{
@@ -117,6 +120,7 @@ static void snd_seq_device_info(struct snd_info_entry *entry,
117 } 120 }
118 up(&ops_mutex); 121 up(&ops_mutex);
119} 122}
123#endif
120 124
121/* 125/*
122 * load all registered drivers (called from seq_clientmgr.c) 126 * load all registered drivers (called from seq_clientmgr.c)
@@ -544,6 +548,7 @@ static void unlock_driver(struct ops_list *ops)
544 548
545static int __init alsa_seq_device_init(void) 549static int __init alsa_seq_device_init(void)
546{ 550{
551#ifdef CONFIG_PROC_FS
547 info_entry = snd_info_create_module_entry(THIS_MODULE, "drivers", 552 info_entry = snd_info_create_module_entry(THIS_MODULE, "drivers",
548 snd_seq_root); 553 snd_seq_root);
549 if (info_entry == NULL) 554 if (info_entry == NULL)
@@ -555,13 +560,16 @@ static int __init alsa_seq_device_init(void)
555 snd_info_free_entry(info_entry); 560 snd_info_free_entry(info_entry);
556 return -ENOMEM; 561 return -ENOMEM;
557 } 562 }
563#endif
558 return 0; 564 return 0;
559} 565}
560 566
561static void __exit alsa_seq_device_exit(void) 567static void __exit alsa_seq_device_exit(void)
562{ 568{
563 remove_drivers(); 569 remove_drivers();
570#ifdef CONFIG_PROC_FS
564 snd_info_unregister(info_entry); 571 snd_info_unregister(info_entry);
572#endif
565 if (num_ops) 573 if (num_ops)
566 snd_printk(KERN_ERR "drivers not released (%d)\n", num_ops); 574 snd_printk(KERN_ERR "drivers not released (%d)\n", num_ops);
567} 575}
diff --git a/sound/core/seq/seq_info.c b/sound/core/seq/seq_info.c
index 3257cf4ec258..acce21afdaa4 100644
--- a/sound/core/seq/seq_info.c
+++ b/sound/core/seq/seq_info.c
@@ -27,7 +27,7 @@
27#include "seq_clientmgr.h" 27#include "seq_clientmgr.h"
28#include "seq_timer.h" 28#include "seq_timer.h"
29 29
30 30#ifdef CONFIG_PROC_FS
31static struct snd_info_entry *queues_entry; 31static struct snd_info_entry *queues_entry;
32static struct snd_info_entry *clients_entry; 32static struct snd_info_entry *clients_entry;
33static struct snd_info_entry *timer_entry; 33static struct snd_info_entry *timer_entry;
@@ -52,7 +52,6 @@ create_info_entry(char *name, int size, void (*read)(struct snd_info_entry *,
52 return entry; 52 return entry;
53} 53}
54 54
55
56/* create all our /proc entries */ 55/* create all our /proc entries */
57int __init snd_seq_info_init(void) 56int __init snd_seq_info_init(void)
58{ 57{
@@ -66,11 +65,9 @@ int __init snd_seq_info_init(void)
66 65
67int __exit snd_seq_info_done(void) 66int __exit snd_seq_info_done(void)
68{ 67{
69 if (queues_entry) 68 snd_info_unregister(queues_entry);
70 snd_info_unregister(queues_entry); 69 snd_info_unregister(clients_entry);
71 if (clients_entry) 70 snd_info_unregister(timer_entry);
72 snd_info_unregister(clients_entry);
73 if (timer_entry)
74 snd_info_unregister(timer_entry);
75 return 0; 71 return 0;
76} 72}
73#endif
diff --git a/sound/core/seq/seq_info.h b/sound/core/seq/seq_info.h
index 5a91ebce43a0..4892a7f35c08 100644
--- a/sound/core/seq/seq_info.h
+++ b/sound/core/seq/seq_info.h
@@ -29,8 +29,12 @@ void snd_seq_info_timer_read(struct snd_info_entry *entry, struct snd_info_buffe
29void snd_seq_info_queues_read(struct snd_info_entry *entry, struct snd_info_buffer *buffer); 29void snd_seq_info_queues_read(struct snd_info_entry *entry, struct snd_info_buffer *buffer);
30 30
31 31
32#ifdef CONFIG_PROC_FS
32int snd_seq_info_init( void ); 33int snd_seq_info_init( void );
33int snd_seq_info_done( void ); 34int snd_seq_info_done( void );
34 35#else
36static inline int snd_seq_info_init(void) { return 0; }
37static inline int snd_seq_info_done(void) { return 0; }
38#endif
35 39
36#endif 40#endif
diff --git a/sound/core/seq/seq_queue.c b/sound/core/seq/seq_queue.c
index b537a71e1e19..9cf20f045542 100644
--- a/sound/core/seq/seq_queue.c
+++ b/sound/core/seq/seq_queue.c
@@ -756,6 +756,7 @@ int snd_seq_control_queue(struct snd_seq_event *ev, int atomic, int hop)
756 756
757/*----------------------------------------------------------------*/ 757/*----------------------------------------------------------------*/
758 758
759#ifdef CONFIG_PROC_FS
759/* exported to seq_info.c */ 760/* exported to seq_info.c */
760void snd_seq_info_queues_read(struct snd_info_entry *entry, 761void snd_seq_info_queues_read(struct snd_info_entry *entry,
761 struct snd_info_buffer *buffer) 762 struct snd_info_buffer *buffer)
@@ -789,3 +790,5 @@ void snd_seq_info_queues_read(struct snd_info_entry *entry,
789 queuefree(q); 790 queuefree(q);
790 } 791 }
791} 792}
793#endif /* CONFIG_PROC_FS */
794
diff --git a/sound/core/seq/seq_timer.c b/sound/core/seq/seq_timer.c
index a1d8bfd60ae9..b4b9a132cb16 100644
--- a/sound/core/seq/seq_timer.c
+++ b/sound/core/seq/seq_timer.c
@@ -425,6 +425,7 @@ snd_seq_tick_time_t snd_seq_timer_get_cur_tick(struct snd_seq_timer *tmr)
425} 425}
426 426
427 427
428#ifdef CONFIG_PROC_FS
428/* exported to seq_info.c */ 429/* exported to seq_info.c */
429void snd_seq_info_timer_read(struct snd_info_entry *entry, 430void snd_seq_info_timer_read(struct snd_info_entry *entry,
430 struct snd_info_buffer *buffer) 431 struct snd_info_buffer *buffer)
@@ -451,3 +452,5 @@ void snd_seq_info_timer_read(struct snd_info_entry *entry,
451 queuefree(q); 452 queuefree(q);
452 } 453 }
453} 454}
455#endif /* CONFIG_PROC_FS */
456