Commit f321ef04 authored by Michał Winiarski's avatar Michał Winiarski Committed by Rodrigo Vivi

drm/xe: Use managed pci_enable_device

Xe uses devres for most of its driver-lifetime resources, use it for pci
device as well.
Signed-off-by: default avatarMichał Winiarski <michal.winiarski@intel.com>
Reviewed-by: default avatarMatt Roper <matthew.d.roper@intel.com>
Link: https://lore.kernel.org/r/20231129214509.1174116-3-michal.winiarski@intel.comSigned-off-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
parent 0d29a76c
...@@ -696,25 +696,26 @@ static int xe_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -696,25 +696,26 @@ static int xe_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
if (xe_display_driver_probe_defer(pdev)) if (xe_display_driver_probe_defer(pdev))
return -EPROBE_DEFER; return -EPROBE_DEFER;
err = pcim_enable_device(pdev);
if (err)
return err;
xe = xe_device_create(pdev, ent); xe = xe_device_create(pdev, ent);
if (IS_ERR(xe)) if (IS_ERR(xe))
return PTR_ERR(xe); return PTR_ERR(xe);
pci_set_drvdata(pdev, xe);
xe_pm_assert_unbounded_bridge(xe); xe_pm_assert_unbounded_bridge(xe);
subplatform_desc = find_subplatform(xe, desc); subplatform_desc = find_subplatform(xe, desc);
pci_set_drvdata(pdev, xe);
err = pci_enable_device(pdev);
if (err)
return err;
pci_set_master(pdev); pci_set_master(pdev);
xe_sriov_probe_early(xe, desc->has_sriov); xe_sriov_probe_early(xe, desc->has_sriov);
err = xe_info_init(xe, desc, subplatform_desc); err = xe_info_init(xe, desc, subplatform_desc);
if (err) if (err)
goto err_pci_disable; return err;
xe_display_probe(xe); xe_display_probe(xe);
...@@ -745,16 +746,11 @@ static int xe_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -745,16 +746,11 @@ static int xe_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
err = xe_device_probe(xe); err = xe_device_probe(xe);
if (err) if (err)
goto err_pci_disable; return err;
xe_pm_init(xe); xe_pm_init(xe);
return 0; return 0;
err_pci_disable:
pci_disable_device(pdev);
return err;
} }
static void xe_pci_shutdown(struct pci_dev *pdev) static void xe_pci_shutdown(struct pci_dev *pdev)
......
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