- Propagate error code from various bus_dma functions in bfe_dma_alloc.
- Correctly destroy dmamaps for partially initialised descriptor rings
in bfe_dma_alloc, if one of the dmamap creations failed.
- Centralise error handling of bfe_attach in bfe_detach.
- Move call to bfe_chip_reset in bfe_detach into the device_is_attached
section.
- Move bus_teardown_intr() and bus_release_resource() from
bfe_release_resources to bfe_detach; rename the former to bfe_dma_free
to reflect remaining code.
- Call bus_dmamem_free only if the pointer is not NULL, set it to NULL
after it has been destroyed.
- Do not destroy dmamaps in bfe_stop, do it in bfe_detach.
- Correct DMA sync directions in bfe_list_newbuf.
Based-on: FreeBSD
Submitted-by: Sepherosa Ziehau <sepherosa@gmail.com>