pcim_enable_device()
is a managed version of pci_enable_device()
. Means that if you call pci_enable_device()
, you also need to call pci_disable_device()
in the end. In case of pcim_enable_device()
, managed framework will take care of disable operation for you.
In new kernel versions it is recommended to use such managed functions in order to get rid of error handling in your driver code. See this article to get a clue about device resource management (or devres) API. This particular function (pcim_enable_device
) was introduced in this patch. If you want to read more about devres framework, see Documentation/driver-model/devres.txt
The book you mentioned ("Linux Device Drivers, 3rd edition") doesn't have any explanation for managed functions, because it was written before those functions were implemented.