bp = devlink_priv(devlink);
err = ptp_ocp_device_init(bp, pdev);
if (err)
- goto out_unregister;
+ goto out_disable;
/* compat mode.
* Older FPGA firmware only returns 2 irq's.
out:
ptp_ocp_detach(bp);
- pci_disable_device(pdev);
pci_set_drvdata(pdev, NULL);
+out_disable:
+ pci_disable_device(pdev);
out_unregister:
devlink_unregister(devlink);
out_free:
struct devlink *devlink = priv_to_devlink(bp);
ptp_ocp_detach(bp);
- pci_disable_device(pdev);
pci_set_drvdata(pdev, NULL);
+ pci_disable_device(pdev);
devlink_unregister(devlink);
devlink_free(devlink);