Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 27 Aug 2003 16:34:33 -0700 (PDT)
From:      Marcel Moolenaar <marcel@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 37047 for review
Message-ID:  <200308272334.h7RNYXji030707@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=37047

Change 37047 by marcel@marcel_nfs on 2003/08/27 16:34:04

	Rename the consdev field in struct uart_devinfo to
	cookie. This makes it clear that it can be used by
	any system device for whatever purpose they see fit.
	While here, make uart_console static.

Affected files ...

.. //depot/projects/uart/dev/uart/uart_cpu.h#6 edit
.. //depot/projects/uart/dev/uart/uart_tty.c#8 edit

Differences ...

==== //depot/projects/uart/dev/uart/uart_cpu.h#6 (text+ko) ====

@@ -62,7 +62,7 @@
 #define	UART_DEV_KEYBOARD	2
 	int	(*attach)(struct uart_softc*);
 	int	(*detach)(struct uart_softc*);
-	void	*consdev;		/* Yedi trick. See uart_cons.c */
+	void	*cookie;		/* Type dependent use. */
 };
 
 int uart_cpu_getdev(int devtype, struct uart_devinfo *di);

==== //depot/projects/uart/dev/uart/uart_tty.c#8 (text+ko) ====

@@ -79,7 +79,7 @@
 	.d_kqfilter = ttykqfilter,
 };
 
-struct uart_devinfo uart_console;
+static struct uart_devinfo uart_console;
 
 static void
 uart_cnprobe(struct consdev *cp)
@@ -88,7 +88,7 @@
 	cp->cn_dev = NULL;
 	cp->cn_pri = CN_DEAD;
 
-	KASSERT(uart_console.consdev == NULL, ("foo"));
+	KASSERT(uart_console.cookie == NULL, ("foo"));
 
 	if (uart_cpu_getdev(UART_DEV_CONSOLE, &uart_console))
 		return;
@@ -115,8 +115,8 @@
 	 * the unit number will be.
 	 */
 	di = cp->cn_arg;
-	KASSERT(di->consdev == NULL, ("foo"));
-	di->consdev = cp;
+	KASSERT(di->cookie == NULL, ("foo"));
+	di->cookie = cp;
 	di->type = UART_DEV_CONSOLE;
 	uart_add_sysdev(di);
 	uart_init(di);
@@ -313,7 +313,7 @@
 	tp->t_stop = uart_tty_stop;
 
 	if (sc->sc_sysdev != NULL && sc->sc_sysdev->type == UART_DEV_CONSOLE) {
-		((struct consdev *)sc->sc_sysdev->consdev)->cn_dev =
+		((struct consdev *)sc->sc_sysdev->cookie)->cn_dev =
 		    makedev(uart_cdevsw.d_maj, device_get_unit(sc->sc_dev));
 	}
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200308272334.h7RNYXji030707>