X-Git-Url: https://git.karo-electronics.de/?p=mv-sheeva.git;a=blobdiff_plain;f=net%2Fbatman-adv%2Fhard-interface.h;fp=drivers%2Fstaging%2Fbatman-adv%2Fhard-interface.h;h=30ec3b8db45983d31e70be621a78fc7c21c133a0;hp=d5508899065b9a8d11b404038d61e37cf1a22540;hb=92d62d098f574ed70b26548e6a2e2f67025864dc;hpb=690c12d2c8ca50e55a3f507059c780ecdb8fd83f diff --git a/drivers/staging/batman-adv/hard-interface.h b/net/batman-adv/hard-interface.h similarity index 85% rename from drivers/staging/batman-adv/hard-interface.h rename to net/batman-adv/hard-interface.h index d5508899065..30ec3b8db45 100644 --- a/drivers/staging/batman-adv/hard-interface.h +++ b/net/batman-adv/hard-interface.h @@ -42,17 +42,12 @@ int batman_skb_recv(struct sk_buff *skb, int hardif_min_mtu(struct net_device *soft_iface); void update_min_mtu(struct net_device *soft_iface); -static inline void hardif_hold(struct batman_if *batman_if) +static inline void hardif_free_ref(struct kref *refcount) { - atomic_inc(&batman_if->refcnt); -} + struct batman_if *batman_if; -static inline void hardif_put(struct batman_if *batman_if) -{ - if (atomic_dec_and_test(&batman_if->refcnt)) { - dev_put(batman_if->net_dev); - kfree(batman_if); - } + batman_if = container_of(refcount, struct batman_if, refcount); + kfree(batman_if); } #endif /* _NET_BATMAN_ADV_HARD_INTERFACE_H_ */