From: Michal Wajdeczko Date: Tue, 22 Jul 2025 14:10:56 +0000 (+0200) Subject: drm/xe/configfs: Use pci_name() for lookup X-Git-Tag: v6.18-rc1~134^2~18^2~134 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9b807f0bb0d0f4b029e56dd2daa4a5e6d87fab61;p=thirdparty%2Flinux.git drm/xe/configfs: Use pci_name() for lookup There is no need to manually build PCI device name from BDF data, since it was already prepared and assigned and can be accessed by calling pci_name() function. Signed-off-by: Michal Wajdeczko Cc: Lucas De Marchi Reviewed-by: Lucas De Marchi Reviewed-by: Jonathan Cavitt Link: https://lore.kernel.org/r/20250722141059.30707-4-michal.wajdeczko@intel.com Signed-off-by: Lucas De Marchi --- diff --git a/drivers/gpu/drm/xe/xe_configfs.c b/drivers/gpu/drm/xe/xe_configfs.c index f5ce48a0adc8b..36e2b45b305f4 100644 --- a/drivers/gpu/drm/xe/xe_configfs.c +++ b/drivers/gpu/drm/xe/xe_configfs.c @@ -312,13 +312,9 @@ static struct configfs_subsystem xe_configfs = { static struct xe_config_device *configfs_find_group(struct pci_dev *pdev) { struct config_item *item; - char name[64]; - - snprintf(name, sizeof(name), "%04x:%02x:%02x.%x", pci_domain_nr(pdev->bus), - pdev->bus->number, PCI_SLOT(pdev->devfn), PCI_FUNC(pdev->devfn)); mutex_lock(&xe_configfs.su_mutex); - item = config_group_find_item(&xe_configfs.su_group, name); + item = config_group_find_item(&xe_configfs.su_group, pci_name(pdev)); mutex_unlock(&xe_configfs.su_mutex); if (!item)