Date: Mon, 8 Apr 2024 19:04:36 GMT From: John Baldwin <jhb@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Subject: git: 00907525212d - stable/14 - vmd: Use bus_read/write_* instead of bus_space_read/write_* Message-ID: <202404081904.438J4aaK094606@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch stable/14 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=00907525212d3cbac7f0ad7ea1ed6f65ce0e05aa commit 00907525212d3cbac7f0ad7ea1ed6f65ce0e05aa Author: John Baldwin <jhb@FreeBSD.org> AuthorDate: 2024-02-15 20:26:19 +0000 Commit: John Baldwin <jhb@FreeBSD.org> CommitDate: 2024-04-08 17:57:24 +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 (cherry picked from commit 76c678688634e9e2ea5f6369fb979aabddbfe426) --- 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 395b789fdff4..7fc045032dc6 100644 --- a/sys/dev/vmd/vmd.c +++ b/sys/dev/vmd/vmd.c @@ -185,14 +185,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); @@ -214,14 +211,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(); } @@ -283,9 +277,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?202404081904.438J4aaK094606>