diff --git a/sys/compat/linuxkpi/common/src/linux_pci.c b/sys/compat/linuxkpi/common/src/linux_pci.c --- a/sys/compat/linuxkpi/common/src/linux_pci.c +++ b/sys/compat/linuxkpi/common/src/linux_pci.c @@ -1223,16 +1223,9 @@ if (!lkpi_pci_bar_id_valid(bar)) return (-EINVAL); - /* - * If the bar is not valid, return success without adding the BAR; - * otherwise linuxkpi_pcim_request_all_regions() will error. - */ - if (pci_resource_len(pdev, bar) == 0) - return (0); - /* Likewise if it is neither IO nor MEM, nothing to do for us. */ type = pci_resource_type(pdev, bar); if (type < 0) - return (0); + return (-ENODEV); rid = PCIR_BAR(bar); res = bus_alloc_resource_any(pdev->dev.bsddev, type, &rid, @@ -1300,7 +1293,7 @@ for (bar = 0; bar <= PCIR_MAX_BAR_0; bar++) { error = lkpi_pci_request_region(pdev, bar, res_name, true); - if (error != 0) { + if (error != 0 && error != -ENODEV) { device_printf(pdev->dev.bsddev, "%s: bar %d res_name '%s': " "lkpi_pci_request_region returned %d\n", __func__, bar, res_name, error);