From: Andy P. <at...@us...> - 2002-04-11 14:36:07
|
Update of /cvsroot/linux-vax/kernel-2.4/drivers/sbus/audio In directory usw-pr-cvs1:/tmp/cvs-serv8509/sbus/audio Modified Files: Makefile amd7930.c amd7930.h audio.c cs4215.h cs4231.c cs4231.h dbri.c dbri.h dmy.c dummy.h Log Message: synch 2.4.15 commit 52 Index: Makefile =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/sbus/audio/Makefile,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- Makefile 14 Jan 2001 18:45:59 -0000 1.1.1.1 +++ Makefile 11 Apr 2002 12:55:56 -0000 1.2 @@ -11,8 +11,8 @@ obj-$(CONFIG_SPARCAUDIO) += audio.o obj-$(CONFIG_SPARCAUDIO_AMD7930) += amd7930.o -obj-$(CONFIG_SPARCAUDIO_CS4231) += cs4231.o obj-$(CONFIG_SPARCAUDIO_DBRI) += dbri.o +obj-$(CONFIG_SPARCAUDIO_CS4231) += cs4231.o obj-$(CONFIG_SPARCAUDIO_DUMMY) += dmy.o include $(TOPDIR)/Rules.make Index: amd7930.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/sbus/audio/amd7930.c,v retrieving revision 1.1.1.2 retrieving revision 1.2 diff -u -r1.1.1.2 -r1.2 --- amd7930.c 25 Feb 2001 23:15:10 -0000 1.1.1.2 +++ amd7930.c 11 Apr 2002 12:55:56 -0000 1.2 @@ -107,7 +107,7 @@ static __u8 linear2mulaw(__u16 data); static __u16 mulaw2linear(__u8 data); -#if defined (AMD79C30_ISDN) && defined (LINUX_VERSION_CODE) && LINUX_VERSION_CODE > 0x200ff +#if defined (AMD79C30_ISDN) #include "../../isdn/hisax/hisax.h" #include "../../isdn/hisax/isdnl1.h" #include "../../isdn/hisax/foreign.h" @@ -1131,7 +1131,7 @@ * */ -#if defined (AMD79C30_ISDN) && defined (LINUX_VERSION_CODE) && LINUX_VERSION_CODE > 0x200ff +#if defined (AMD79C30_ISDN) static int amd7930_get_irqnum(int dev) { struct amd7930_info *info; @@ -1659,9 +1659,8 @@ return 0; } -#ifdef MODULE /* Detach from an amd7930 chip given the device structure. */ -static void amd7930_detach(struct sparcaudio_driver *drv) +static void __exit amd7930_detach(struct sparcaudio_driver *drv) { struct amd7930_info *info = (struct amd7930_info *)drv->private; @@ -1672,14 +1671,9 @@ sbus_iounmap(info->regs, info->regs_size); kfree(drv->private); } -#endif /* Probe for the amd7930 chip and then attach the driver. */ -#ifdef MODULE -int init_module(void) -#else -int __init amd7930_init(void) -#endif +static int __init amd7930_init(void) { struct sbus_bus *sbus; struct sbus_dev *sdev; @@ -1710,8 +1704,7 @@ return (num_drivers > 0) ? 0 : -EIO; } -#ifdef MODULE -void cleanup_module(void) +static void __exit amd7930_exit(void) { register int i; @@ -1720,8 +1713,10 @@ num_drivers--; } } -#endif +module_init(amd7930_init); +module_exit(amd7930_exit); +MODULE_LICENSE("GPL"); /*************************************************************/ /* Audio format conversion */ Index: amd7930.h =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/sbus/audio/amd7930.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 Index: audio.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/sbus/audio/audio.c,v retrieving revision 1.1.1.2 retrieving revision 1.2 diff -u -r1.1.1.2 -r1.2 --- audio.c 25 Feb 2001 23:15:10 -0000 1.1.1.2 +++ audio.c 11 Apr 2002 12:55:56 -0000 1.2 @@ -32,10 +32,11 @@ #include <linux/interrupt.h> #include <linux/init.h> #include <linux/soundcard.h> -#include <linux/version.h> #include <linux/devfs_fs_kernel.h> #include <linux/delay.h> +#include <linux/poll.h> #include <asm/pgtable.h> +#include <asm/uaccess.h> #include <asm/audioio.h> @@ -73,24 +74,6 @@ static struct sparcaudio_driver *drivers[SPARCAUDIO_MAX_DEVICES]; static devfs_handle_t devfs_handle; -/* This crap to be pulled off into a local include file */ -#if defined (LINUX_VERSION_CODE) && LINUX_VERSION_CODE < 0x20100 - -#define COPY_IN(arg, get) verify_area(VERIFY_READ, (void *)arg, sizeof(long)); memcpy_fromfs(&get, (long *)arg, sizeof(get)); -#define COPY_OUT(arg, ret) verify_area(VERIFY_WRITE, (void *)arg, sizeof(long)); memcpy_tofs((long *)arg, &ret, sizeof(ret)); -#define copy_to_user memcpy_tofs -#define copy_from_user memcpy_fromfs -#define signal_pending(x) (((x)->signal) & ~((x)->blocked)) - -#else - -#include <asm/uaccess.h> -#include <linux/poll.h> -#define COPY_IN(arg, get) get_user(get, (int *)arg) -#define COPY_OUT(arg, ret) put_user(ret, (int *)arg) -#define sparcaudio_select sparcaudio_poll - -#endif void sparcaudio_output_done(struct sparcaudio_driver * drv, int status) { @@ -215,37 +198,6 @@ * VFS layer interface */ -#if defined (LINUX_VERSION_CODE) && LINUX_VERSION_CODE < 0x20100 -static int sparcaudio_select(struct inode * inode, struct file * file, - int sel_type, select_table * wait) -{ - struct sparcaudio_driver *drv = drivers[(MINOR(inode->i_rdev) >> - SPARCAUDIO_DEVICE_SHIFT)]; - - switch (sel_type) { - case SEL_IN: - if (((!file->f_flags & O_NONBLOCK) && drv->input_count) || - (drv->input_size > drv->buffer_size)) { - dprintk(("read ready: c%d o%d\n", - drv->input_count, drv->input_offset)); - return 1; - } - select_wait(&drv->input_read_wait, wait); - break; - case SEL_OUT: - dprintk(("sel out: c%d o%d p%d\n", - drv->output_count, drv->output_offset, drv->playing_count)); - if ((drv->output_count + drv->playing_count) < (drv->num_output_buffers)) - return 1; - select_wait(&drv->output_write_wait, wait); - break; - case SEL_EX: - break; - }; - - return 0; -} -#else static unsigned int sparcaudio_poll(struct file *file, poll_table * wait) { unsigned int mask = 0; @@ -264,29 +216,11 @@ } return mask; } -#endif -#if defined (LINUX_VERSION_CODE) && LINUX_VERSION_CODE < 0x20100 -static int sparcaudio_lseek(struct inode * inode, struct file * file, - off_t offset, int origin) -#else -static loff_t sparcaudio_lseek(struct file * file, loff_t offset, int origin) -#endif -{ - return -ESPIPE; -} - -#if defined (LINUX_VERSION_CODE) && LINUX_VERSION_CODE < 0x20100 -static int sparcaudio_read(struct inode * inode, struct file * file, - char *buf, int count) -#else static ssize_t sparcaudio_read(struct file * file, char *buf, size_t count, loff_t *ppos) -#endif { -#if defined (LINUX_VERSION_CODE) && LINUX_VERSION_CODE > 0x200ff struct inode *inode = file->f_dentry->d_inode; -#endif struct sparcaudio_driver *drv = drivers[(MINOR(inode->i_rdev) >> SPARCAUDIO_DEVICE_SHIFT)]; int bytes_to_copy, bytes_read = 0, err; @@ -358,17 +292,10 @@ restore_flags(flags); } -#if defined (LINUX_VERSION_CODE) && LINUX_VERSION_CODE < 0x20100 -static int sparcaudio_write(struct inode * inode, struct file * file, - const char *buf, int count) -#else static ssize_t sparcaudio_write(struct file * file, const char *buf, size_t count, loff_t *ppos) -#endif { -#if defined (LINUX_VERSION_CODE) && LINUX_VERSION_CODE > 0x200ff struct inode *inode = file->f_dentry->d_inode; -#endif struct sparcaudio_driver *drv = drivers[(MINOR(inode->i_rdev) >> SPARCAUDIO_DEVICE_SHIFT)]; int bytes_written = 0, bytes_to_copy, err; @@ -499,7 +426,7 @@ switch (cmd) { case SOUND_MIXER_WRITE_RECLEV: - if(COPY_IN(arg, k)) + if (get_user(k, (int *)arg)) return -EFAULT; iretry: oprintk(("setting input volume (0x%x)", k)); @@ -531,9 +458,9 @@ oprintk((" try 0x%x\n", k)); goto iretry; } - return COPY_OUT(arg, i); + return put_user(i, (int *)arg); case SOUND_MIXER_WRITE_VOLUME: - if(COPY_IN(arg, k)) + if (get_user(k, (int *)arg)) return -EFAULT; if (drv->ops->get_output_muted && drv->ops->set_output_muted) { i = drv->ops->get_output_muted(drv); @@ -546,9 +473,9 @@ if (drv->ops->get_output_muted) i = drv->ops->get_output_muted(drv); k = 0x6464 * (1 - i); - return COPY_OUT(arg, k); + return put_user(k, (int *)arg); case SOUND_MIXER_WRITE_PCM: - if(COPY_IN(arg, k)) + if (get_user(k, (int *)arg)) return -EFAULT; oretry: oprintk(("setting output volume (0x%x)\n", k)); @@ -582,25 +509,25 @@ oprintk((" try 0x%x\n", k)); goto oretry; } - return COPY_OUT(arg, i); + return put_user(i, (int *)arg); case SOUND_MIXER_READ_SPEAKER: k = OSS_PORT_AUDIO(drv, AUDIO_SPEAKER); - return COPY_OUT(arg, k); + return put_user(k, (int *)arg); case SOUND_MIXER_READ_MIC: k = OSS_IPORT_AUDIO(drv, AUDIO_MICROPHONE); - return COPY_OUT(arg, k); + return put_user(k, (int *)arg); case SOUND_MIXER_READ_CD: k = OSS_IPORT_AUDIO(drv, AUDIO_CD); - return COPY_OUT(arg, k); + return put_user(k, (int *)arg); case SOUND_MIXER_READ_LINE: k = OSS_IPORT_AUDIO(drv, AUDIO_LINE_IN); - return COPY_OUT(arg, k); + return put_user(k, (int *)arg); case SOUND_MIXER_READ_LINE1: k = OSS_PORT_AUDIO(drv, AUDIO_HEADPHONE); - return COPY_OUT(arg, k); + return put_user(k, (int *)arg); case SOUND_MIXER_READ_LINE2: k = OSS_PORT_AUDIO(drv, AUDIO_LINE_OUT); - return COPY_OUT(arg, k); + return put_user(k, (int *)arg); case SOUND_MIXER_WRITE_MIC: case SOUND_MIXER_WRITE_CD: @@ -608,7 +535,7 @@ case SOUND_MIXER_WRITE_LINE1: case SOUND_MIXER_WRITE_LINE2: case SOUND_MIXER_WRITE_SPEAKER: - if(COPY_IN(arg, k)) + if (get_user(k, (int *)arg)) return -EFAULT; OSS_TWIDDLE_IPORT(drv, cmd, SOUND_MIXER_WRITE_LINE, AUDIO_LINE_IN, k); OSS_TWIDDLE_IPORT(drv, cmd, SOUND_MIXER_WRITE_MIC, AUDIO_MICROPHONE, k); @@ -617,7 +544,7 @@ OSS_TWIDDLE_PORT(drv, cmd, SOUND_MIXER_WRITE_SPEAKER, AUDIO_SPEAKER, k); OSS_TWIDDLE_PORT(drv, cmd, SOUND_MIXER_WRITE_LINE1, AUDIO_HEADPHONE, k); OSS_TWIDDLE_PORT(drv, cmd, SOUND_MIXER_WRITE_LINE2, AUDIO_LINE_OUT, k); - return COPY_OUT(arg, k); + return put_user(k, (int *)arg); case SOUND_MIXER_READ_RECSRC: if (drv->ops->get_input_port) i = drv->ops->get_input_port(drv); @@ -627,11 +554,11 @@ if (i & AUDIO_LINE_IN) j = SOUND_MASK_LINE; if (i & AUDIO_MICROPHONE) j = SOUND_MASK_MIC; - return COPY_OUT(arg, j); + return put_user(j, (int *)arg); case SOUND_MIXER_WRITE_RECSRC: if (!drv->ops->set_input_port) return -EINVAL; - if(COPY_IN(arg, k)) + if (get_user(k, (int *)arg)) return -EFAULT; /* only one should ever be selected */ @@ -641,7 +568,7 @@ oprintk(("setting inport to %d\n", j)); i = drv->ops->set_input_port(drv, j); - return COPY_OUT(arg, i); + return put_user(i, (int *)arg); case SOUND_MIXER_READ_RECMASK: if (drv->ops->get_input_ports) i = drv->ops->get_input_ports(drv); @@ -650,10 +577,10 @@ if (i & AUDIO_LINE_IN) j |= SOUND_MASK_LINE; if (i & AUDIO_CD) j |= SOUND_MASK_CD; - return COPY_OUT(arg, j); + return put_user(j, (int *)arg); case SOUND_MIXER_READ_CAPS: /* mixer capabilities */ i = SOUND_CAP_EXCL_INPUT; - return COPY_OUT(arg, i); + return put_user(i, (int *)arg); case SOUND_MIXER_READ_DEVMASK: /* all supported devices */ if (drv->ops->get_input_ports) @@ -676,7 +603,7 @@ if (cmd == SOUND_MIXER_READ_STEREODEVS) j &= ~(MONO_DEVICES); - return COPY_OUT(arg, j); + return put_user(j, (int *)arg); default: return -EINVAL; }; @@ -742,7 +669,7 @@ case I_GETSIG: case I_GETSIG_SOLARIS: j = (int) lis_get_elist_ent(drv->sd_siglist,current->pid); - COPY_OUT(arg, j); + put_user(j, (int *)arg); retval = drv->input_count; break; @@ -773,7 +700,7 @@ * as its retval. (streamio(7I)) This should work. */ j = (drv->input_count > 0) ? drv->input_buffer_size : 0; - COPY_OUT(arg, j); + put_user(j, (int *)arg); retval = drv->input_count; break; @@ -859,11 +786,11 @@ if (drv->ops->get_output_pause(drv)) j |= PCM_ENABLE_OUTPUT; } - COPY_OUT(arg, j); + put_user(j, (int *)arg); break; case SNDCTL_DSP_GETBLKSIZE: j = drv->input_buffer_size; - COPY_OUT(arg, j); + put_user(j, (int *)arg); break; case SNDCTL_DSP_SPEED: if ((!drv->ops->set_output_rate) && @@ -871,12 +798,12 @@ retval = -EINVAL; break; } - COPY_IN(arg, i); + get_user(i, (int *)arg) tprintk(("setting speed to %d\n", i)); drv->ops->set_input_rate(drv, i); drv->ops->set_output_rate(drv, i); j = drv->ops->get_output_rate(drv); - COPY_OUT(arg, j); + put_user(j, (int *)arg); break; case SNDCTL_DSP_GETCAPS: /* All Sparc audio hardware is full duplex. @@ -884,19 +811,19 @@ * Pause functionality emulates trigger */ j = DSP_CAP_DUPLEX | DSP_CAP_TRIGGER | DSP_CAP_REALTIME; - COPY_OUT(arg, j); + put_user(j, (int *)arg); break; case SNDCTL_DSP_GETFMTS: if (drv->ops->get_formats) { j = drv->ops->get_formats(drv); - COPY_OUT(arg, j); + put_user(j, (int *)arg); } else { retval = -EINVAL; } break; case SNDCTL_DSP_SETFMT: /* need to decode into encoding, precision */ - COPY_IN(arg, i); + get_user(i, (int *)arg); /* handle special case here */ if (i == AFMT_QUERY) { @@ -926,7 +853,7 @@ break; }; } - COPY_OUT(arg, i); + put_user(i, (int *)arg); break; } @@ -991,7 +918,7 @@ dprintk(("setting format: failed\n")); return -EINVAL; } - COPY_OUT(arg, i); + put_user(i, (int *)arg); break; case SNDCTL_DSP_CHANNELS: if ((!drv->ops->set_output_channels) && @@ -999,11 +926,11 @@ retval = -EINVAL; break; } - COPY_IN(arg, i); + get_user(i, (int *)arg); drv->ops->set_input_channels(drv, i); drv->ops->set_output_channels(drv, i); i = drv->ops->get_output_channels(drv); - COPY_OUT(arg, i); + put_user(i, (int *)arg); break; case SNDCTL_DSP_STEREO: if ((!drv->ops->set_output_channels) && @@ -1011,11 +938,11 @@ retval = -EINVAL; break; } - COPY_IN(arg, i); + get_user(i, (int *)arg); drv->ops->set_input_channels(drv, (i + 1)); drv->ops->set_output_channels(drv, (i + 1)); i = ((drv->ops->get_output_channels(drv)) - 1); - COPY_OUT(arg, i); + put_user(i, (int *)arg); break; case SNDCTL_DSP_POST: case SNDCTL_DSP_SYNC: @@ -1761,14 +1688,14 @@ default: eprintk(("unknown minor device number\n")); retval = -EINVAL; - }; + } return retval; } static struct file_operations sparcaudioctl_fops = { owner: THIS_MODULE, - poll: sparcaudio_select, + poll: sparcaudio_poll, ioctl: sparcaudio_ioctl, }; @@ -1960,10 +1887,10 @@ static struct file_operations sparcaudio_fops = { owner: THIS_MODULE, - llseek: sparcaudio_lseek, + llseek: no_llseek, read: sparcaudio_read, write: sparcaudio_write, - poll: sparcaudio_select, + poll: sparcaudio_poll, ioctl: sparcaudio_ioctl, open: sparcaudio_open, release: sparcaudio_release, @@ -2032,12 +1959,10 @@ * TODO: Make number of input/output buffers tunable parameters */ -#if defined (LINUX_VERSION_CODE) && LINUX_VERSION_CODE > 0x202ff init_waitqueue_head(&drv->open_wait); init_waitqueue_head(&drv->output_write_wait); init_waitqueue_head(&drv->output_drain_wait); init_waitqueue_head(&drv->input_read_wait); -#endif drv->num_output_buffers = 8; drv->output_buffer_size = (4096 * 2); @@ -2204,20 +2129,6 @@ return -EIO; devfs_handle = devfs_mk_dir (NULL, "sound", NULL); - -#ifdef CONFIG_SPARCAUDIO_AMD7930 - amd7930_init(); -#endif -#ifdef CONFIG_SPARCAUDIO_DBRI - dbri_init(); -#endif -#ifdef CONFIG_SPARCAUDIO_CS4231 - cs4231_init(); -#endif -#ifdef CONFIG_SPARCAUDIO_DUMMY - dummy_init(); -#endif - return 0; } @@ -2227,8 +2138,9 @@ devfs_unregister (devfs_handle); } -module_init(sparcaudio_init) -module_exit(sparcaudio_exit) +module_init(sparcaudio_init); +module_exit(sparcaudio_exit); +MODULE_LICENSE("GPL"); /* * Code from Linux Streams, Copyright 1995 by Index: cs4215.h =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/sbus/audio/cs4215.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 Index: cs4231.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/sbus/audio/cs4231.c,v retrieving revision 1.1.1.2 retrieving revision 1.2 diff -u -r1.1.1.2 -r1.2 --- cs4231.c 25 Feb 2001 23:15:10 -0000 1.1.1.2 +++ cs4231.c 11 Apr 2002 12:55:56 -0000 1.2 @@ -35,7 +35,7 @@ #include <asm/io.h> #include <asm/pgtable.h> #include <asm/sbus.h> -#if defined (LINUX_VERSION_CODE) && LINUX_VERSION_CODE > 0x200ff && defined(CONFIG_PCI) +#ifdef CONFIG_PCI #define EB4231_SUPPORT #include <asm/ebus.h> #include <asm/pbm.h> @@ -2178,9 +2178,6 @@ static int cs4231_attach(struct sparcaudio_driver *drv, struct sbus_dev *sdev) { -#if defined (LINUX_VERSION_CODE) && LINUX_VERSION_CODE < 0x20100 - struct linux_prom_irqs irq; -#endif struct cs4231_chip *cs4231_chip; int err; @@ -2348,12 +2345,51 @@ } #endif -/* Probe for the cs4231 chip and then attach the driver. */ -#ifdef MODULE -int init_module(void) -#else -int __init cs4231_init(void) +#ifdef EB4231_SUPPORT +static int __init ebus_cs4231_p(struct linux_ebus_device *edev) +{ + if (!strcmp(edev->prom_name, "SUNW,CS4231")) + return 1; + if (!strcmp(edev->prom_name, "audio")) { + char compat[16]; + + prom_getstring(edev->prom_node, "compatible", + compat, sizeof(compat)); + compat[15] = '\0'; + if (!strcmp(compat, "SUNW,CS4231")) + return 1; + } + + return 0; +} #endif + +/* Detach from an cs4231 chip given the device structure. */ +static void __exit cs4231_detach(struct sparcaudio_driver *drv) +{ + struct cs4231_chip *cs4231_chip = (struct cs4231_chip *) drv->private; + + cs4231_disable_interrupts(drv); + unregister_sparcaudio_driver(drv, 1); + disable_irq(cs4231_chip->irq); + free_irq(cs4231_chip->irq, drv); + if (!(cs4231_chip->status & CS_STATUS_IS_EBUS)) { + sbus_iounmap(cs4231_chip->regs, cs4231_chip->regs_size); + } else { +#ifdef EB4231_SUPPORT + iounmap(cs4231_chip->regs); + iounmap(cs4231_chip->eb2p); + iounmap(cs4231_chip->eb2c); + disable_irq(cs4231_chip->irq2); + free_irq(cs4231_chip->irq2, drv); +#endif + } + kfree(drv->private); +} + + +/* Probe for the cs4231 chip and then attach the driver. */ +static int __init cs4231_init(void) { struct sbus_bus *sbus; struct sbus_dev *sdev; @@ -2379,7 +2415,7 @@ #ifdef EB4231_SUPPORT for_each_ebus(ebus) { for_each_ebusdev(edev, ebus) { - if (!strcmp(edev->prom_name, "SUNW,CS4231")) { + if (ebus_cs4231_p(edev)) { /* Don't go over the max number of drivers. */ if (num_drivers >= MAX_DRIVERS) continue; @@ -2395,31 +2431,7 @@ return (num_drivers > 0) ? 0 : -EIO; } -#ifdef MODULE -/* Detach from an cs4231 chip given the device structure. */ -static void cs4231_detach(struct sparcaudio_driver *drv) -{ - struct cs4231_chip *cs4231_chip = (struct cs4231_chip *) drv->private; - - cs4231_disable_interrupts(drv); - unregister_sparcaudio_driver(drv, 1); - disable_irq(cs4231_chip->irq); - free_irq(cs4231_chip->irq, drv); - if (!(cs4231_chip->status & CS_STATUS_IS_EBUS)) { - sbus_iounmap(cs4231_chip->regs, cs4231_chip->regs_size); - } else { -#ifdef EB4231_SUPPORT - iounmap(cs4231_chip->regs); - iounmap(cs4231_chip->eb2p); - iounmap(cs4231_chip->eb2c); - disable_irq(cs4231_chip->irq2); - free_irq(cs4231_chip->irq2, drv); -#endif - } - kfree(drv->private); -} - -void cleanup_module(void) +static void __exit cs4231_exit(void) { register int i; @@ -2428,8 +2440,10 @@ num_drivers--; } } -#endif +module_init(cs4231_init); +module_exit(cs4231_exit); +MODULE_LICENSE("GPL"); /* * Overrides for Emacs so that we follow Linus's tabbing style. * Emacs will notice this stuff at the end of the file and automatically Index: cs4231.h =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/sbus/audio/cs4231.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 Index: dbri.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/sbus/audio/dbri.c,v retrieving revision 1.1.1.2 retrieving revision 1.2 diff -u -r1.1.1.2 -r1.2 --- dbri.c 25 Feb 2001 23:15:10 -0000 1.1.1.2 +++ dbri.c 11 Apr 2002 12:55:56 -0000 1.2 @@ -61,7 +61,7 @@ #include <asm/audioio.h> #include "dbri.h" -#if defined(DBRI_ISDN) && defined (LINUX_VERSION_CODE) && LINUX_VERSION_CODE > 0x200ff +#if defined(DBRI_ISDN) #include "../../isdn/hisax/hisax.h" #include "../../isdn/hisax/isdnl1.h" #include "../../isdn/hisax/foreign.h" @@ -2227,7 +2227,7 @@ recv_on_pipe(dbri, 8+chan, buffer, size, callback, callback_arg); } -#if defined(DBRI_ISDN) && defined (LINUX_VERSION_CODE) && LINUX_VERSION_CODE > 0x200ff +#if defined(DBRI_ISDN) struct foreign_interface dbri_foreign_interface = { dbri_get_irqnum, dbri_get_liu_state, @@ -2336,11 +2336,7 @@ } /* Probe for the dbri chip and then attach the driver. */ -#ifdef MODULE -int init_module(void) -#else -int __init dbri_init(void) -#endif +static int __init dbri_init(void) { struct sbus_bus *sbus; struct sbus_dev *sdev; @@ -2368,8 +2364,7 @@ return (num_drivers > 0) ? 0 : -EIO; } -#ifdef MODULE -void cleanup_module(void) +static void __exit dbri_exit(void) { register int i; @@ -2379,7 +2374,10 @@ num_drivers--; } } -#endif + +module_init(dbri_init); +module_exit(dbri_exit); +MODULE_LICENSE("GPL"); /* * Overrides for Emacs so that we follow Linus's tabbing style. Index: dbri.h =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/sbus/audio/dbri.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 Index: dmy.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/sbus/audio/dmy.c,v retrieving revision 1.1.1.2 retrieving revision 1.2 diff -u -r1.1.1.2 -r1.2 --- dmy.c 25 Feb 2001 23:15:10 -0000 1.1.1.2 +++ dmy.c 11 Apr 2002 12:55:56 -0000 1.2 @@ -36,7 +36,7 @@ static int dummy_record_gain(struct sparcaudio_driver *drv, int value, unsigned char balance); static int dummy_output_muted(struct sparcaudio_driver *drv, int value); -static int dummy_attach(struct sparcaudio_driver *drv); +static int dummy_attach(struct sparcaudio_driver *drv) __init; static int dummy_set_output_encoding(struct sparcaudio_driver *drv, int value) @@ -710,25 +710,8 @@ dummy_get_formats, }; -/* Probe for the dummy chip and then attach the driver. */ -#ifdef MODULE -int init_module(void) -#else -int __init dummy_init(void) -#endif -{ - num_drivers = 0; - - /* Add support here for specifying multiple dummies to attach at once. */ - if (dummy_attach(&drivers[num_drivers]) == 0) - num_drivers++; - - /* Only return success if we found some dummy chips. */ - return (num_drivers > 0) ? 0 : -EIO; -} - /* Attach to an dummy chip given its PROM node. */ -static int dummy_attach(struct sparcaudio_driver *drv) +static int __init dummy_attach(struct sparcaudio_driver *drv) { struct dummy_chip *dummy_chip; int err; @@ -768,15 +751,27 @@ return 0; } -#ifdef MODULE /* Detach from an dummy chip given the device structure. */ -static void dummy_detach(struct sparcaudio_driver *drv) +static void __exit dummy_detach(struct sparcaudio_driver *drv) { unregister_sparcaudio_driver(drv, 2); kfree(drv->private); } -void cleanup_module(void) +/* Probe for the dummy chip and then attach the driver. */ +static int __init dummy_init(void) +{ + num_drivers = 0; + + /* Add support here for specifying multiple dummies to attach at once. */ + if (dummy_attach(&drivers[num_drivers]) == 0) + num_drivers++; + + /* Only return success if we found some dummy chips. */ + return (num_drivers > 0) ? 0 : -EIO; +} + +static void __exit dummy_exit(void) { int i; @@ -785,7 +780,10 @@ num_drivers--; } } -#endif + +module_init(dummy_init); +module_exit(dummy_exit); +MODULE_LICENSE("GPL"); /* * Overrides for Emacs so that we follow Linus's tabbing style. Index: dummy.h =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/sbus/audio/dummy.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 |