net: enetc: use PCI device name for debugfs directory

enetc_create_debugfs() is called right after register_netdev(), at which
point ndev->name still holds the format "eth%d" (e.g., eth0) rather than
the final assigned name (e.g., via udev rules).

Use pci_name() instead of netdev_name() to name the debugfs directory.
The PCI device name is unique, stable, and available from the start,
making it a more reliable identifier for the debugfs entry. Therefore,
the observable debugfs path from something like
/sys/kernel/debug/eth0/mac_filter to a PCI BDF-style path such as
/sys/kernel/debug/0002:00:00.0/mac_filter.

Signed-off-by: Wei Fang <wei.fang@nxp.com>
Reviewed-by: Joe Damato <joe@dama.to>
Link: https://patch.msgid.link/20260720014317.1059359-6-wei.fang@oss.nxp.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
Wei Fang
2026-07-27 16:31:53 -07:00
committed by Jakub Kicinski
parent 6228fc9c2b
commit 9db43e6f35
@@ -81,10 +81,9 @@ DEFINE_SHOW_ATTRIBUTE(enetc_mac_filter);
void enetc_create_debugfs(struct enetc_si *si)
{
struct net_device *ndev = si->ndev;
struct dentry *root;
root = debugfs_create_dir(netdev_name(ndev), NULL);
root = debugfs_create_dir(pci_name(si->pdev), NULL);
if (IS_ERR(root))
return;