Update of /cvsroot/alsa/alsa-driver/drivers
In directory sc8-pr-cvs1:/tmp/cvs-serv29800
Modified Files:
serialmidi.c
Log Message:
fixed the compilation on 2.6 kernel.
Index: serialmidi.c
===================================================================
RCS file: /cvsroot/alsa/alsa-driver/drivers/serialmidi.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- serialmidi.c 22 Feb 2003 09:37:11 -0000 1.7
+++ serialmidi.c 24 Sep 2003 16:41:33 -0000 1.8
@@ -132,6 +132,7 @@
int retval = 0;
struct tty_struct *tty;
struct termios old_termios, *ntermios;
+ struct tty_driver *driver;
int ldisc, speed, cflag;
down(&serial->open_lock);
@@ -150,7 +151,12 @@
retval = -EIO;
goto __end;
}
- if (tty->driver.set_termios == NULL) {
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 0) /* correct version? */
+ driver = tty->driver;
+#else
+ driver = &tty->driver;
+#endif
+ if (driver == NULL || driver->set_termios == NULL) {
snd_printk(KERN_ERR "tty %s has not set_termios", serial->sdev);
retval = -EIO;
goto __end;
@@ -215,7 +221,7 @@
ntermios->c_cc[VKILL] = 0;
ntermios->c_cc[VMIN] = 0;
ntermios->c_cc[VTIME] = 0;
- (*tty->driver.set_termios)(tty, &old_termios);
+ (*driver->set_termios)(tty, &old_termios);
serial->tty = tty;
/* some magic here, we need own receive_buf */
@@ -290,12 +296,21 @@
struct tty_struct *tty;
char *buf = serial->tx_buf;
int count;
+ struct tty_driver *driver;
tty = serial->tty;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 0) /* correct version? */
+ driver = tty->driver;
+#else
+ driver = &tty->driver;
+#endif
+ if (driver == NULL)
+ return;
+
if (down_trylock(&tty->atomic_write))
return;
while (1) {
- count = tty->driver.write_room(tty);
+ count = driver->write_room(tty);
if (count <= 0) {
up(&tty->atomic_write);
return;
@@ -303,7 +318,7 @@
count = count > TX_BUF_SIZE ? TX_BUF_SIZE : count;
count = snd_rawmidi_transmit_peek(serial->substream_output, buf,
count);
if (count > 0) {
- count = tty->driver.write(tty, 0, buf, count);
+ count = driver->write(tty, 0, buf, count);
snd_rawmidi_transmit_ack(serial->substream_output, count);
} else {
clear_bit(TTY_DO_WRITE_WAKEUP, &tty->flags);
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Alsa-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/alsa-cvslog