diff options
author | netchild <netchild@FreeBSD.org> | 2007-02-23 13:47:34 +0000 |
---|---|---|
committer | netchild <netchild@FreeBSD.org> | 2007-02-23 13:47:34 +0000 |
commit | 9ff48da7de1cc980a6dfd473d85d650be9f062ed (patch) | |
tree | 91b4aaae1205fe7533687333d8fb0c6e818d5d53 /sys/dev/sound/pci/envy24.c | |
parent | 6a2ffa86e5b748ba71e36d37462a936eb9101be7 (diff) | |
download | FreeBSD-src-9ff48da7de1cc980a6dfd473d85d650be9f062ed.zip FreeBSD-src-9ff48da7de1cc980a6dfd473d85d650be9f062ed.tar.gz |
MFp4 (114068):
Use bus_get_dma_tag() to obtain the parent DMA tag to make the drivers
a little bit more non-ia32/amd64 friendly.
There is no man page for bus_get_dma_tag, so this is modelled after
rev. 1.62 of src/sys/dev/sound/pci/es137x.c by marius.
Inspired by: commit by marius
Diffstat (limited to 'sys/dev/sound/pci/envy24.c')
-rw-r--r-- | sys/dev/sound/pci/envy24.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/dev/sound/pci/envy24.c b/sys/dev/sound/pci/envy24.c index 1ce1be6..b83303b 100644 --- a/sys/dev/sound/pci/envy24.c +++ b/sys/dev/sound/pci/envy24.c @@ -2301,7 +2301,7 @@ envy24_init(struct sc_info *sc) } static int -envy24_alloc_resource(struct sc_info *sc) +envy24_alloc_resource(struct sc_info *sc, device_t dev) { /* allocate I/O port resource */ sc->csid = PCIR_CCS; @@ -2348,7 +2348,8 @@ envy24_alloc_resource(struct sc_info *sc) } /* allocate DMA resource */ - if (bus_dma_tag_create(/*parent*/NULL, /*alignment*/4, /*boundary*/0, + if (bus_dma_tag_create(/*parent*/bus_get_dma_tag(dev), /*alignment*/4, + /*boundary*/0, /*lowaddr*/BUS_SPACE_MAXADDR_ENVY24, /*highaddr*/BUS_SPACE_MAXADDR_ENVY24, /*filter*/NULL, /*filterarg*/NULL, @@ -2394,7 +2395,7 @@ envy24_pci_attach(device_t dev) data = pci_read_config(dev, PCIR_COMMAND, 2); /* allocate resources */ - err = envy24_alloc_resource(sc); + err = envy24_alloc_resource(sc, dev); if (err) { device_printf(dev, "unable to allocate system resources\n"); goto bad; |