diff options
author | Poul-Henning Kamp <phk@FreeBSD.org> | 2005-09-28 18:06:25 +0000 |
---|---|---|
committer | Poul-Henning Kamp <phk@FreeBSD.org> | 2005-09-28 18:06:25 +0000 |
commit | 64fd97df547ae86a355a50d8f667f0d3fdb8483f (patch) | |
tree | 93bbc1cddf41f301ccc4f06c37aa32c562ada9b3 /sys/dev/puc | |
parent | 29442a30e282fd886a9a37fd036072d2b4e6731f (diff) | |
download | src-64fd97df547ae86a355a50d8f667f0d3fdb8483f.tar.gz src-64fd97df547ae86a355a50d8f667f0d3fdb8483f.zip |
puc(4) does strange things to resources in order to fool the
subdrivers to hook up.
It should probably be rewritten to implement a simple bus to which
the sub drivers attach using some kind of hint.
Until then, provide a couple of crutch functions with big warning
signs so it can survive the recent changes to struct resource.
Notes
Notes:
svn path=/head/; revision=150698
Diffstat (limited to 'sys/dev/puc')
-rw-r--r-- | sys/dev/puc/puc.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/sys/dev/puc/puc.c b/sys/dev/puc/puc.c index 8eb80348aed0..8866bb1c62e9 100644 --- a/sys/dev/puc/puc.c +++ b/sys/dev/puc/puc.c @@ -316,8 +316,7 @@ puc_attach(device_t dev, const struct puc_device_description *desc) if (sc->barmuxed == 0) { rle->res = sc->sc_bar_mappings[bidx].res; } else { - rle->res = malloc(sizeof(struct resource), M_DEVBUF, - M_WAITOK | M_ZERO); + rle->res = rman_secret_puc_alloc_resource(M_WAITOK); if (rle->res == NULL) { free(pdev, M_DEVBUF); return (ENOMEM); @@ -352,7 +351,7 @@ puc_attach(device_t dev, const struct puc_device_description *desc) if (sc->barmuxed) { bus_space_unmap(rman_get_bustag(rle->res), rman_get_bushandle(rle->res), ressz); - free(rle->res, M_DEVBUF); + rman_secret_puc_free_resource(rle->res); free(pdev, M_DEVBUF); } continue; @@ -372,7 +371,7 @@ puc_attach(device_t dev, const struct puc_device_description *desc) if (sc->barmuxed) { bus_space_unmap(rman_get_bustag(rle->res), rman_get_bushandle(rle->res), ressz); - free(rle->res, M_DEVBUF); + rman_secret_puc_free_resource(rle->res); free(pdev, M_DEVBUF); } } |