diff options
| author | John Baldwin <jhb@FreeBSD.org> | 2026-05-18 18:52:23 +0000 |
|---|---|---|
| committer | John Baldwin <jhb@FreeBSD.org> | 2026-05-18 18:52:23 +0000 |
| commit | 6dc813301a173e2e1993c3064df162e6218c1231 (patch) | |
| tree | 8416dfcfe0481ac2a06eb075cda5f9a1414c77e3 /sys/arm64 | |
| parent | ffcf5e356644252f2f6c89ba01057af45c216559 (diff) | |
Diffstat (limited to 'sys/arm64')
| -rw-r--r-- | sys/arm64/cavium/thunder_pcie_pem.c | 6 | ||||
| -rw-r--r-- | sys/arm64/iommu/smmu.c | 6 |
2 files changed, 3 insertions, 9 deletions
diff --git a/sys/arm64/cavium/thunder_pcie_pem.c b/sys/arm64/cavium/thunder_pcie_pem.c index 04b892b91c56..092f11241e29 100644 --- a/sys/arm64/cavium/thunder_pcie_pem.c +++ b/sys/arm64/cavium/thunder_pcie_pem.c @@ -760,8 +760,6 @@ thunder_pem_attach(device_t dev) { struct resource_map_request req; struct resource_map map; - devclass_t pci_class; - device_t parent; struct thunder_pem_softc *sc; int error; int rid; @@ -773,9 +771,7 @@ thunder_pem_attach(device_t dev) sc->dev = dev; /* Allocate memory for resource */ - pci_class = devclass_find("pci"); - parent = device_get_parent(dev); - if (device_get_devclass(parent) == pci_class) + if (is_pci_device(dev)) rid = PCIR_BAR(0); else rid = RID_PEM_SPACE; diff --git a/sys/arm64/iommu/smmu.c b/sys/arm64/iommu/smmu.c index a84ef4ae347e..265f1e56f892 100644 --- a/sys/arm64/iommu/smmu.c +++ b/sys/arm64/iommu/smmu.c @@ -1825,7 +1825,6 @@ smmu_ctx_init(device_t dev, struct iommu_ctx *ioctx) struct iommu_domain *iodom; struct smmu_softc *sc; struct smmu_ctx *ctx; - devclass_t pci_class; u_int sid; int err; @@ -1836,8 +1835,7 @@ smmu_ctx_init(device_t dev, struct iommu_ctx *ioctx) domain = ctx->domain; iodom = (struct iommu_domain *)domain; - pci_class = devclass_find("pci"); - if (device_get_devclass(device_get_parent(ctx->dev)) == pci_class) { + if (is_pci_device(ctx->dev)) { err = smmu_pci_get_sid(ctx->dev, NULL, &sid); if (err) return (err); @@ -1863,7 +1861,7 @@ smmu_ctx_init(device_t dev, struct iommu_ctx *ioctx) smmu_init_ste(sc, domain->cd, ctx->sid, ctx->bypass); - if (device_get_devclass(device_get_parent(ctx->dev)) == pci_class) + if (is_pci_device((ctx->dev)) if (iommu_is_buswide_ctx(iodom->iommu, pci_get_bus(ctx->dev))) smmu_set_buswide(dev, domain, ctx); |
