Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=5b296bc9e1e5570ce60262e62af066f70180cb99
Commit:     5b296bc9e1e5570ce60262e62af066f70180cb99
Parent:     3f61e4278c8489c1d026a45b0903cd4230d1ec07
Author:     Stephen Hemminger <[EMAIL PROTECTED]>
AuthorDate: Wed Aug 29 12:58:11 2007 -0700
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Wed Oct 10 16:50:51 2007 -0700

    sky2: use debugfs rename
    
    Use debugfs rename to handle device neame changes.
    
    Signed-off-by: Stephen Hemminger <[EMAIL PROTECTED]>
    Signed-off-by: Jeff Garzik <[EMAIL PROTECTED]>
---
 drivers/net/sky2.c |   56 ++++++++++++++++++++++-----------------------------
 1 files changed, 24 insertions(+), 32 deletions(-)

diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
index a0d75b0..d10af8e 100644
--- a/drivers/net/sky2.c
+++ b/drivers/net/sky2.c
@@ -3841,42 +3841,34 @@ static int sky2_device_event(struct notifier_block 
*unused,
                             unsigned long event, void *ptr)
 {
        struct net_device *dev = ptr;
+       struct sky2_port *sky2 = netdev_priv(dev);
 
-       if (dev->open == sky2_up) {
-               struct sky2_port *sky2 = netdev_priv(dev);
+       if (dev->open != sky2_up || !sky2_debug)
+               return NOTIFY_DONE;
 
-               switch(event) {
-               case NETDEV_CHANGENAME:
-                       if (!netif_running(dev))
-                               break;
-                       /* fallthrough */
-               case NETDEV_DOWN:
-               case NETDEV_GOING_DOWN:
-                       if (sky2->debugfs) {
-                               printk(KERN_DEBUG PFX "%s: remove debugfs\n",
-                                      dev->name);
-                               debugfs_remove(sky2->debugfs);
-                               sky2->debugfs = NULL;
-                       }
+       switch(event) {
+       case NETDEV_CHANGENAME:
+               if (sky2->debugfs) {
+                       sky2->debugfs = debugfs_rename(sky2_debug, 
sky2->debugfs,
+                                                      sky2_debug, dev->name);
+               }
+               break;
 
-                       if (event != NETDEV_CHANGENAME)
-                               break;
-                       /* fallthrough for changename */
-               case NETDEV_UP:
-                       if (sky2_debug) {
-                               struct dentry *d;
-                               d = debugfs_create_file(dev->name, S_IRUGO,
-                                                       sky2_debug, dev,
-                                                       &sky2_debug_fops);
-                               if (d == NULL || IS_ERR(d))
-                                       printk(KERN_INFO PFX
-                                              "%s: debugfs create failed\n",
-                                              dev->name);
-                               else
-                                       sky2->debugfs = d;
-                       }
-                       break;
+       case NETDEV_GOING_DOWN:
+               if (sky2->debugfs) {
+                       printk(KERN_DEBUG PFX "%s: remove debugfs\n",
+                              dev->name);
+                       debugfs_remove(sky2->debugfs);
+                       sky2->debugfs = NULL;
                }
+               break;
+
+       case NETDEV_UP:
+               sky2->debugfs = debugfs_create_file(dev->name, S_IRUGO,
+                                                   sky2_debug, dev,
+                                                   &sky2_debug_fops);
+               if (IS_ERR(sky2->debugfs))
+                       sky2->debugfs = NULL;
        }
 
        return NOTIFY_DONE;
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to