mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2025-01-19 20:34:20 +08:00
net: hsr: fix debugfs path to support multiple interfaces
Fix the path of hsr debugfs root directory to use the net device name so that it can work with multiple interfaces. While at it, also fix some typos. Signed-off-by: Murali Karicheri <m-karicheri2@ti.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
9c5f8a19b2
commit
3271273388
@ -1,9 +1,9 @@
|
|||||||
/*
|
/*
|
||||||
* hsr_debugfs code
|
* hsr_debugfs code
|
||||||
* Copyright (C) 2017 Texas Instruments Incorporated
|
* Copyright (C) 2019 Texas Instruments Incorporated
|
||||||
*
|
*
|
||||||
* Author(s):
|
* Author(s):
|
||||||
* Murali Karicheri <m-karicheri2@ti.com?
|
* Murali Karicheri <m-karicheri2@ti.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License as
|
* modify it under the terms of the GNU General Public License as
|
||||||
@ -78,12 +78,12 @@ static const struct file_operations hsr_fops = {
|
|||||||
* When debugfs is configured this routine sets up the node_table file per
|
* When debugfs is configured this routine sets up the node_table file per
|
||||||
* hsr device for dumping the node_table entries
|
* hsr device for dumping the node_table entries
|
||||||
*/
|
*/
|
||||||
int hsr_debugfs_init(struct hsr_priv *priv)
|
int hsr_debugfs_init(struct hsr_priv *priv, struct net_device *hsr_dev)
|
||||||
{
|
{
|
||||||
int rc = -1;
|
int rc = -1;
|
||||||
struct dentry *de = NULL;
|
struct dentry *de = NULL;
|
||||||
|
|
||||||
de = debugfs_create_dir("hsr", NULL);
|
de = debugfs_create_dir(hsr_dev->name, NULL);
|
||||||
if (!de) {
|
if (!de) {
|
||||||
pr_err("Cannot create hsr debugfs root\n");
|
pr_err("Cannot create hsr debugfs root\n");
|
||||||
return rc;
|
return rc;
|
||||||
@ -99,9 +99,8 @@ int hsr_debugfs_init(struct hsr_priv *priv)
|
|||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
priv->node_tbl_file = de;
|
priv->node_tbl_file = de;
|
||||||
rc = 0;
|
|
||||||
|
|
||||||
return rc;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* hsr_debugfs_term - Tear down debugfs intrastructure
|
/* hsr_debugfs_term - Tear down debugfs intrastructure
|
||||||
|
@ -485,7 +485,7 @@ int hsr_dev_finalize(struct net_device *hsr_dev, struct net_device *slave[2],
|
|||||||
goto fail;
|
goto fail;
|
||||||
|
|
||||||
mod_timer(&hsr->prune_timer, jiffies + msecs_to_jiffies(PRUNE_PERIOD));
|
mod_timer(&hsr->prune_timer, jiffies + msecs_to_jiffies(PRUNE_PERIOD));
|
||||||
res = hsr_debugfs_init(hsr);
|
res = hsr_debugfs_init(hsr, hsr_dev);
|
||||||
if (res)
|
if (res)
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
||||||
|
@ -184,10 +184,11 @@ static inline u16 hsr_get_skb_sequence_nr(struct sk_buff *skb)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if IS_ENABLED(CONFIG_DEBUG_FS)
|
#if IS_ENABLED(CONFIG_DEBUG_FS)
|
||||||
int hsr_debugfs_init(struct hsr_priv *priv);
|
int hsr_debugfs_init(struct hsr_priv *priv, struct net_device *hsr_dev);
|
||||||
void hsr_debugfs_term(struct hsr_priv *priv);
|
void hsr_debugfs_term(struct hsr_priv *priv);
|
||||||
#else
|
#else
|
||||||
static inline int hsr_debugfs_init(struct hsr_priv *priv)
|
static inline int hsr_debugfs_init(struct hsr_priv *priv,
|
||||||
|
struct net_device *hsr_dev)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user