Commit a69156f1 authored by Jaroslav Kysela's avatar Jaroslav Kysela

ALSA update

  - fixes for compilation without CONFIG_PROC_FS
parent 7d350417
...@@ -225,7 +225,6 @@ int snd_minor_info_oss_init(void); ...@@ -225,7 +225,6 @@ int snd_minor_info_oss_init(void);
int snd_minor_info_oss_done(void); int snd_minor_info_oss_done(void);
int snd_oss_init_module(void); int snd_oss_init_module(void);
void snd_oss_cleanup_module(void);
#endif #endif
......
...@@ -164,7 +164,7 @@ static inline int snd_info_card_unregister(snd_card_t * card) { return 0; } ...@@ -164,7 +164,7 @@ static inline int snd_info_card_unregister(snd_card_t * card) { return 0; }
static inline int snd_info_register(snd_info_entry_t * entry) { return 0; } static inline int snd_info_register(snd_info_entry_t * entry) { return 0; }
static inline int snd_info_unregister(snd_info_entry_t * entry) { return 0; } static inline int snd_info_unregister(snd_info_entry_t * entry) { return 0; }
static inline struct proc_dir_entry *snd_create_proc_entry(const char *name, mode_t mode, struct proc_dir_entry *parent) { return 0; } static inline struct proc_dir_entry *snd_create_proc_entry(const char *name, mode_t mode, struct proc_dir_entry *parent) { return NULL; }
static inline void snd_remove_proc_entry(struct proc_dir_entry *parent, static inline void snd_remove_proc_entry(struct proc_dir_entry *parent,
struct proc_dir_entry *de) { ; } struct proc_dir_entry *de) { ; }
...@@ -174,7 +174,7 @@ static inline void snd_remove_proc_entry(struct proc_dir_entry *parent, ...@@ -174,7 +174,7 @@ static inline void snd_remove_proc_entry(struct proc_dir_entry *parent,
* OSS info part * OSS info part
*/ */
#ifdef CONFIG_SND_OSSEMUL #if defined(CONFIG_SND_OSSEMUL) && defined(CONFIG_PROC_FS)
#define SNDRV_OSS_INFO_DEV_AUDIO 0 #define SNDRV_OSS_INFO_DEV_AUDIO 0
#define SNDRV_OSS_INFO_DEV_SYNTH 1 #define SNDRV_OSS_INFO_DEV_SYNTH 1
...@@ -187,6 +187,6 @@ static inline void snd_remove_proc_entry(struct proc_dir_entry *parent, ...@@ -187,6 +187,6 @@ static inline void snd_remove_proc_entry(struct proc_dir_entry *parent,
extern int snd_oss_info_register(int dev, int num, char *string); extern int snd_oss_info_register(int dev, int num, char *string);
#define snd_oss_info_unregister(dev, num) snd_oss_info_register(dev, num, NULL) #define snd_oss_info_unregister(dev, num) snd_oss_info_register(dev, num, NULL)
#endif /* CONFIG_SND_OSSEMUL */ #endif /* CONFIG_SND_OSSEMUL && CONFIG_PROC_FS */
#endif /* __SOUND_INFO_H */ #endif /* __SOUND_INFO_H */
...@@ -327,7 +327,7 @@ static int snd_hwdep_dev_register(snd_device_t *device) ...@@ -327,7 +327,7 @@ static int snd_hwdep_dev_register(snd_device_t *device)
up(&register_mutex); up(&register_mutex);
return err; return err;
} }
#ifdef CONFIG_SND_OSSEMUL #ifdef SNDRV_OSS_INFO_DEV_AUDIO
hwdep->ossreg = 0; hwdep->ossreg = 0;
if (hwdep->oss_type >= 0) { if (hwdep->oss_type >= 0) {
if ((hwdep->oss_type == SNDRV_OSS_DEVICE_TYPE_DMFM) && (hwdep->device != 0)) { if ((hwdep->oss_type == SNDRV_OSS_DEVICE_TYPE_DMFM) && (hwdep->device != 0)) {
...@@ -359,7 +359,7 @@ static int snd_hwdep_dev_unregister(snd_device_t *device) ...@@ -359,7 +359,7 @@ static int snd_hwdep_dev_unregister(snd_device_t *device)
up(&register_mutex); up(&register_mutex);
return -EINVAL; return -EINVAL;
} }
#ifdef CONFIG_SND_OSSEMUL #ifdef SNDRV_OSS_INFO_DEV_AUDIO
if (hwdep->ossreg) if (hwdep->ossreg)
snd_unregister_oss_device(hwdep->oss_type, hwdep->card, hwdep->device); snd_unregister_oss_device(hwdep->oss_type, hwdep->card, hwdep->device);
#endif #endif
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
#include <sound/version.h> #include <sound/version.h>
#include <linux/utsname.h> #include <linux/utsname.h>
#ifdef CONFIG_SND_OSSEMUL #if defined(CONFIG_SND_OSSEMUL) && defined(CONFIG_PROC_FS)
/* /*
* OSS compatible part * OSS compatible part
......
...@@ -216,7 +216,7 @@ static void snd_card_info_read(snd_info_entry_t *entry, snd_info_buffer_t * buff ...@@ -216,7 +216,7 @@ static void snd_card_info_read(snd_info_entry_t *entry, snd_info_buffer_t * buff
snd_iprintf(buffer, "--- no soundcards ---\n"); snd_iprintf(buffer, "--- no soundcards ---\n");
} }
#ifdef CONFIG_SND_OSSEMUL #if defined(CONFIG_SND_OSSEMUL) && defined(CONFIG_PROC_FS)
void snd_card_info_read_oss(snd_info_buffer_t * buffer) void snd_card_info_read_oss(snd_info_buffer_t * buffer)
{ {
......
...@@ -1417,7 +1417,7 @@ static int snd_rawmidi_dev_register(snd_device_t *device) ...@@ -1417,7 +1417,7 @@ static int snd_rawmidi_dev_register(snd_device_t *device)
up(&register_mutex); up(&register_mutex);
return err; return err;
} }
#ifdef CONFIG_SND_OSSEMUL #ifdef SNDRV_OSS_INFO_DEV_AUDIO
rmidi->ossreg = 0; rmidi->ossreg = 0;
if (rmidi->device == snd_midi_map[rmidi->card->number]) { if (rmidi->device == snd_midi_map[rmidi->card->number]) {
if (snd_register_oss_device(SNDRV_OSS_DEVICE_TYPE_MIDI, if (snd_register_oss_device(SNDRV_OSS_DEVICE_TYPE_MIDI,
...@@ -1480,7 +1480,7 @@ static int snd_rawmidi_dev_unregister(snd_device_t *device) ...@@ -1480,7 +1480,7 @@ static int snd_rawmidi_dev_unregister(snd_device_t *device)
snd_info_unregister(rmidi->proc_entry); snd_info_unregister(rmidi->proc_entry);
rmidi->proc_entry = NULL; rmidi->proc_entry = NULL;
} }
#ifdef CONFIG_SND_OSSEMUL #ifdef SNDRV_OSS_INFO_DEV_AUDIO
if (rmidi->ossreg) { if (rmidi->ossreg) {
if (rmidi->device == snd_midi_map[rmidi->card->number]) { if (rmidi->device == snd_midi_map[rmidi->card->number]) {
snd_unregister_oss_device(SNDRV_OSS_DEVICE_TYPE_MIDI, rmidi->card, 0); snd_unregister_oss_device(SNDRV_OSS_DEVICE_TYPE_MIDI, rmidi->card, 0);
......
...@@ -318,9 +318,6 @@ static int __init alsa_sound_init(void) ...@@ -318,9 +318,6 @@ static int __init alsa_sound_init(void)
#endif #endif
if (register_chrdev(snd_major, "alsa", &snd_fops)) { if (register_chrdev(snd_major, "alsa", &snd_fops)) {
snd_printk(KERN_ERR "unable to register native major device number %d\n", snd_major); snd_printk(KERN_ERR "unable to register native major device number %d\n", snd_major);
#ifdef CONFIG_SND_OSSEMUL
snd_oss_cleanup_module();
#endif
return -EIO; return -EIO;
} }
#ifdef CONFIG_SND_DEBUG_MEMORY #ifdef CONFIG_SND_DEBUG_MEMORY
...@@ -329,9 +326,6 @@ static int __init alsa_sound_init(void) ...@@ -329,9 +326,6 @@ static int __init alsa_sound_init(void)
if (snd_info_init() < 0) { if (snd_info_init() < 0) {
#ifdef CONFIG_SND_DEBUG_MEMORY #ifdef CONFIG_SND_DEBUG_MEMORY
snd_memory_done(); snd_memory_done();
#endif
#ifdef CONFIG_SND_OSSEMUL
snd_oss_cleanup_module();
#endif #endif
return -ENOMEM; return -ENOMEM;
} }
...@@ -369,7 +363,6 @@ static void __exit alsa_sound_exit(void) ...@@ -369,7 +363,6 @@ static void __exit alsa_sound_exit(void)
#ifdef CONFIG_SND_OSSEMUL #ifdef CONFIG_SND_OSSEMUL
snd_info_minor_unregister(); snd_info_minor_unregister();
snd_oss_cleanup_module();
#endif #endif
snd_info_done(); snd_info_done();
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,0) && defined(CONFIG_APM) #if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,0) && defined(CONFIG_APM)
...@@ -455,6 +448,7 @@ EXPORT_SYMBOL(snd_dma_disable); ...@@ -455,6 +448,7 @@ EXPORT_SYMBOL(snd_dma_disable);
EXPORT_SYMBOL(snd_dma_residue); EXPORT_SYMBOL(snd_dma_residue);
#endif #endif
/* info.c */ /* info.c */
#ifdef CONFIG_PROC_FS
EXPORT_SYMBOL(snd_seq_root); EXPORT_SYMBOL(snd_seq_root);
EXPORT_SYMBOL(snd_create_proc_entry); EXPORT_SYMBOL(snd_create_proc_entry);
EXPORT_SYMBOL(snd_remove_proc_entry); EXPORT_SYMBOL(snd_remove_proc_entry);
...@@ -468,8 +462,9 @@ EXPORT_SYMBOL(snd_info_create_device); ...@@ -468,8 +462,9 @@ EXPORT_SYMBOL(snd_info_create_device);
EXPORT_SYMBOL(snd_info_free_device); EXPORT_SYMBOL(snd_info_free_device);
EXPORT_SYMBOL(snd_info_register); EXPORT_SYMBOL(snd_info_register);
EXPORT_SYMBOL(snd_info_unregister); EXPORT_SYMBOL(snd_info_unregister);
#endif
/* info_oss.c */ /* info_oss.c */
#ifdef CONFIG_SND_OSSEMUL #if defined(CONFIG_SND_OSSEMUL) && defined(CONFIG_PROC_FS)
EXPORT_SYMBOL(snd_oss_info_register); EXPORT_SYMBOL(snd_oss_info_register);
#endif #endif
/* control.c */ /* control.c */
......
...@@ -183,6 +183,8 @@ int snd_unregister_oss_device(int type, snd_card_t * card, int dev) ...@@ -183,6 +183,8 @@ int snd_unregister_oss_device(int type, snd_card_t * card, int dev)
* INFO PART * INFO PART
*/ */
#ifdef CONFIG_PROC_FS
static snd_info_entry_t *snd_minor_info_oss_entry = NULL; static snd_info_entry_t *snd_minor_info_oss_entry = NULL;
static void snd_minor_info_oss_read(snd_info_entry_t *entry, snd_info_buffer_t * buffer) static void snd_minor_info_oss_read(snd_info_entry_t *entry, snd_info_buffer_t * buffer)
...@@ -207,8 +209,11 @@ static void snd_minor_info_oss_read(snd_info_entry_t *entry, snd_info_buffer_t * ...@@ -207,8 +209,11 @@ static void snd_minor_info_oss_read(snd_info_entry_t *entry, snd_info_buffer_t *
up(&sound_oss_mutex); up(&sound_oss_mutex);
} }
#endif /* CONFIG_PROC_FS */
int __init snd_minor_info_oss_init(void) int __init snd_minor_info_oss_init(void)
{ {
#ifdef CONFIG_PROC_FS
snd_info_entry_t *entry; snd_info_entry_t *entry;
entry = snd_info_create_module_entry(THIS_MODULE, "devices", snd_oss_root); entry = snd_info_create_module_entry(THIS_MODULE, "devices", snd_oss_root);
...@@ -222,13 +227,16 @@ int __init snd_minor_info_oss_init(void) ...@@ -222,13 +227,16 @@ int __init snd_minor_info_oss_init(void)
} }
} }
snd_minor_info_oss_entry = entry; snd_minor_info_oss_entry = entry;
#endif
return 0; return 0;
} }
int __exit snd_minor_info_oss_done(void) int __exit snd_minor_info_oss_done(void)
{ {
#ifdef CONFIG_PROC_FS
if (snd_minor_info_oss_entry) if (snd_minor_info_oss_entry)
snd_info_unregister(snd_minor_info_oss_entry); snd_info_unregister(snd_minor_info_oss_entry);
#endif
return 0; return 0;
} }
...@@ -241,8 +249,4 @@ int __init snd_oss_init_module(void) ...@@ -241,8 +249,4 @@ int __init snd_oss_init_module(void)
return 0; return 0;
} }
void snd_oss_cleanup_module(void)
{
}
#endif /* CONFIG_SND_OSSEMUL */ #endif /* CONFIG_SND_OSSEMUL */
...@@ -1356,7 +1356,7 @@ static int __init alsa_timer_init(void) ...@@ -1356,7 +1356,7 @@ static int __init alsa_timer_init(void)
int err; int err;
snd_info_entry_t *entry; snd_info_entry_t *entry;
#ifdef CONFIG_SND_OSSEMUL #ifdef SNDRV_OSS_INFO_DEV_TIMERS
snd_oss_info_register(SNDRV_OSS_INFO_DEV_TIMERS, SNDRV_CARDS - 1, "system timer"); snd_oss_info_register(SNDRV_OSS_INFO_DEV_TIMERS, SNDRV_CARDS - 1, "system timer");
#endif #endif
if ((entry = snd_info_create_module_entry(THIS_MODULE, "timers", NULL)) != NULL) { if ((entry = snd_info_create_module_entry(THIS_MODULE, "timers", NULL)) != NULL) {
...@@ -1391,7 +1391,7 @@ static void __exit alsa_timer_exit(void) ...@@ -1391,7 +1391,7 @@ static void __exit alsa_timer_exit(void)
snd_info_unregister(snd_timer_proc_entry); snd_info_unregister(snd_timer_proc_entry);
snd_timer_proc_entry = NULL; snd_timer_proc_entry = NULL;
} }
#ifdef CONFIG_SND_OSSEMUL #ifdef SNDRV_OSS_INFO_DEV_TIMERS
snd_oss_info_unregister(SNDRV_OSS_INFO_DEV_TIMERS, SNDRV_CARDS - 1); snd_oss_info_unregister(SNDRV_OSS_INFO_DEV_TIMERS, SNDRV_CARDS - 1);
#endif #endif
} }
......
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