Commit 83fb4af6 authored by Krzysztof Blaszkowski's avatar Krzysztof Blaszkowski Committed by Doug Ledford

IB/hfi1: Return ENODEV for unsupported PCI device ids.

Clean up device type checking.
Reviewed-by: default avatarDean Luick <dean.luick@intel.com>
Signed-off-by: default avatarKrzysztof Blaszkowski <krzysztof.blaszkowski@intel.com>
Signed-off-by: default avatarTymoteusz Kielan <tymoteusz.kielan@intel.com>
Signed-off-by: default avatarDennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
parent acd7c8fe
...@@ -1402,7 +1402,7 @@ static void postinit_cleanup(struct hfi1_devdata *dd) ...@@ -1402,7 +1402,7 @@ static void postinit_cleanup(struct hfi1_devdata *dd)
static int init_one(struct pci_dev *pdev, const struct pci_device_id *ent) static int init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
{ {
int ret = 0, j, pidx, initfail; int ret = 0, j, pidx, initfail;
struct hfi1_devdata *dd = ERR_PTR(-EINVAL); struct hfi1_devdata *dd;
struct hfi1_pportdata *ppd; struct hfi1_pportdata *ppd;
/* First, lock the non-writable module parameters */ /* First, lock the non-writable module parameters */
...@@ -1461,26 +1461,25 @@ static int init_one(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -1461,26 +1461,25 @@ static int init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
if (ret) if (ret)
goto bail; goto bail;
/* if (!(ent->device == PCI_DEVICE_ID_INTEL0 ||
* Do device-specific initialization, function table setup, dd ent->device == PCI_DEVICE_ID_INTEL1)) {
* allocation, etc.
*/
switch (ent->device) {
case PCI_DEVICE_ID_INTEL0:
case PCI_DEVICE_ID_INTEL1:
dd = hfi1_init_dd(pdev, ent);
break;
default:
hfi1_early_err(&pdev->dev, hfi1_early_err(&pdev->dev,
"Failing on unknown Intel deviceid 0x%x\n", "Failing on unknown Intel deviceid 0x%x\n",
ent->device); ent->device);
ret = -ENODEV; ret = -ENODEV;
goto clean_bail;
} }
if (IS_ERR(dd)) /*
* Do device-specific initialization, function table setup, dd
* allocation, etc.
*/
dd = hfi1_init_dd(pdev, ent);
if (IS_ERR(dd)) {
ret = PTR_ERR(dd); ret = PTR_ERR(dd);
if (ret)
goto clean_bail; /* error already printed */ goto clean_bail; /* error already printed */
}
ret = create_workqueues(dd); ret = create_workqueues(dd);
if (ret) if (ret)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment