From: Michal Wajdeczko Date: Tue, 26 May 2026 19:54:46 +0000 (+0200) Subject: drm/xe: Use raw device ID to find sub-platform descriptor X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e20b4833f4883f187abd48b0f54dc26f25f2408b;p=thirdparty%2Flinux.git drm/xe: Use raw device ID to find sub-platform descriptor We don't need the partially initialized xe_device pointer to find the sub-platform descriptor, as for the descriptor lookup only the device ID is required and it can be obtained directly from the pci_dev. Signed-off-by: Michal Wajdeczko Reviewed-by: Raag Jadav Link: https://patch.msgid.link/20260526195452.20545-2-michal.wajdeczko@intel.com --- diff --git a/drivers/gpu/drm/xe/xe_pci.c b/drivers/gpu/drm/xe/xe_pci.c index 1243c7d8ed10a..0095a2d7efa49 100644 --- a/drivers/gpu/drm/xe/xe_pci.c +++ b/drivers/gpu/drm/xe/xe_pci.c @@ -575,14 +575,14 @@ static bool id_blocked(u16 device_id) } static const struct xe_subplatform_desc * -find_subplatform(const struct xe_device *xe, const struct xe_device_desc *desc) +find_subplatform(const struct xe_device_desc *desc, u16 devid) { const struct xe_subplatform_desc *sp; const u16 *id; for (sp = desc->subplatforms; sp && sp->subplatform; sp++) for (id = sp->pciidlist; *id; id++) - if (*id == xe->info.devid) + if (*id == devid) return sp; return NULL; @@ -1064,6 +1064,8 @@ static int xe_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) struct xe_device *xe; int err; + subplatform_desc = find_subplatform(desc, pdev->device); + xe_configfs_check_device(pdev); if (desc->require_force_probe && !id_forced(pdev->device)) { @@ -1098,7 +1100,6 @@ static int xe_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) pci_set_drvdata(pdev, &xe->drm); xe_pm_assert_unbounded_bridge(xe); - subplatform_desc = find_subplatform(xe, desc); pci_set_master(pdev);