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);
int snd_minor_info_oss_done(void);
int snd_oss_init_module(void);
void snd_oss_cleanup_module(void);
#endif
......
......@@ -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_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,
struct proc_dir_entry *de) { ; }
......@@ -174,7 +174,7 @@ static inline void snd_remove_proc_entry(struct proc_dir_entry *parent,
* 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_SYNTH 1
......@@ -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);
#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 */
......@@ -327,7 +327,7 @@ static int snd_hwdep_dev_register(snd_device_t *device)
up(&register_mutex);
return err;
}
#ifdef CONFIG_SND_OSSEMUL
#ifdef SNDRV_OSS_INFO_DEV_AUDIO
hwdep->ossreg = 0;
if (hwdep->oss_type >= 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)
up(&register_mutex);
return -EINVAL;
}
#ifdef CONFIG_SND_OSSEMUL
#ifdef SNDRV_OSS_INFO_DEV_AUDIO
if (hwdep->ossreg)
snd_unregister_oss_device(hwdep->oss_type, hwdep->card, hwdep->device);
#endif
......
......@@ -28,7 +28,7 @@
#include <sound/version.h>
#include <linux/utsname.h>
#ifdef CONFIG_SND_OSSEMUL
#if defined(CONFIG_SND_OSSEMUL) && defined(CONFIG_PROC_FS)
/*
* OSS compatible part
......
......@@ -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");
}
#ifdef CONFIG_SND_OSSEMUL
#if defined(CONFIG_SND_OSSEMUL) && defined(CONFIG_PROC_FS)
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)
up(&register_mutex);
return err;
}
#ifdef CONFIG_SND_OSSEMUL
#ifdef SNDRV_OSS_INFO_DEV_AUDIO
rmidi->ossreg = 0;
if (rmidi->device == snd_midi_map[rmidi->card->number]) {
if (snd_register_oss_device(SNDRV_OSS_DEVICE_TYPE_MIDI,
......@@ -1480,7 +1480,7 @@ static int snd_rawmidi_dev_unregister(snd_device_t *device)
snd_info_unregister(rmidi->proc_entry);
rmidi->proc_entry = NULL;
}
#ifdef CONFIG_SND_OSSEMUL
#ifdef SNDRV_OSS_INFO_DEV_AUDIO
if (rmidi->ossreg) {
if (rmidi->device == snd_midi_map[rmidi->card->number]) {
snd_unregister_oss_device(SNDRV_OSS_DEVICE_TYPE_MIDI, rmidi->card, 0);
......
......@@ -318,9 +318,6 @@ static int __init alsa_sound_init(void)
#endif
if (register_chrdev(snd_major, "alsa", &snd_fops)) {
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;
}
#ifdef CONFIG_SND_DEBUG_MEMORY
......@@ -329,9 +326,6 @@ static int __init alsa_sound_init(void)
if (snd_info_init() < 0) {
#ifdef CONFIG_SND_DEBUG_MEMORY
snd_memory_done();
#endif
#ifdef CONFIG_SND_OSSEMUL
snd_oss_cleanup_module();
#endif
return -ENOMEM;
}
......@@ -369,7 +363,6 @@ static void __exit alsa_sound_exit(void)
#ifdef CONFIG_SND_OSSEMUL
snd_info_minor_unregister();
snd_oss_cleanup_module();
#endif
snd_info_done();
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,0) && defined(CONFIG_APM)
......@@ -455,6 +448,7 @@ EXPORT_SYMBOL(snd_dma_disable);
EXPORT_SYMBOL(snd_dma_residue);
#endif
/* info.c */
#ifdef CONFIG_PROC_FS
EXPORT_SYMBOL(snd_seq_root);
EXPORT_SYMBOL(snd_create_proc_entry);
EXPORT_SYMBOL(snd_remove_proc_entry);
......@@ -468,8 +462,9 @@ EXPORT_SYMBOL(snd_info_create_device);
EXPORT_SYMBOL(snd_info_free_device);
EXPORT_SYMBOL(snd_info_register);
EXPORT_SYMBOL(snd_info_unregister);
#endif
/* info_oss.c */
#ifdef CONFIG_SND_OSSEMUL
#if defined(CONFIG_SND_OSSEMUL) && defined(CONFIG_PROC_FS)
EXPORT_SYMBOL(snd_oss_info_register);
#endif
/* control.c */
......
......@@ -183,6 +183,8 @@ int snd_unregister_oss_device(int type, snd_card_t * card, int dev)
* INFO PART
*/
#ifdef CONFIG_PROC_FS
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)
......@@ -207,8 +209,11 @@ static void snd_minor_info_oss_read(snd_info_entry_t *entry, snd_info_buffer_t *
up(&sound_oss_mutex);
}
#endif /* CONFIG_PROC_FS */
int __init snd_minor_info_oss_init(void)
{
#ifdef CONFIG_PROC_FS
snd_info_entry_t *entry;
entry = snd_info_create_module_entry(THIS_MODULE, "devices", snd_oss_root);
......@@ -222,13 +227,16 @@ int __init snd_minor_info_oss_init(void)
}
}
snd_minor_info_oss_entry = entry;
#endif
return 0;
}
int __exit snd_minor_info_oss_done(void)
{
#ifdef CONFIG_PROC_FS
if (snd_minor_info_oss_entry)
snd_info_unregister(snd_minor_info_oss_entry);
#endif
return 0;
}
......@@ -241,8 +249,4 @@ int __init snd_oss_init_module(void)
return 0;
}
void snd_oss_cleanup_module(void)
{
}
#endif /* CONFIG_SND_OSSEMUL */
......@@ -1356,7 +1356,7 @@ static int __init alsa_timer_init(void)
int err;
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");
#endif
if ((entry = snd_info_create_module_entry(THIS_MODULE, "timers", NULL)) != NULL) {
......@@ -1391,7 +1391,7 @@ static void __exit alsa_timer_exit(void)
snd_info_unregister(snd_timer_proc_entry);
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);
#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