forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-02-20 ea08eeccae9297f7aabd2ef7f0c2517ac4549acc
kernel/drivers/net/bonding/bond_debugfs.c
....@@ -45,19 +45,7 @@
4545
4646 return 0;
4747 }
48
-
49
-static int bond_debug_rlb_hash_open(struct inode *inode, struct file *file)
50
-{
51
- return single_open(file, bond_debug_rlb_hash_show, inode->i_private);
52
-}
53
-
54
-static const struct file_operations bond_debug_rlb_hash_fops = {
55
- .owner = THIS_MODULE,
56
- .open = bond_debug_rlb_hash_open,
57
- .read = seq_read,
58
- .llseek = seq_lseek,
59
- .release = single_release,
60
-};
48
+DEFINE_SHOW_ATTRIBUTE(bond_debug_rlb_hash);
6149
6250 void bond_debug_register(struct bonding *bond)
6351 {
....@@ -66,11 +54,6 @@
6654
6755 bond->debug_dir =
6856 debugfs_create_dir(bond->dev->name, bonding_debug_root);
69
-
70
- if (!bond->debug_dir) {
71
- netdev_warn(bond->dev, "failed to register to debugfs\n");
72
- return;
73
- }
7457
7558 debugfs_create_file("rlb_hash_table", 0400, bond->debug_dir,
7659 bond, &bond_debug_rlb_hash_fops);
....@@ -93,7 +76,7 @@
9376
9477 d = debugfs_rename(bonding_debug_root, bond->debug_dir,
9578 bonding_debug_root, bond->dev->name);
96
- if (d) {
79
+ if (!IS_ERR(d)) {
9780 bond->debug_dir = d;
9881 } else {
9982 netdev_warn(bond->dev, "failed to reregister, so just unregister old one\n");