Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 7 Feb 2012 19:40:52 +0000 (UTC)
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject:   svn commit: r231153 - stable/9/sys/dev/ichwd
Message-ID:  <201202071940.q17JeqjF004449@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jhb
Date: Tue Feb  7 19:40:52 2012
New Revision: 231153
URL: http://svn.freebsd.org/changeset/base/231153

Log:
  MFC 229598:
  Remove use of explicit bus space tags and handles and use methods that
  operate on resource objects instead.

Modified:
  stable/9/sys/dev/ichwd/ichwd.c
  stable/9/sys/dev/ichwd/ichwd.h
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/amd64/include/xen/   (props changed)
  stable/9/sys/boot/   (props changed)
  stable/9/sys/boot/i386/efi/   (props changed)
  stable/9/sys/boot/ia64/efi/   (props changed)
  stable/9/sys/boot/ia64/ski/   (props changed)
  stable/9/sys/boot/powerpc/boot1.chrp/   (props changed)
  stable/9/sys/boot/powerpc/ofw/   (props changed)
  stable/9/sys/cddl/contrib/opensolaris/   (props changed)
  stable/9/sys/conf/   (props changed)
  stable/9/sys/contrib/dev/acpica/   (props changed)
  stable/9/sys/contrib/octeon-sdk/   (props changed)
  stable/9/sys/contrib/pf/   (props changed)
  stable/9/sys/contrib/x86emu/   (props changed)

Modified: stable/9/sys/dev/ichwd/ichwd.c
==============================================================================
--- stable/9/sys/dev/ichwd/ichwd.c	Tue Feb  7 19:32:20 2012	(r231152)
+++ stable/9/sys/dev/ichwd/ichwd.c	Tue Feb  7 19:40:52 2012	(r231153)
@@ -198,26 +198,26 @@ static struct ichwd_device ichwd_devices
 static devclass_t ichwd_devclass;
 
 #define ichwd_read_tco_1(sc, off) \
-	bus_space_read_1((sc)->tco_bst, (sc)->tco_bsh, (off))
+	bus_read_1((sc)->tco_res, (off))
 #define ichwd_read_tco_2(sc, off) \
-	bus_space_read_2((sc)->tco_bst, (sc)->tco_bsh, (off))
+	bus_read_2((sc)->tco_res, (off))
 #define ichwd_read_tco_4(sc, off) \
-	bus_space_read_4((sc)->tco_bst, (sc)->tco_bsh, (off))
+	bus_read_4((sc)->tco_res, (off))
 #define ichwd_read_smi_4(sc, off) \
-	bus_space_read_4((sc)->smi_bst, (sc)->smi_bsh, (off))
+	bus_read_4((sc)->smi_res, (off))
 #define ichwd_read_gcs_4(sc, off) \
-	bus_space_read_4((sc)->gcs_bst, (sc)->gcs_bsh, (off))
+	bus_read_4((sc)->gcs_res, (off))
 
 #define ichwd_write_tco_1(sc, off, val) \
-	bus_space_write_1((sc)->tco_bst, (sc)->tco_bsh, (off), (val))
+	bus_write_1((sc)->tco_res, (off), (val))
 #define ichwd_write_tco_2(sc, off, val) \
-	bus_space_write_2((sc)->tco_bst, (sc)->tco_bsh, (off), (val))
+	bus_write_2((sc)->tco_res, (off), (val))
 #define ichwd_write_tco_4(sc, off, val) \
-	bus_space_write_4((sc)->tco_bst, (sc)->tco_bsh, (off), (val))
+	bus_write_4((sc)->tco_res, (off), (val))
 #define ichwd_write_smi_4(sc, off, val) \
-	bus_space_write_4((sc)->smi_bst, (sc)->smi_bsh, (off), (val))
+	bus_write_4((sc)->smi_res, (off), (val))
 #define ichwd_write_gcs_4(sc, off, val) \
-	bus_space_write_4((sc)->gcs_bst, (sc)->gcs_bsh, (off), (val))
+	bus_write_4((sc)->gcs_res, (off), (val))
 
 #define ichwd_verbose_printf(dev, ...) \
 	do {						\
@@ -519,8 +519,6 @@ ichwd_attach(device_t dev)
 		device_printf(dev, "unable to reserve SMI registers\n");
 		goto fail;
 	}
-	sc->smi_bst = rman_get_bustag(sc->smi_res);
-	sc->smi_bsh = rman_get_bushandle(sc->smi_res);
 
 	sc->tco_rid = 1;
 	sc->tco_res = bus_alloc_resource(dev, SYS_RES_IOPORT, &sc->tco_rid,
@@ -530,8 +528,6 @@ ichwd_attach(device_t dev)
 		device_printf(dev, "unable to reserve TCO registers\n");
 		goto fail;
 	}
-	sc->tco_bst = rman_get_bustag(sc->tco_res);
-	sc->tco_bsh = rman_get_bushandle(sc->tco_res);
 
 	sc->gcs_rid = 0;
 	if (sc->ich_version >= 6) {
@@ -541,12 +537,6 @@ ichwd_attach(device_t dev)
 			device_printf(dev, "unable to reserve GCS registers\n");
 			goto fail;
 		}
-		sc->gcs_bst = rman_get_bustag(sc->gcs_res);
-		sc->gcs_bsh = rman_get_bushandle(sc->gcs_res);
-	} else {
-		sc->gcs_res = 0;
-		sc->gcs_bst = 0;
-		sc->gcs_bsh = 0;
 	}
 
 	if (ichwd_clear_noreboot(sc) != 0)

Modified: stable/9/sys/dev/ichwd/ichwd.h
==============================================================================
--- stable/9/sys/dev/ichwd/ichwd.h	Tue Feb  7 19:32:20 2012	(r231152)
+++ stable/9/sys/dev/ichwd/ichwd.h	Tue Feb  7 19:40:52 2012	(r231153)
@@ -48,18 +48,12 @@ struct ichwd_softc {
 	int			 smi_enabled;
 	int			 smi_rid;
 	struct resource		*smi_res;
-	bus_space_tag_t		 smi_bst;
-	bus_space_handle_t	 smi_bsh;
 
 	int			 tco_rid;
 	struct resource		*tco_res;
-	bus_space_tag_t		 tco_bst;
-	bus_space_handle_t	 tco_bsh;
 
 	int			 gcs_rid;
 	struct resource		*gcs_res;
-	bus_space_tag_t		 gcs_bst;
-	bus_space_handle_t	 gcs_bsh;
 
 	eventhandler_tag	 ev_tag;
 };



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