Title bus_alloc_resources() Code Update for FreeBSD
Student Christopher Davis
Mentor Warner Losh
Abstract
Project Description

Currently, many devices in FreeBSD's source tree use excessively verbose methods of resource allocation and deallocation. Numerous calls to bus_alloc_resource() or bus_alloc_resource_any() are used to allocate resources, and subsequently, multiple calls to bus_release_resource() are used to free the resources after an error in allocation or when the device is detached.

Recently, however, the bus_alloc_resources() and bus_release_resources() functions have been added. These simple wrappers around bus_alloc_resource_any() and bus_release_resource() both operate on the same resource description, so that much of the repetition once needed to allocate and free resources can be mitigated.

My project is to update driver source code where necessary using the new functions to make the code related to allocation and deallocation simpler and clearer, while making other refinements as needed.

I will patch and test as many drivers as I can during the Summer.