-/* Only changed from linux_main at boot time */
-char *dsp = HOSTAUDIO_DEV_DSP;
-char *mixer = HOSTAUDIO_DEV_MIXER;
+/*
+ * Changed either at boot time or module load time. At boot, this is
+ * single-threaded; at module load, multiple modules would each have
+ * their own copy of these variables.
+ */
+static char *dsp = HOSTAUDIO_DEV_DSP;
+static char *mixer = HOSTAUDIO_DEV_MIXER;
static ssize_t hostaudio_read(struct file *file, char __user *buffer,
size_t count, loff_t *ppos)
{
static ssize_t hostaudio_read(struct file *file, char __user *buffer,
size_t count, loff_t *ppos)
{
}
static ssize_t hostaudio_write(struct file *file, const char __user *buffer,
size_t count, loff_t *ppos)
{
}
static ssize_t hostaudio_write(struct file *file, const char __user *buffer,
size_t count, loff_t *ppos)
{
case SNDCTL_DSP_CHANNELS:
case SNDCTL_DSP_SUBDIVIDE:
case SNDCTL_DSP_SETFRAGMENT:
case SNDCTL_DSP_CHANNELS:
case SNDCTL_DSP_SUBDIVIDE:
case SNDCTL_DSP_SETFRAGMENT:
case SNDCTL_DSP_CHANNELS:
case SNDCTL_DSP_SUBDIVIDE:
case SNDCTL_DSP_SETFRAGMENT:
case SNDCTL_DSP_CHANNELS:
case SNDCTL_DSP_SUBDIVIDE:
case SNDCTL_DSP_SETFRAGMENT:
ret = os_open_file(dsp, of_set_rw(OPENFLAGS(), r, w), 0);
ret = os_open_file(dsp, of_set_rw(OPENFLAGS(), r, w), 0);
ret = os_open_file(mixer, of_set_rw(OPENFLAGS(), r, w), 0);
ret = os_open_file(mixer, of_set_rw(OPENFLAGS(), r, w), 0);
-
- if(ret < 0){
- printk("hostaudio_open_mixdev failed to open '%s', err = %d\n",
- dsp, -ret);
+
+ if (ret < 0) {
+ printk(KERN_ERR "hostaudio_open_mixdev failed to open '%s', "
+ "err = %d\n", dsp, -ret);
- .owner = THIS_MODULE,
- .llseek = no_llseek,
- .read = hostaudio_read,
- .write = hostaudio_write,
- .poll = hostaudio_poll,
- .ioctl = hostaudio_ioctl,
- .mmap = NULL,
- .open = hostaudio_open,
- .release = hostaudio_release,
+ .owner = THIS_MODULE,
+ .llseek = no_llseek,
+ .read = hostaudio_read,
+ .write = hostaudio_write,
+ .poll = hostaudio_poll,
+ .ioctl = hostaudio_ioctl,
+ .mmap = NULL,
+ .open = hostaudio_open,
+ .release = hostaudio_release,
- .owner = THIS_MODULE,
- .llseek = no_llseek,
- .ioctl = hostmixer_ioctl_mixdev,
- .open = hostmixer_open_mixdev,
- .release = hostmixer_release,
+ .owner = THIS_MODULE,
+ .llseek = no_llseek,
+ .ioctl = hostmixer_ioctl_mixdev,
+ .open = hostmixer_open_mixdev,
+ .release = hostmixer_release,
-
-/*
- * Overrides for Emacs so that we follow Linus's tabbing style.
- * Emacs will notice this stuff at the end of the file and automatically
- * adjust the settings for this buffer only. This must remain at the end
- * of the file.
- * ---------------------------------------------------------------------------
- * Local variables:
- * c-file-style: "linux"
- * End:
- */