Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F146995959
D53410.id165228.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
21 KB
Referenced Files
None
Subscribers
None
D53410.id165228.diff
View Options
diff --git a/sys/dev/bhnd/bcma/bcma_subr.c b/sys/dev/bhnd/bcma/bcma_subr.c
--- a/sys/dev/bhnd/bcma/bcma_subr.c
+++ b/sys/dev/bhnd/bcma/bcma_subr.c
@@ -214,7 +214,7 @@
bhnd_addr_t addr;
bhnd_size_t size;
rman_res_t r_start, r_count, r_end;
- int error;
+ int error, rid_agent;
KASSERT(dinfo->res_agent == NULL, ("double allocation of agent"));
@@ -237,9 +237,9 @@
r_count = size;
r_end = r_start + r_count - 1;
- dinfo->rid_agent = BCMA_AGENT_RID(dinfo);
+ rid_agent = BCMA_AGENT_RID(dinfo);
dinfo->res_agent = BHND_BUS_ALLOC_RESOURCE(bus, bus, SYS_RES_MEMORY,
- dinfo->rid_agent, r_start, r_end, r_count, RF_ACTIVE|RF_SHAREABLE);
+ rid_agent, r_start, r_end, r_count, RF_ACTIVE|RF_SHAREABLE);
if (dinfo->res_agent == NULL) {
device_printf(bus, "failed allocating agent register block for "
"core %u\n", BCMA_DINFO_COREIDX(dinfo));
@@ -332,7 +332,6 @@
dinfo->corecfg = NULL;
dinfo->res_agent = NULL;
- dinfo->rid_agent = -1;
STAILQ_INIT(&dinfo->intrs);
dinfo->num_intrs = 0;
@@ -434,8 +433,7 @@
/* Release agent resource, if any */
if (dinfo->res_agent != NULL) {
- bhnd_release_resource(bus, SYS_RES_MEMORY, dinfo->rid_agent,
- dinfo->res_agent);
+ bhnd_release_resource(bus, dinfo->res_agent);
}
/* Clean up interrupt descriptors */
diff --git a/sys/dev/bhnd/bcma/bcmavar.h b/sys/dev/bhnd/bcma/bcmavar.h
--- a/sys/dev/bhnd/bcma/bcmavar.h
+++ b/sys/dev/bhnd/bcma/bcmavar.h
@@ -180,7 +180,6 @@
struct bhnd_resource *res_agent; /**< Agent (wrapper) resource, or NULL. Not
* all bcma(4) cores have or require an agent. */
- int rid_agent; /**< Agent resource ID, or -1 */
u_int num_intrs; /**< number of interrupt descriptors. */
struct bcma_intr_list intrs; /**< interrupt descriptors */
diff --git a/sys/dev/bhnd/bhnd.h b/sys/dev/bhnd/bhnd.h
--- a/sys/dev/bhnd/bhnd.h
+++ b/sys/dev/bhnd/bhnd.h
@@ -621,14 +621,11 @@
rman_res_t start, rman_res_t end,
rman_res_t count, u_int flags);
int bhnd_bus_generic_release_resource (device_t dev,
- device_t child, int type, int rid,
- struct bhnd_resource *r);
+ device_t child, struct bhnd_resource *r);
int bhnd_bus_generic_activate_resource (device_t dev,
- device_t child, int type, int rid,
- struct bhnd_resource *r);
+ device_t child, struct bhnd_resource *r);
int bhnd_bus_generic_deactivate_resource (device_t dev,
- device_t child, int type, int rid,
- struct bhnd_resource *r);
+ device_t child, struct bhnd_resource *r);
uintptr_t bhnd_bus_generic_get_intr_domain(device_t dev,
device_t child, bool self);
@@ -1323,8 +1320,6 @@
* Activate a previously allocated bhnd resource.
*
* @param dev The device holding ownership of the allocated resource.
- * @param type The type of the resource.
- * @param rid The bus-specific handle identifying the resource.
* @param r A pointer to the resource returned by bhnd_alloc_resource or
* BHND_BUS_ALLOC_RESOURCE.
*
@@ -1332,19 +1327,15 @@
* @retval non-zero an error occurred while activating the resource.
*/
static inline int
-bhnd_activate_resource(device_t dev, int type, int rid,
- struct bhnd_resource *r)
+bhnd_activate_resource(device_t dev, struct bhnd_resource *r)
{
- return BHND_BUS_ACTIVATE_RESOURCE(device_get_parent(dev), dev, type,
- rid, r);
+ return BHND_BUS_ACTIVATE_RESOURCE(device_get_parent(dev), dev, r);
}
/**
* Deactivate a previously activated bhnd resource.
*
* @param dev The device holding ownership of the activated resource.
- * @param type The type of the resource.
- * @param rid The bus-specific handle identifying the resource.
* @param r A pointer to the resource returned by bhnd_alloc_resource or
* BHND_BUS_ALLOC_RESOURCE.
*
@@ -1352,19 +1343,15 @@
* @retval non-zero an error occurred while activating the resource.
*/
static inline int
-bhnd_deactivate_resource(device_t dev, int type, int rid,
- struct bhnd_resource *r)
+bhnd_deactivate_resource(device_t dev, struct bhnd_resource *r)
{
- return BHND_BUS_DEACTIVATE_RESOURCE(device_get_parent(dev), dev, type,
- rid, r);
+ return BHND_BUS_DEACTIVATE_RESOURCE(device_get_parent(dev), dev, r);
}
/**
* Free a resource allocated by bhnd_alloc_resource().
*
* @param dev The device holding ownership of the resource.
- * @param type The type of the resource.
- * @param rid The bus-specific handle identifying the resource.
* @param r A pointer to the resource returned by bhnd_alloc_resource or
* BHND_ALLOC_RESOURCE.
*
@@ -1372,11 +1359,9 @@
* @retval non-zero an error occurred while activating the resource.
*/
static inline int
-bhnd_release_resource(device_t dev, int type, int rid,
- struct bhnd_resource *r)
+bhnd_release_resource(device_t dev, struct bhnd_resource *r)
{
- return BHND_BUS_RELEASE_RESOURCE(device_get_parent(dev), dev, type,
- rid, r);
+ return BHND_BUS_RELEASE_RESOURCE(device_get_parent(dev), dev, r);
}
/**
diff --git a/sys/dev/bhnd/bhnd_bus_if.m b/sys/dev/bhnd/bhnd_bus_if.m
--- a/sys/dev/bhnd/bhnd_bus_if.m
+++ b/sys/dev/bhnd/bhnd_bus_if.m
@@ -939,8 +939,6 @@
METHOD int release_resource {
device_t dev;
device_t child;
- int type;
- int rid;
struct bhnd_resource *res;
} DEFAULT bhnd_bus_generic_release_resource;
@@ -953,8 +951,6 @@
METHOD int activate_resource {
device_t dev;
device_t child;
- int type;
- int rid;
struct bhnd_resource *r;
} DEFAULT bhnd_bus_generic_activate_resource;
@@ -967,8 +963,6 @@
METHOD int deactivate_resource {
device_t dev;
device_t child;
- int type;
- int rid;
struct bhnd_resource *r;
} DEFAULT bhnd_bus_generic_deactivate_resource;
diff --git a/sys/dev/bhnd/bhnd_erom.c b/sys/dev/bhnd/bhnd_erom.c
--- a/sys/dev/bhnd/bhnd_erom.c
+++ b/sys/dev/bhnd/bhnd_erom.c
@@ -73,7 +73,6 @@
device_t owner; /**< device from which we'll allocate resources */
int owner_rid; /**< rid to use when allocating new mappings */
struct bhnd_resource *mapped; /**< current mapping, or NULL */
- int mapped_rid; /**< resource ID of current mapping, or -1 */
};
/**
@@ -390,7 +389,6 @@
iores->owner = dev;
iores->owner_rid = rid;
iores->mapped = NULL;
- iores->mapped_rid = -1;
return (&iores->eio);
}
@@ -420,19 +418,15 @@
}
/* Otherwise, we need to drop the existing mapping */
- bhnd_release_resource(iores->owner, SYS_RES_MEMORY,
- iores->mapped_rid, iores->mapped);
+ bhnd_release_resource(iores->owner, iores->mapped);
iores->mapped = NULL;
- iores->mapped_rid = -1;
}
/* Try to allocate the new mapping */
- iores->mapped_rid = iores->owner_rid;
iores->mapped = bhnd_alloc_resource(iores->owner, SYS_RES_MEMORY,
- iores->mapped_rid, addr, addr+size-1, size,
+ iores->owner_rid, addr, addr+size-1, size,
RF_ACTIVE|RF_SHAREABLE);
if (iores->mapped == NULL) {
- iores->mapped_rid = -1;
return (ENXIO);
}
@@ -481,10 +475,8 @@
/* Release any mapping */
if (iores->mapped) {
- bhnd_release_resource(iores->owner, SYS_RES_MEMORY,
- iores->mapped_rid, iores->mapped);
+ bhnd_release_resource(iores->owner, iores->mapped);
iores->mapped = NULL;
- iores->mapped_rid = -1;
}
free(eio, M_BHND);
diff --git a/sys/dev/bhnd/bhnd_subr.c b/sys/dev/bhnd/bhnd_subr.c
--- a/sys/dev/bhnd/bhnd_subr.c
+++ b/sys/dev/bhnd/bhnd_subr.c
@@ -1044,7 +1044,7 @@
if (res[i] == NULL)
continue;
- bhnd_release_resource(dev, rs[i].type, rs[i].rid, res[i]);
+ bhnd_release_resource(dev, res[i]);
res[i] = NULL;
}
}
@@ -2216,7 +2216,7 @@
/* Attempt activation */
if (flags & RF_ACTIVE) {
- error = BHND_BUS_ACTIVATE_RESOURCE(dev, child, type, rid, br);
+ error = BHND_BUS_ACTIVATE_RESOURCE(dev, child, br);
if (error)
goto failed;
}
@@ -2238,8 +2238,8 @@
* the backing resource to BUS_RELEASE_RESOURCE().
*/
int
-bhnd_bus_generic_release_resource(device_t dev, device_t child, int type,
- int rid, struct bhnd_resource *r)
+bhnd_bus_generic_release_resource(device_t dev, device_t child,
+ struct bhnd_resource *r)
{
int error;
@@ -2262,8 +2262,8 @@
* to a parent bhnd bus or bridge.
*/
int
-bhnd_bus_generic_activate_resource(device_t dev, device_t child, int type,
- int rid, struct bhnd_resource *r)
+bhnd_bus_generic_activate_resource(device_t dev, device_t child,
+ struct bhnd_resource *r)
{
int error;
bool passthrough;
@@ -2273,7 +2273,7 @@
/* Try to delegate to the parent */
if (device_get_parent(dev) != NULL) {
error = BHND_BUS_ACTIVATE_RESOURCE(device_get_parent(dev),
- child, type, rid, r);
+ child, r);
} else {
error = ENODEV;
}
@@ -2282,7 +2282,7 @@
* parent, try falling back on standard resource activation.
*/
if (error && !passthrough) {
- error = bus_activate_resource(child, type, rid, r->res);
+ error = bus_activate_resource(child, r->res);
if (!error)
r->direct = true;
}
@@ -2298,11 +2298,11 @@
*/
int
bhnd_bus_generic_deactivate_resource(device_t dev, device_t child,
- int type, int rid, struct bhnd_resource *r)
+ struct bhnd_resource *r)
{
if (device_get_parent(dev) != NULL)
return (BHND_BUS_DEACTIVATE_RESOURCE(device_get_parent(dev),
- child, type, rid, r));
+ child, r));
return (EINVAL);
}
diff --git a/sys/dev/bhnd/bhndb/bhndb.c b/sys/dev/bhnd/bhndb/bhndb.c
--- a/sys/dev/bhnd/bhndb/bhndb.c
+++ b/sys/dev/bhnd/bhndb/bhndb.c
@@ -1503,7 +1503,7 @@
*/
static int
bhndb_activate_bhnd_resource(device_t dev, device_t child,
- int type, int rid, struct bhnd_resource *r)
+ struct bhnd_resource *r)
{
struct bhndb_softc *sc;
struct bhndb_region *region;
@@ -1522,7 +1522,7 @@
/* Delegate directly to BUS_ACTIVATE_RESOURCE() if the requested
* resource type isn't handled locally. */
- if (bhndb_get_rman(sc, child, type) == NULL) {
+ if (bhndb_get_rman(sc, child, rman_get_type(r->res)) == NULL) {
error = BUS_ACTIVATE_RESOURCE(dev, child, r->res);
if (error == 0)
r->direct = true;
@@ -1535,7 +1535,7 @@
/* Determine the resource priority of bridged resources, and skip direct
* allocation if the priority is too low. */
if (bhndb_get_addrspace(sc, child) == BHNDB_ADDRSPACE_BRIDGED) {
- switch (type) {
+ switch (rman_get_type(r->res)) {
case SYS_RES_IRQ:
/* IRQ resources are always direct */
break;
@@ -1557,7 +1557,7 @@
default:
device_printf(dev, "unsupported resource type %d\n",
- type);
+ rman_get_type(r->res));
return (ENXIO);
}
}
@@ -1591,7 +1591,7 @@
*/
static int
bhndb_deactivate_bhnd_resource(device_t dev, device_t child,
- int type, int rid, struct bhnd_resource *r)
+ struct bhnd_resource *r)
{
int error;
diff --git a/sys/dev/bhnd/cores/chipc/chipc.c b/sys/dev/bhnd/cores/chipc/chipc.c
--- a/sys/dev/bhnd/cores/chipc/chipc.c
+++ b/sys/dev/bhnd/cores/chipc/chipc.c
@@ -1005,17 +1005,16 @@
}
static int
-chipc_activate_bhnd_resource(device_t dev, device_t child, int type,
- int rid, struct bhnd_resource *r)
+chipc_activate_bhnd_resource(device_t dev, device_t child,
+ struct bhnd_resource *r)
{
struct rman *rm;
int error;
/* Delegate non-locally managed resources to parent */
- rm = chipc_get_rman(dev, type, rman_get_flags(r->res));
+ rm = chipc_get_rman(dev, rman_get_type(r->res), rman_get_flags(r->res));
if (rm == NULL || !rman_is_region_manager(r->res, rm)) {
- return (bhnd_bus_generic_activate_resource(dev, child, type,
- rid, r));
+ return (bhnd_bus_generic_activate_resource(dev, child, r));
}
/* Try activating the chipc region resource */
diff --git a/sys/dev/bhnd/cores/chipc/chipc_gpio.c b/sys/dev/bhnd/cores/chipc/chipc_gpio.c
--- a/sys/dev/bhnd/cores/chipc/chipc_gpio.c
+++ b/sys/dev/bhnd/cores/chipc/chipc_gpio.c
@@ -138,8 +138,7 @@
CC_GPIO_LOCK_INIT(sc);
- sc->mem_rid = 0;
- sc->mem_res = bhnd_alloc_resource_any(dev, SYS_RES_MEMORY, sc->mem_rid,
+ sc->mem_res = bhnd_alloc_resource_any(dev, SYS_RES_MEMORY, 0,
RF_ACTIVE|RF_SHAREABLE);
if (sc->mem_res == NULL) {
device_printf(dev, "failed to allocate chipcommon registers\n");
@@ -195,8 +194,7 @@
device_delete_children(dev);
if (sc->mem_res != NULL) {
- bhnd_release_resource(dev, SYS_RES_MEMORY, sc->mem_rid,
- sc->mem_res);
+ bhnd_release_resource(dev, sc->mem_res);
}
CC_GPIO_LOCK_DESTROY(sc);
@@ -218,7 +216,7 @@
if ((error = bhnd_deregister_provider(dev, BHND_SERVICE_ANY)))
return (error);
- bhnd_release_resource(dev, SYS_RES_MEMORY, sc->mem_rid, sc->mem_res);
+ bhnd_release_resource(dev, sc->mem_res);
CC_GPIO_LOCK_DESTROY(sc);
return (0);
diff --git a/sys/dev/bhnd/cores/chipc/chipc_gpiovar.h b/sys/dev/bhnd/cores/chipc/chipc_gpiovar.h
--- a/sys/dev/bhnd/cores/chipc/chipc_gpiovar.h
+++ b/sys/dev/bhnd/cores/chipc/chipc_gpiovar.h
@@ -119,7 +119,6 @@
device_t dev;
device_t gpiobus; /**< attached gpiobus child */
struct bhnd_resource *mem_res; /**< chipcommon register block */
- int mem_rid; /**< resource ID of mem_res */
uint32_t quirks; /**< device quirks (see CC_GPIO_QUIRK_*) */
struct mtx mtx; /**< lock protecting RMW register access */
};
diff --git a/sys/dev/bhnd/cores/chipc/chipc_private.h b/sys/dev/bhnd/cores/chipc/chipc_private.h
--- a/sys/dev/bhnd/cores/chipc/chipc_private.h
+++ b/sys/dev/bhnd/cores/chipc/chipc_private.h
@@ -101,7 +101,6 @@
resource ID */
struct bhnd_resource *cr_res; /**< bus resource, or NULL */
- int cr_res_rid; /**< cr_res RID, if any. */
u_int cr_refs; /**< RF_ALLOCATED refcount */
u_int cr_act_refs; /**< RF_ACTIVE refcount */
diff --git a/sys/dev/bhnd/cores/chipc/chipc_subr.c b/sys/dev/bhnd/cores/chipc/chipc_subr.c
--- a/sys/dev/bhnd/cores/chipc/chipc_subr.c
+++ b/sys/dev/bhnd/cores/chipc/chipc_subr.c
@@ -374,8 +374,7 @@
cr->cr_region_num, cr->cr_refs));
if (cr->cr_res != NULL) {
- bhnd_release_resource(sc->dev, SYS_RES_MEMORY, cr->cr_res_rid,
- cr->cr_res);
+ bhnd_release_resource(sc->dev, cr->cr_res);
}
free(cr, M_BHND);
@@ -462,14 +461,14 @@
("non-NULL resource has refcount"));
/* Fetch initial resource ID */
- if ((cr->cr_res_rid = cr->cr_rid) == -1) {
+ if (cr->cr_rid == -1) {
CHIPC_UNLOCK(sc);
return (EINVAL);
}
/* Allocate resource */
cr->cr_res = bhnd_alloc_resource(sc->dev,
- SYS_RES_MEMORY, cr->cr_res_rid, cr->cr_addr,
+ SYS_RES_MEMORY, cr->cr_rid, cr->cr_addr,
cr->cr_end, cr->cr_count, RF_SHAREABLE);
if (cr->cr_res == NULL) {
CHIPC_UNLOCK(sc);
@@ -488,8 +487,7 @@
/* If this is the first reference, activate the resource */
if (cr->cr_act_refs == 0) {
- error = bhnd_activate_resource(sc->dev, SYS_RES_MEMORY,
- cr->cr_res_rid, cr->cr_res);
+ error = bhnd_activate_resource(sc->dev, cr->cr_res);
if (error) {
/* Drop any allocation reference acquired
* above */
@@ -535,8 +533,7 @@
/* If this is the last reference, deactivate the resource */
if (cr->cr_act_refs == 1) {
- error = bhnd_deactivate_resource(sc->dev,
- SYS_RES_MEMORY, cr->cr_res_rid, cr->cr_res);
+ error = bhnd_deactivate_resource(sc->dev, cr->cr_res);
if (error)
goto done;
}
@@ -549,8 +546,7 @@
KASSERT(cr->cr_refs > 0, ("overrelease of refs"));
/* If this is the last reference, release the resource */
if (cr->cr_refs == 1) {
- error = bhnd_release_resource(sc->dev, SYS_RES_MEMORY,
- cr->cr_res_rid, cr->cr_res);
+ error = bhnd_release_resource(sc->dev, cr->cr_res);
if (error)
goto done;
diff --git a/sys/dev/bhnd/cores/pci/bhnd_pci.c b/sys/dev/bhnd/cores/pci/bhnd_pci.c
--- a/sys/dev/bhnd/cores/pci/bhnd_pci.c
+++ b/sys/dev/bhnd/cores/pci/bhnd_pci.c
@@ -132,7 +132,7 @@
sizeof(bhnd_pci_devs[0]));
/* Allocate bus resources */
- sc->mem_res = bhnd_alloc_resource_any(dev, SYS_RES_MEMORY, sc->mem_rid,
+ sc->mem_res = bhnd_alloc_resource_any(dev, SYS_RES_MEMORY, 0,
RF_ACTIVE);
if (sc->mem_res == NULL)
return (ENXIO);
@@ -156,7 +156,7 @@
if ((error = bus_generic_detach(dev)))
return (error);
- bhnd_release_resource(dev, SYS_RES_MEMORY, sc->mem_rid, sc->mem_res);
+ bhnd_release_resource(dev, sc->mem_res);
BHND_PCI_LOCK_DESTROY(sc);
diff --git a/sys/dev/bhnd/cores/pci/bhnd_pcivar.h b/sys/dev/bhnd/cores/pci/bhnd_pcivar.h
--- a/sys/dev/bhnd/cores/pci/bhnd_pcivar.h
+++ b/sys/dev/bhnd/cores/pci/bhnd_pcivar.h
@@ -99,7 +99,6 @@
accesses. */
struct bhnd_resource *mem_res; /**< device register block. */
- int mem_rid; /**< register block RID */
};
#define BHND_PCI_LOCK_INIT(sc) \
diff --git a/sys/dev/bhnd/cores/pcie2/bhnd_pcie2.c b/sys/dev/bhnd/cores/pcie2/bhnd_pcie2.c
--- a/sys/dev/bhnd/cores/pcie2/bhnd_pcie2.c
+++ b/sys/dev/bhnd/cores/pcie2/bhnd_pcie2.c
@@ -96,7 +96,7 @@
sizeof(bhnd_pcie2_devs[0]));
/* Allocate bus resources */
- sc->mem_res = bhnd_alloc_resource_any(dev, SYS_RES_MEMORY, sc->mem_rid,
+ sc->mem_res = bhnd_alloc_resource_any(dev, SYS_RES_MEMORY, 0,
RF_ACTIVE);
if (sc->mem_res == NULL)
return (ENXIO);
@@ -120,7 +120,7 @@
if ((error = bus_generic_detach(dev)))
return (error);
- bhnd_release_resource(dev, SYS_RES_MEMORY, sc->mem_rid, sc->mem_res);
+ bhnd_release_resource(dev, sc->mem_res);
BHND_PCIE2_LOCK_DESTROY(sc);
diff --git a/sys/dev/bhnd/cores/pcie2/bhnd_pcie2_var.h b/sys/dev/bhnd/cores/pcie2/bhnd_pcie2_var.h
--- a/sys/dev/bhnd/cores/pcie2/bhnd_pcie2_var.h
+++ b/sys/dev/bhnd/cores/pcie2/bhnd_pcie2_var.h
@@ -83,7 +83,6 @@
accesses. */
struct bhnd_resource *mem_res; /**< device register block. */
- int mem_rid; /**< register block RID */
};
#define BHND_PCIE2_LOCK_INIT(sc) \
diff --git a/sys/dev/bhnd/cores/pmu/bhnd_pmu_core.c b/sys/dev/bhnd/cores/pmu/bhnd_pmu_core.c
--- a/sys/dev/bhnd/cores/pmu/bhnd_pmu_core.c
+++ b/sys/dev/bhnd/cores/pmu/bhnd_pmu_core.c
@@ -81,13 +81,11 @@
struct bhnd_pmu_softc *sc;
struct bhnd_resource *res;
int error;
- int rid;
sc = device_get_softc(dev);
/* Allocate register block */
- rid = 0;
- res = bhnd_alloc_resource_any(dev, SYS_RES_MEMORY, rid, RF_ACTIVE);
+ res = bhnd_alloc_resource_any(dev, SYS_RES_MEMORY, 0, RF_ACTIVE);
if (res == NULL) {
device_printf(dev, "failed to allocate resources\n");
return (ENXIO);
@@ -103,11 +101,10 @@
/* Delegate to common driver implementation */
if ((error = bhnd_pmu_attach(dev, res))) {
- bhnd_release_resource(dev, SYS_RES_MEMORY, rid, res);
+ bhnd_release_resource(dev, res);
return (error);
}
- sc->rid = rid;
return (0);
}
@@ -123,7 +120,7 @@
if ((error = bhnd_pmu_detach(dev)))
return (error);
- bhnd_release_resource(dev, SYS_RES_MEMORY, sc->rid, sc->res);
+ bhnd_release_resource(dev, sc->res);
return (0);
}
diff --git a/sys/dev/bhnd/cores/pmu/bhnd_pmuvar.h b/sys/dev/bhnd/cores/pmu/bhnd_pmuvar.h
--- a/sys/dev/bhnd/cores/pmu/bhnd_pmuvar.h
+++ b/sys/dev/bhnd/cores/pmu/bhnd_pmuvar.h
@@ -105,7 +105,6 @@
device_t chipc_dev; /**< chipcommon device */
struct bhnd_resource *res; /**< pmu register block. */
- int rid; /**< pmu register RID */
struct bhnd_core_clkctl *clkctl; /**< pmu clkctl register */
struct mtx mtx; /**< state mutex */
diff --git a/sys/dev/bhnd/nvram/bhnd_sprom.c b/sys/dev/bhnd/nvram/bhnd_sprom.c
--- a/sys/dev/bhnd/nvram/bhnd_sprom.c
+++ b/sys/dev/bhnd/nvram/bhnd_sprom.c
@@ -96,7 +96,6 @@
struct bhnd_nvram_io *io;
struct bhnd_resource *r;
bus_size_t r_size, sprom_size;
- int rid;
int error;
sc = device_get_softc(dev);
@@ -107,8 +106,7 @@
r = NULL;
/* Allocate SPROM resource */
- rid = 0;
- r = bhnd_alloc_resource_any(dev, SYS_RES_MEMORY, rid, RF_ACTIVE);
+ r = bhnd_alloc_resource_any(dev, SYS_RES_MEMORY, 0, RF_ACTIVE);
if (r == NULL) {
device_printf(dev, "failed to allocate resources\n");
return (ENXIO);
@@ -140,7 +138,7 @@
/* Clean up our temporary I/O context and its backing resource */
bhnd_nvram_io_free(io);
- bhnd_release_resource(dev, SYS_RES_MEMORY, rid, r);
+ bhnd_release_resource(dev, r);
io = NULL;
r = NULL;
@@ -160,7 +158,7 @@
bhnd_nvram_io_free(io);
if (r != NULL)
- bhnd_release_resource(dev, SYS_RES_MEMORY, rid, r);
+ bhnd_release_resource(dev, r);
if (sc->store != NULL)
bhnd_nvram_store_free(sc->store);
diff --git a/sys/dev/bhnd/siba/siba.c b/sys/dev/bhnd/siba/siba.c
--- a/sys/dev/bhnd/siba/siba.c
+++ b/sys/dev/bhnd/siba/siba.c
@@ -1182,7 +1182,7 @@
struct siba_addrspace *addrspace;
rman_res_t r_start, r_count, r_end;
uint8_t num_cfg;
- int rid;
+ int cfg_rid, rid;
num_cfg = dinfo->core_id.num_cfg_blocks;
if (num_cfg > SIBA_MAX_CFG) {
@@ -1218,9 +1218,9 @@
});
/* Map the config resource for bus-level access */
- dinfo->cfg_rid[i] = SIBA_CFG_RID(dinfo, i);
+ cfg_rid = SIBA_CFG_RID(dinfo, i);
dinfo->cfg_res[i] = BHND_BUS_ALLOC_RESOURCE(dev, dev,
- SYS_RES_MEMORY, dinfo->cfg_rid[i], r_start, r_end,
+ SYS_RES_MEMORY, cfg_rid, r_start, r_end,
r_count, RF_ACTIVE|RF_SHAREABLE);
if (dinfo->cfg_res[i] == NULL) {
diff --git a/sys/dev/bhnd/siba/siba_subr.c b/sys/dev/bhnd/siba/siba_subr.c
--- a/sys/dev/bhnd/siba/siba_subr.c
+++ b/sys/dev/bhnd/siba/siba_subr.c
@@ -93,7 +93,6 @@
.cb_rid = -1,
});
dinfo->cfg_res[i] = NULL;
- dinfo->cfg_rid[i] = -1;
}
resource_list_init(&dinfo->resources);
@@ -569,11 +568,9 @@
if (dinfo->cfg_res[i] == NULL)
continue;
- bhnd_release_resource(dev, SYS_RES_MEMORY, dinfo->cfg_rid[i],
- dinfo->cfg_res[i]);
+ bhnd_release_resource(dev, dinfo->cfg_res[i]);
dinfo->cfg_res[i] = NULL;
- dinfo->cfg_rid[i] = -1;
}
/* Unmap the core's interrupt */
diff --git a/sys/dev/bhnd/siba/sibavar.h b/sys/dev/bhnd/siba/sibavar.h
--- a/sys/dev/bhnd/siba/sibavar.h
+++ b/sys/dev/bhnd/siba/sibavar.h
@@ -211,7 +211,6 @@
struct siba_intr intr; /**< interrupt flag mapping, if any */
struct bhnd_resource *cfg_res[SIBA_MAX_CFG]; /**< bus-mapped config block registers */
- int cfg_rid[SIBA_MAX_CFG]; /**< bus-mapped config block resource IDs */
siba_pmu_state pmu_state; /**< per-core PMU state */
union {
void *bhnd_info; /**< if SIBA_PMU_BHND, bhnd(4)-managed per-core PMU info. */
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Mar 8, 10:39 AM (1 h, 42 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
29403354
Default Alt Text
D53410.id165228.diff (21 KB)
Attached To
Mode
D53410: bhnd_bus_*_resource: Remove redundant type and rid arguments
Attached
Detach File
Event Timeline
Log In to Comment