summaryrefslogtreecommitdiffstats
path: root/drivers/macintosh
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/macintosh')
-rw-r--r--drivers/macintosh/Makefile2
-rw-r--r--drivers/macintosh/adb.c7
-rw-r--r--drivers/macintosh/mac_keyb.c1
-rw-r--r--drivers/macintosh/macserial.c18
-rw-r--r--drivers/macintosh/macserial.h4
5 files changed, 17 insertions, 15 deletions
diff --git a/drivers/macintosh/Makefile b/drivers/macintosh/Makefile
index e3649ca1a..9a5759fef 100644
--- a/drivers/macintosh/Makefile
+++ b/drivers/macintosh/Makefile
@@ -17,6 +17,8 @@ M_OBJS :=
ifndef CONFIG_MBX
L_OBJS := via-cuda.o macio-adb.o via-pmu.o mediabay.o
+endif
+ifeq ($(CONFIG_MAC_KEYBOARD),y)
LX_OBJS := adb.o
endif
diff --git a/drivers/macintosh/adb.c b/drivers/macintosh/adb.c
index 6fbd00a08..1d33d67ac 100644
--- a/drivers/macintosh/adb.c
+++ b/drivers/macintosh/adb.c
@@ -24,6 +24,7 @@
#include <linux/fs.h>
#include <linux/mm.h>
#include <linux/sched.h>
+#include <linux/wait.h>
#include <asm/prom.h>
#include <asm/adb.h>
#include <asm/cuda.h>
@@ -375,7 +376,7 @@ struct adbdev_state {
spinlock_t lock;
atomic_t n_pending;
struct adb_request *completed;
- struct wait_queue *wait_queue;
+ wait_queue_head_t wait_queue;
int inuse;
};
@@ -421,7 +422,7 @@ static int adb_open(struct inode *inode, struct file *file)
spin_lock_init(&state->lock);
atomic_set(&state->n_pending, 0);
state->completed = NULL;
- state->wait_queue = NULL;
+ init_waitqueue_head(&state->wait_queue);
state->inuse = 1;
return 0;
@@ -458,7 +459,7 @@ static ssize_t adb_read(struct file *file, char *buf,
int ret;
struct adbdev_state *state = file->private_data;
struct adb_request *req;
- struct wait_queue wait = { current, NULL };
+ wait_queue_t wait = __WAITQUEUE_INITIALIZER(wait,current);
unsigned long flags;
if (count < 2)
diff --git a/drivers/macintosh/mac_keyb.c b/drivers/macintosh/mac_keyb.c
index 9df6dc373..93f2cd3fd 100644
--- a/drivers/macintosh/mac_keyb.c
+++ b/drivers/macintosh/mac_keyb.c
@@ -251,7 +251,6 @@ int adb_button3_keycode = 0x7c; /* right option key */
extern int console_loglevel;
extern struct kbd_struct kbd_table[];
-extern struct wait_queue * keypress_wait;
extern void handle_scancode(unsigned char, int);
diff --git a/drivers/macintosh/macserial.c b/drivers/macintosh/macserial.c
index bdfb0198d..2ef67d1b0 100644
--- a/drivers/macintosh/macserial.c
+++ b/drivers/macintosh/macserial.c
@@ -137,11 +137,11 @@ static struct termios *serial_termios_locked[NUM_CHANNELS];
* memory if large numbers of serial ports are open.
*/
static unsigned char tmp_buf[4096]; /* This is cheating */
-static struct semaphore tmp_buf_sem = MUTEX;
+DECLARE_MUTEX(tmp_buf_sem);
-__openfirmware
-static inline int serial_paranoia_check(struct mac_serial *info,
+static inline int __pmac
+serial_paranoia_check(struct mac_serial *info,
dev_t device, const char *routine)
{
#ifdef SERIAL_PARANOIA_CHECK
@@ -165,7 +165,7 @@ static inline int serial_paranoia_check(struct mac_serial *info,
/*
* Reading and writing Z8530 registers.
*/
-static inline unsigned char read_zsreg(struct mac_zschannel *channel,
+static inline unsigned char __pmac read_zsreg(struct mac_zschannel *channel,
unsigned char reg)
{
unsigned char retval;
@@ -185,7 +185,7 @@ static inline unsigned char read_zsreg(struct mac_zschannel *channel,
return retval;
}
-static inline void write_zsreg(struct mac_zschannel *channel,
+static inline void __pmac write_zsreg(struct mac_zschannel *channel,
unsigned char reg, unsigned char value)
{
unsigned long flags;
@@ -201,7 +201,7 @@ static inline void write_zsreg(struct mac_zschannel *channel,
return;
}
-static inline unsigned char read_zsdata(struct mac_zschannel *channel)
+static inline unsigned char __pmac read_zsdata(struct mac_zschannel *channel)
{
unsigned char retval;
@@ -1595,7 +1595,7 @@ static void rs_hangup(struct tty_struct *tty)
static int block_til_ready(struct tty_struct *tty, struct file * filp,
struct mac_serial *info)
{
- struct wait_queue wait = { current, NULL };
+ DECLARE_WAITQUEUE(wait,current);
int retval;
int do_clocal = 0;
@@ -1997,8 +1997,8 @@ int macserial_init(void)
info->tqueue.data = info;
info->callout_termios =callout_driver.init_termios;
info->normal_termios = serial_driver.init_termios;
- info->open_wait = 0;
- info->close_wait = 0;
+ init_waitqueue_head(&info->open_wait);
+ init_waitqueue_head(&info->close_wait);
info->timeout = HZ;
printk("tty%02d at 0x%08x (irq = %d)", info->line,
info->port, info->irq);
diff --git a/drivers/macintosh/macserial.h b/drivers/macintosh/macserial.h
index b296c25f2..135d5a970 100644
--- a/drivers/macintosh/macserial.h
+++ b/drivers/macintosh/macserial.h
@@ -153,8 +153,8 @@ struct mac_serial {
struct tq_struct tqueue_hangup;
struct termios normal_termios;
struct termios callout_termios;
- struct wait_queue *open_wait;
- struct wait_queue *close_wait;
+ wait_queue_head_t open_wait;
+ wait_queue_head_t close_wait;
};