lkml.org 
[lkml]   [2002]   [Aug]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
Subject[PATCH] 23/41 sound/oss/mad16.c - convert cli to spinlocks
From
--- vanilla-2.5.32/sound/oss/mad16.c	Sat Aug 10 00:08:54 2002
+++ linux-2.5-cli-oss/sound/oss/mad16.c Tue Aug 13 15:37:01 2002
@@ -43,7 +43,7 @@
#include <linux/init.h>
#include <linux/module.h>
#include <linux/gameport.h>
-
+#include <linux/spinlock.h>
#include "sound_config.h"

#include "ad1848.h"
@@ -53,7 +53,7 @@
static int mad16_conf;
static int mad16_cdsel;
static struct gameport gameport;
-
+static spinlock_t lock=SPIN_LOCK_UNLOCKED;
static int already_initialized = 0;

#define C928 1
@@ -106,8 +106,7 @@
unsigned long flags;
unsigned char tmp;

- save_flags(flags);
- cli();
+ spin_lock_irqsave(&lock,flags);

switch (board_type) /* Output password */
{
@@ -142,7 +141,7 @@
if (!c924pnp)
tmp = inb(port); else
tmp = inb(port-0x80);
- restore_flags(flags);
+ spin_unlock_irqrestore(&lock,flags);

return tmp;
}
@@ -151,8 +150,7 @@
{
unsigned long flags;

- save_flags(flags);
- cli();
+ spin_lock_irqsave(&lock,flags);

switch (board_type) /* Output password */
{
@@ -185,7 +183,7 @@
if (!c924pnp)
outb(((unsigned char) (value & 0xff)), port); else
outb(((unsigned char) (value & 0xff)), port-0x80);
- restore_flags(flags);
+ spin_unlock_irqrestore(&lock,flags);
}

static int __init detect_c930(void)
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:28    [W:0.034 / U:8.544 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site