Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 15 Feb 2024 20:28:41 GMT
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 76c678688634 - main - vmd: Use bus_read/write_* instead of bus_space_read/write_*
Message-ID:  <202402152028.41FKSfDA053231@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by jhb:

URL: https://cgit.FreeBSD.org/src/commit/?id=76c678688634e9e2ea5f6369fb979aabddbfe426

commit 76c678688634e9e2ea5f6369fb979aabddbfe426
Author:     John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2024-02-15 20:26:19 +0000
Commit:     John Baldwin <jhb@FreeBSD.org>
CommitDate: 2024-02-15 20:26:19 +0000

    vmd: Use bus_read/write_* instead of bus_space_read/write_*
    
    Using an explicit bus space tag and handle is deprecated.
    
    Reviewed by:    emaste
    Differential Revision:  https://reviews.freebsd.org/D43885
---
 sys/dev/vmd/vmd.c | 21 ++++++---------------
 sys/dev/vmd/vmd.h |  2 --
 2 files changed, 6 insertions(+), 17 deletions(-)

diff --git a/sys/dev/vmd/vmd.c b/sys/dev/vmd/vmd.c
index 1563d707c6b4..d9afe5746421 100644
--- a/sys/dev/vmd/vmd.c
+++ b/sys/dev/vmd/vmd.c
@@ -184,14 +184,11 @@ vmd_read_config(device_t dev, u_int b, u_int s, u_int f, u_int reg, int width)
 
 	switch (width) {
 	case 4:
-		return (bus_space_read_4(sc->vmd_btag, sc->vmd_bhandle,
-		    offset));
+		return (bus_read_4(sc->vmd_regs_res[0], offset));
 	case 2:
-		return (bus_space_read_2(sc->vmd_btag, sc->vmd_bhandle,
-		    offset));
+		return (bus_read_2(sc->vmd_regs_res[0], offset));
 	case 1:
-		return (bus_space_read_1(sc->vmd_btag, sc->vmd_bhandle,
-		    offset));
+		return (bus_read_1(sc->vmd_regs_res[0], offset));
 	default:
 		__assert_unreachable();
 		return (0xffffffff);
@@ -213,14 +210,11 @@ vmd_write_config(device_t dev, u_int b, u_int s, u_int f, u_int reg,
 
 	switch (width) {
 	case 4:
-		return (bus_space_write_4(sc->vmd_btag, sc->vmd_bhandle,
-		    offset, val));
+		return (bus_write_4(sc->vmd_regs_res[0], offset, val));
 	case 2:
-		return (bus_space_write_2(sc->vmd_btag, sc->vmd_bhandle,
-		    offset, val));
+		return (bus_write_2(sc->vmd_regs_res[0], offset, val));
 	case 1:
-		return (bus_space_write_1(sc->vmd_btag, sc->vmd_bhandle,
-		    offset, val));
+		return (bus_write_1(sc->vmd_regs_res[0], offset, val));
 	default:
 		__assert_unreachable();
 	}
@@ -282,9 +276,6 @@ vmd_attach(device_t dev)
 		}
 	}
 
-	sc->vmd_btag = rman_get_bustag(sc->vmd_regs_res[0]);
-	sc->vmd_bhandle = rman_get_bushandle(sc->vmd_regs_res[0]);
-
 	vid = pci_get_vendor(dev);
 	did = pci_get_device(dev);
 	for (t = vmd_devs; t->vmd_name != NULL; t++) {
diff --git a/sys/dev/vmd/vmd.h b/sys/dev/vmd/vmd.h
index a8156ba88a17..2ab943c07a6d 100644
--- a/sys/dev/vmd/vmd.h
+++ b/sys/dev/vmd/vmd.h
@@ -53,8 +53,6 @@ struct vmd_softc {
 #define VMD_MAX_BAR		3
 	int				vmd_regs_rid[VMD_MAX_BAR];
 	struct resource			*vmd_regs_res[VMD_MAX_BAR];
-	bus_space_handle_t		vmd_bhandle;
-	bus_space_tag_t			vmd_btag;
 	struct vmd_irq			*vmd_irq;
 	LIST_HEAD(,vmd_irq_user)	vmd_users;
 	int				vmd_fist_vector;



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