The branch stable/13 has been updated by jhb:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=992262511493351139053a94da58099e746228b1

commit 992262511493351139053a94da58099e746228b1
Author:     John Baldwin <[email protected]>
AuthorDate: 2024-02-15 20:26:19 +0000
Commit:     John Baldwin <[email protected]>
CommitDate: 2024-04-08 17:57:29 +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 e07f1de4983b..d72ae6152760 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;

Reply via email to