Setting driver pointer before mapping required for write combining
support since commit
4a928ef9f611 ("bus/pci: enable write combining
during mapping").
Move comments that got separated after different changes.
Also change the condition relying on dev->driver itself.
Signed-off-by: David Marchand <david.marchand@redhat.com>
RTE_LOG(DEBUG, EAL, " probe driver: %x:%x %s\n", dev->id.vendor_id,
dev->id.device_id, dr->driver.name);
RTE_LOG(DEBUG, EAL, " probe driver: %x:%x %s\n", dev->id.vendor_id,
dev->id.device_id, dr->driver.name);
- /*
- * reference driver structure
- * This needs to be before rte_pci_map_device(), as it enables to use
- * driver flags for adjusting configuration.
- */
if (!already_probed) {
enum rte_iova_mode dev_iova_mode;
enum rte_iova_mode iova_mode;
if (!already_probed) {
enum rte_iova_mode dev_iova_mode;
enum rte_iova_mode iova_mode;
+ /*
+ * Reference driver structure.
+ * This needs to be before rte_pci_map_device(), as it enables
+ * to use driver flags for adjusting configuration.
+ */
-
- if (dr->drv_flags & RTE_PCI_DRV_NEED_MAPPING) {
+ if (dev->driver->drv_flags & RTE_PCI_DRV_NEED_MAPPING) {
ret = rte_pci_map_device(dev);
if (ret != 0) {
dev->driver = NULL;
ret = rte_pci_map_device(dev);
if (ret != 0) {
dev->driver = NULL;