Fedora kernel-2.6.17-1.2142_FC4 patched with stable patch-2.6.17.4-vs2.0.2-rc26.diff
[linux-2.6.git] / drivers / infiniband / ulp / ipoib / ipoib_vlan.c
index 94b8ea8..f887780 100644 (file)
@@ -32,7 +32,6 @@
  * $Id: ipoib_vlan.c 1349 2004-12-16 21:09:43Z roland $
  */
 
-#include <linux/version.h>
 #include <linux/module.h>
 
 #include <linux/init.h>
@@ -64,7 +63,7 @@ int ipoib_vlan_add(struct net_device *pdev, unsigned short pkey)
 
        ppriv = netdev_priv(pdev);
 
-       down(&ppriv->vlan_mutex);
+       mutex_lock(&ppriv->vlan_mutex);
 
        /*
         * First ensure this isn't a duplicate. We check the parent device and
@@ -114,8 +113,7 @@ int ipoib_vlan_add(struct net_device *pdev, unsigned short pkey)
 
        priv->parent = ppriv->dev;
 
-       if (ipoib_create_debug_file(priv->dev))
-               goto debug_failed;
+       ipoib_create_debug_files(priv->dev);
 
        if (ipoib_add_pkey_attr(priv->dev))
                goto sysfs_failed;
@@ -126,14 +124,12 @@ int ipoib_vlan_add(struct net_device *pdev, unsigned short pkey)
 
        list_add_tail(&priv->list, &ppriv->child_intfs);
 
-       up(&ppriv->vlan_mutex);
+       mutex_unlock(&ppriv->vlan_mutex);
 
        return 0;
 
 sysfs_failed:
-       ipoib_delete_debug_file(priv->dev);
-
-debug_failed:
+       ipoib_delete_debug_files(priv->dev);
        unregister_netdev(priv->dev);
 
 register_failed:
@@ -143,7 +139,7 @@ device_init_failed:
        free_netdev(priv->dev);
 
 err:
-       up(&ppriv->vlan_mutex);
+       mutex_unlock(&ppriv->vlan_mutex);
        return result;
 }
 
@@ -157,21 +153,19 @@ int ipoib_vlan_delete(struct net_device *pdev, unsigned short pkey)
 
        ppriv = netdev_priv(pdev);
 
-       down(&ppriv->vlan_mutex);
+       mutex_lock(&ppriv->vlan_mutex);
        list_for_each_entry_safe(priv, tpriv, &ppriv->child_intfs, list) {
                if (priv->pkey == pkey) {
                        unregister_netdev(priv->dev);
                        ipoib_dev_cleanup(priv->dev);
-
                        list_del(&priv->list);
-
-                       kfree(priv);
+                       free_netdev(priv->dev);
 
                        ret = 0;
                        break;
                }
        }
-       up(&ppriv->vlan_mutex);
+       mutex_unlock(&ppriv->vlan_mutex);
 
        return ret;
 }