Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F102036067
D45433.id139283.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
3 KB
Referenced Files
None
Subscribers
None
D45433.id139283.diff
View Options
diff --git a/sys/dev/acpica/acpi.c b/sys/dev/acpica/acpi.c
--- a/sys/dev/acpica/acpi.c
+++ b/sys/dev/acpica/acpi.c
@@ -1651,19 +1651,22 @@
args.offset = start - rman_get_start(sysres);
args.length = length;
- return (bus_generic_map_resource(bus, child, sysres, &args, map));
+ return (bus_map_resource(bus, sysres, &args, map));
}
static int
acpi_unmap_resource(device_t bus, device_t child, struct resource *r,
struct resource_map *map)
{
- if (acpi_is_resource_managed(bus, r)) {
- r = acpi_managed_resource(bus, r);
- if (r == NULL)
- return (ENOENT);
- }
- return (bus_generic_unmap_resource(bus, child, r, map));
+ struct resource *sysres;
+
+ if (!acpi_is_resource_managed(bus, r))
+ return (bus_generic_unmap_resource(bus, child, r, map));
+
+ sysres = acpi_managed_resource(bus, r);
+ if (sysres == NULL)
+ return (ENOENT);
+ return (bus_unmap_resource(bus, sysres, map));
}
/* Allocate an IO port or memory resource, given its GAS. */
diff --git a/sys/dev/pci/pci_host_generic.c b/sys/dev/pci/pci_host_generic.c
--- a/sys/dev/pci/pci_host_generic.c
+++ b/sys/dev/pci/pci_host_generic.c
@@ -646,7 +646,7 @@
args.offset = start - range->pci_base;
args.length = length;
- return (bus_generic_map_resource(dev, child, range->res, &args, map));
+ return (bus_map_resource(dev, range->res, &args, map));
}
static int
@@ -664,16 +664,16 @@
#endif
case SYS_RES_IOPORT:
case SYS_RES_MEMORY:
- range = generic_pcie_containing_range(dev, type,
- rman_get_start(r), rman_get_end(r));
- if (range == NULL || range->res == NULL)
- return (ENOENT);
- r = range->res;
break;
default:
- break;
+ return (bus_generic_unmap_resource(dev, child, r, argsp, map));
}
- return (bus_generic_unmap_resource(dev, child, r, map));
+
+ range = generic_pcie_containing_range(dev, type, rman_get_start(r),
+ rman_get_end(r));
+ if (range == NULL || range->res == NULL)
+ return (ENOENT);
+ return (bus_unmap_resource(dev, range->res, map));
}
static bus_dma_tag_t
diff --git a/sys/dev/pci/pci_pci.c b/sys/dev/pci/pci_pci.c
--- a/sys/dev/pci/pci_pci.c
+++ b/sys/dev/pci/pci_pci.c
@@ -2549,7 +2549,7 @@
args.offset = start - rman_get_start(pres);
args.length = length;
- return (bus_generic_map_resource(dev, child, pres, &args, map));
+ return (bus_map_resource(dev, pres, &args, map));
}
static int
@@ -2558,14 +2558,16 @@
{
struct pcib_softc *sc = device_get_softc(dev);
struct pcib_window *w;
+ struct resource *pres;
w = pcib_get_resource_window(sc, r);
- if (w != NULL) {
- r = pcib_find_parent_resource(w, r);
- if (r == NULL)
- return (ENOENT);
- }
- return (bus_generic_unmap_resource(dev, child, r, map));
+ if (w == NULL)
+ return (bus_generic_unmap_resource(dev, child, r, map));
+
+ pres = pcib_find_parent_resource(w, r);
+ if (pres == NULL)
+ return (ENOENT);
+ return (bus_unmap_resource(dev, pres, map));
}
#else
/*
diff --git a/sys/dev/vmd/vmd.c b/sys/dev/vmd/vmd.c
--- a/sys/dev/vmd/vmd.c
+++ b/sys/dev/vmd/vmd.c
@@ -543,7 +543,7 @@
args.offset = start - rman_get_start(pres);
args.length = length;
- return (bus_generic_map_resource(dev, child, pres, &args, map));
+ return (bus_map_resource(dev, pres, &args, map));
}
static int
@@ -551,11 +551,12 @@
struct resource_map *map)
{
struct vmd_softc *sc = device_get_softc(dev);
+ struct resource *pres;
- r = vmd_find_parent_resource(sc, r);
- if (r == NULL)
+ pres = vmd_find_parent_resource(sc, r);
+ if (pres == NULL)
return (ENOENT);
- return (bus_generic_unmap_resource(dev, child, r, map));
+ return (bus_unmap_resource(dev, pres, map));
}
static int
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Nov 7, 7:34 PM (16 h, 32 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14519368
Default Alt Text
D45433.id139283.diff (3 KB)
Attached To
Mode
D45433: acpi/pci/vmd: Fix a nit with nested resource mapping requests
Attached
Detach File
Event Timeline
Log In to Comment