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

drm/xe: Skip calling drm_dev_put on probe error

DRM device used by Xe is managed, which means that final ref will be
dropped on driver detach.
Signed-off-by: default avatarMichał Winiarski <michal.winiarski@intel.com>
Reviewed-by: default avatarMatthew Brost <matthew.brost@intel.com>
Link: https://lore.kernel.org/r/20231129214509.1174116-2-michal.winiarski@intel.comSigned-off-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
parent 33acfc71
...@@ -215,11 +215,11 @@ struct xe_device *xe_device_create(struct pci_dev *pdev, ...@@ -215,11 +215,11 @@ struct xe_device *xe_device_create(struct pci_dev *pdev,
xe->drm.anon_inode->i_mapping, xe->drm.anon_inode->i_mapping,
xe->drm.vma_offset_manager, false, false); xe->drm.vma_offset_manager, false, false);
if (WARN_ON(err)) if (WARN_ON(err))
goto err_put; goto err;
err = drmm_add_action_or_reset(&xe->drm, xe_device_destroy, NULL); err = drmm_add_action_or_reset(&xe->drm, xe_device_destroy, NULL);
if (err) if (err)
goto err_put; goto err;
xe->info.devid = pdev->device; xe->info.devid = pdev->device;
xe->info.revid = pdev->revision; xe->info.revid = pdev->revision;
...@@ -258,18 +258,16 @@ struct xe_device *xe_device_create(struct pci_dev *pdev, ...@@ -258,18 +258,16 @@ struct xe_device *xe_device_create(struct pci_dev *pdev,
if (!xe->ordered_wq || !xe->unordered_wq) { if (!xe->ordered_wq || !xe->unordered_wq) {
drm_err(&xe->drm, "Failed to allocate xe workqueues\n"); drm_err(&xe->drm, "Failed to allocate xe workqueues\n");
err = -ENOMEM; err = -ENOMEM;
goto err_put; goto err;
} }
err = xe_display_create(xe); err = xe_display_create(xe);
if (WARN_ON(err)) if (WARN_ON(err))
goto err_put; goto err;
return xe; return xe;
err_put: err:
drm_dev_put(&xe->drm);
return ERR_PTR(err); return ERR_PTR(err);
} }
......
...@@ -706,7 +706,7 @@ static int xe_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -706,7 +706,7 @@ static int xe_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
pci_set_drvdata(pdev, xe); pci_set_drvdata(pdev, xe);
err = pci_enable_device(pdev); err = pci_enable_device(pdev);
if (err) if (err)
goto err_drm_put; return err;
pci_set_master(pdev); pci_set_master(pdev);
...@@ -754,9 +754,6 @@ static int xe_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -754,9 +754,6 @@ static int xe_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
err_pci_disable: err_pci_disable:
pci_disable_device(pdev); pci_disable_device(pdev);
err_drm_put:
drm_dev_put(&xe->drm);
return err; return err;
} }
......
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