batman-adv: Rename batadv_hardif *_free_ref function to *_put
[deliverable/linux.git] / net / batman-adv / sysfs.c
index 964fc5986b2c1eb6521be386264f4702745a87b5..0db7591a000fcbd893f1081b942cfae1f310ee6c 100644 (file)
@@ -25,6 +25,7 @@
 #include <linux/fs.h>
 #include <linux/if.h>
 #include <linux/if_vlan.h>
+#include <linux/kref.h>
 #include <linux/kernel.h>
 #include <linux/netdevice.h>
 #include <linux/printk.h>
@@ -97,7 +98,7 @@ batadv_kobj_to_vlan(struct batadv_priv *bat_priv, struct kobject *obj)
                if (vlan_tmp->kobj != obj)
                        continue;
 
-               if (!atomic_inc_not_zero(&vlan_tmp->refcount))
+               if (!kref_get_unless_zero(&vlan_tmp->refcount))
                        continue;
 
                vlan = vlan_tmp;
@@ -770,7 +771,7 @@ static ssize_t batadv_show_mesh_iface(struct kobject *kobj,
 
        length = sprintf(buff, "%s\n", ifname);
 
-       batadv_hardif_free_ref(hard_iface);
+       batadv_hardif_put(hard_iface);
 
        return length;
 }
@@ -794,7 +795,7 @@ static ssize_t batadv_store_mesh_iface(struct kobject *kobj,
        if (strlen(buff) >= IFNAMSIZ) {
                pr_err("Invalid parameter for 'mesh_iface' setting received: interface name too long '%s'\n",
                       buff);
-               batadv_hardif_free_ref(hard_iface);
+               batadv_hardif_put(hard_iface);
                return -EINVAL;
        }
 
@@ -828,7 +829,7 @@ static ssize_t batadv_store_mesh_iface(struct kobject *kobj,
 unlock:
        rtnl_unlock();
 out:
-       batadv_hardif_free_ref(hard_iface);
+       batadv_hardif_put(hard_iface);
        return ret;
 }
 
@@ -862,7 +863,7 @@ static ssize_t batadv_show_iface_status(struct kobject *kobj,
                break;
        }
 
-       batadv_hardif_free_ref(hard_iface);
+       batadv_hardif_put(hard_iface);
 
        return length;
 }
This page took 0.04433 seconds and 5 git commands to generate.