mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2026-09-22 09:34:56 +02:00
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:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user