@@ -1551,9 +1551,8 @@ exar_pci_probe(struct pci_dev *pcidev, const struct pci_device_id *ent)
nr_ports = exar_get_nr_ports(board, pcidev);
if (nr_ports == 0) {
- dev_err_probe(&pcidev->dev, -ENODEV,
+ return dev_err_probe(&pcidev->dev, -ENODEV,
"failed to get number of ports\n");
- return -ENODEV;
}
priv = devm_kzalloc(&pcidev->dev, struct_size(priv, line, nr_ports), GFP_KERNEL);
@@ -1587,9 +1586,8 @@ exar_pci_probe(struct pci_dev *pcidev, const struct pci_device_id *ent)
if (board->board_init) {
rc = board->board_init(priv, pcidev);
if (rc) {
- dev_err_probe(&pcidev->dev, rc,
+ return dev_err_probe(&pcidev->dev, rc,
"failed to init serial board\n");
- return rc;
}
}