Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 22 Dec 2002 20:44:33 -0800 (PST)
From:      Marcel Moolenaar <marcel@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 22652 for review
Message-ID:  <200212230444.gBN4iXO6012813@repoman.freebsd.org>

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

Change 22652 by marcel@marcel_nfs on 2002/12/22 20:43:42

	We have a memory mapped serial console:
		sio0 iomem 0xff5e0000-0xff5e0007 irq 34 on acpi0
		sio0: type 16550, console
	Start cleaning things up by removing unused code and
	"explicit lyrics". Also, make the bus driver glue conditional
	on the presence of the bus. This makes me happy because the
	HP box doesn't have an ISA bus and will make bde happy because
	he doesn't have ACPI enabled ;-)
	
	Interrupts are still broken by the previous interface change.

Affected files ...

.. //depot/projects/ia64/sys/dev/sio/sio_isa.c#11 edit

Differences ...

==== //depot/projects/ia64/sys/dev/sio/sio_isa.c#11 (text+ko) ====

@@ -24,6 +24,8 @@
  * $FreeBSD: src/sys/dev/sio/sio_isa.c,v 1.9 2002/05/06 09:02:55 dwmalone Exp $
  */
 
+#include "opt_acpi.h"
+
 #include <sys/param.h>
 #include <sys/systm.h>
 #include <sys/bus.h>
@@ -154,19 +156,12 @@
 
 	*rid = 0;
 	*sp = SYS_RES_IOPORT;
-	device_printf(dev, "trying I/O port\n");
 	res = bus_alloc_resource(dev, *sp, rid, 0, ~0, 8, RF_ACTIVE);
 	if (res == NULL) {
-		device_printf(dev, "trying memory mapped\n");
 		*rid = 0;
 		*sp = SYS_RES_MEMORY;
 		res = bus_alloc_resource(dev, *sp, rid, 0, ~0, 8, RF_ACTIVE);
-		if (res == NULL) {
-			device_printf(dev, "Bollocks!\n");
-			return (NULL);
-		}
 	}
-
 	return (res);
 }
 
@@ -181,10 +176,10 @@
 	if (ISA_PNP_PROBE(device_get_parent(dev), dev, sio_ids) == ENXIO)
 		return (ENXIO);
 
-	com = device_get_softc(dev);
 	res = sio_isa_alloc(dev, &space, &rid);
 	if (res == NULL)
-		return (0);
+		return (ENXIO);
+	com = device_get_softc(dev);
 	com->bsh = rman_get_bushandle(res);
 	com->bst = rman_get_bustag(res);
 	error = sioprobe(dev);
@@ -193,14 +188,11 @@
 }
 
 static int
-sio_isa_attach(dev)
-	device_t	dev;
+sio_isa_attach(device_t dev)
 {
-	struct com_s *com;
 	struct resource *res;
 	int error, rid, space;
 
-	com = device_get_softc(dev);
 	res = sio_isa_alloc(dev, &space, &rid);
 	if (res == NULL)
 		return (ENXIO);
@@ -210,5 +202,9 @@
 	return (error);
 }
 
+#ifdef DEV_ISA
 DRIVER_MODULE(sio, isa, sio_isa_driver, sio_devclass, 0, 0);
+#endif
+#ifdef DEV_ACPI
 DRIVER_MODULE(sio, acpi, sio_isa_driver, sio_devclass, 0, 0);
+#endif

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe p4-projects" in the body of the message




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