X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=sound%2Foss%2Fdmasound%2Fdmasound_awacs.c;h=74f975676ccb22dae8766c00989e34226275bd4f;hb=987b0145d94eecf292d8b301228356f44611ab7c;hp=c8e210326893b3f64940c570f95fb21bc8790cbb;hpb=9464c7cf61b9433057924c36e6e02f303a00e768;p=linux-2.6.git diff --git a/sound/oss/dmasound/dmasound_awacs.c b/sound/oss/dmasound/dmasound_awacs.c index c8e210326..74f975676 100644 --- a/sound/oss/dmasound/dmasound_awacs.c +++ b/sound/oss/dmasound/dmasound_awacs.c @@ -80,7 +80,7 @@ #include #include #include -#include +#include #ifdef CONFIG_ADB_CUDA #include #endif @@ -88,6 +88,8 @@ #include #endif +#include + #include #include #include @@ -128,7 +130,7 @@ static struct resource awacs_rsrc[3]; static char awacs_name[64]; static int awacs_revision; static int awacs_sleeping; -static DEFINE_MUTEX(dmasound_mutex); +static DECLARE_MUTEX(dmasound_sem); static int sound_device_id; /* exists after iMac revA */ static int hw_can_byteswap = 1 ; /* most pmac sound h/w can */ @@ -310,11 +312,11 @@ extern int daca_enter_sleep(void); extern int daca_leave_sleep(void); #define TRY_LOCK() \ - if ((rc = mutex_lock_interruptible(&dmasound_mutex)) != 0) \ + if ((rc = down_interruptible(&dmasound_sem)) != 0) \ return rc; -#define LOCK() mutex_lock(&dmasound_mutex); +#define LOCK() down(&dmasound_sem); -#define UNLOCK() mutex_unlock(&dmasound_mutex); +#define UNLOCK() up(&dmasound_sem); /* We use different versions that the ones provided in dmasound.h * @@ -2798,7 +2800,7 @@ __init setup_beep(void) DBDMA_ALIGN(beep_dbdma_cmd_space); /* set up emergency dbdma cmd */ emergency_dbdma_cmd = beep_dbdma_cmd+1 ; - beep_buf = kmalloc(BEEP_BUFLEN * 4, GFP_KERNEL); + beep_buf = (short *) kmalloc(BEEP_BUFLEN * 4, GFP_KERNEL); if (beep_buf == NULL) { printk(KERN_ERR "dmasound_pmac: no memory for beep buffer\n"); kfree(beep_dbdma_cmd_space) ; @@ -2814,7 +2816,7 @@ int __init dmasound_awacs_init(void) struct device_node *io = NULL, *info = NULL; int vol, res; - if (!machine_is(powermac)) + if (_machine != _MACH_Pmac) return -ENODEV; awacs_subframe = 0;