Correct alloc_ and release_resource methods in thunder_pcie driver
- Avoid using BUS_ macros as bus_generic_ functions should be used instead. - Fix mistaken device_t pointers in thunder_pcie_alloc_resource. Should use dev->parent method and allocate resource for child device Reviewed by: wma Obtained from: Semihalf Sponsored by: Cavium Differential Revision: https://reviews.freebsd.org/D5068
This commit is contained in:
parent
bc5758b633
commit
88c5cdf401
@ -268,7 +268,7 @@ thunder_pcie_release_resource(device_t dev, device_t child, int type, int rid,
|
|||||||
{
|
{
|
||||||
|
|
||||||
if (type != SYS_RES_MEMORY)
|
if (type != SYS_RES_MEMORY)
|
||||||
return (BUS_RELEASE_RESOURCE(device_get_parent(dev), child,
|
return (bus_generic_release_resource(dev, child,
|
||||||
type, rid, res));
|
type, rid, res));
|
||||||
|
|
||||||
return (rman_release_resource(res));
|
return (rman_release_resource(res));
|
||||||
@ -291,7 +291,7 @@ thunder_pcie_alloc_resource(device_t dev, device_t child, int type, int *rid,
|
|||||||
rm = &sc->mem_rman;
|
rm = &sc->mem_rman;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return (BUS_ALLOC_RESOURCE(device_get_parent(dev), dev,
|
return (bus_generic_alloc_resource(dev, child,
|
||||||
type, rid, start, end, count, flags));
|
type, rid, start, end, count, flags));
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user