Skip to content

Commit 3271273

Browse files
Murali Karicheridavem330
authored andcommitted
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 <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 9c5f8a1 commit 3271273

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

net/hsr/hsr_debugfs.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/*
22
* hsr_debugfs code
3-
* Copyright (C) 2017 Texas Instruments Incorporated
3+
* Copyright (C) 2019 Texas Instruments Incorporated
44
*
55
* Author(s):
6-
* Murali Karicheri <[email protected]?
6+
* Murali Karicheri <[email protected]>
77
*
88
* This program is free software; you can redistribute it and/or
99
* modify it under the terms of the GNU General Public License as
@@ -78,12 +78,12 @@ static const struct file_operations hsr_fops = {
7878
* When debugfs is configured this routine sets up the node_table file per
7979
* hsr device for dumping the node_table entries
8080
*/
81-
int hsr_debugfs_init(struct hsr_priv *priv)
81+
int hsr_debugfs_init(struct hsr_priv *priv, struct net_device *hsr_dev)
8282
{
8383
int rc = -1;
8484
struct dentry *de = NULL;
8585

86-
de = debugfs_create_dir("hsr", NULL);
86+
de = debugfs_create_dir(hsr_dev->name, NULL);
8787
if (!de) {
8888
pr_err("Cannot create hsr debugfs root\n");
8989
return rc;
@@ -99,9 +99,8 @@ int hsr_debugfs_init(struct hsr_priv *priv)
9999
return rc;
100100
}
101101
priv->node_tbl_file = de;
102-
rc = 0;
103102

104-
return rc;
103+
return 0;
105104
}
106105

107106
/* hsr_debugfs_term - Tear down debugfs intrastructure

net/hsr/hsr_device.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,7 @@ int hsr_dev_finalize(struct net_device *hsr_dev, struct net_device *slave[2],
485485
goto fail;
486486

487487
mod_timer(&hsr->prune_timer, jiffies + msecs_to_jiffies(PRUNE_PERIOD));
488-
res = hsr_debugfs_init(hsr);
488+
res = hsr_debugfs_init(hsr, hsr_dev);
489489
if (res)
490490
goto fail;
491491

net/hsr/hsr_main.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,10 +184,11 @@ static inline u16 hsr_get_skb_sequence_nr(struct sk_buff *skb)
184184
}
185185

186186
#if IS_ENABLED(CONFIG_DEBUG_FS)
187-
int hsr_debugfs_init(struct hsr_priv *priv);
187+
int hsr_debugfs_init(struct hsr_priv *priv, struct net_device *hsr_dev);
188188
void hsr_debugfs_term(struct hsr_priv *priv);
189189
#else
190-
static inline int hsr_debugfs_init(struct hsr_priv *priv)
190+
static inline int hsr_debugfs_init(struct hsr_priv *priv,
191+
struct net_device *hsr_dev)
191192
{
192193
return 0;
193194
}

0 commit comments

Comments
 (0)