]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - net/phonet/af_phonet.c
phonet: fix compilation with gcc-3.4
[linux-2.6-omap-h63xx.git] / net / phonet / af_phonet.c
index 7ab30f668b5a8226a6342118c96322e33f04a0c4..9d211f12582ba90882ae9f272a6896b716d83af4 100644 (file)
 #include <net/phonet/phonet.h>
 #include <net/phonet/pn_dev.h>
 
-static struct net_proto_family phonet_proto_family;
-static struct phonet_protocol *phonet_proto_get(int protocol);
-static inline void phonet_proto_put(struct phonet_protocol *pp);
+/* Transport protocol registration */
+static struct phonet_protocol *proto_tab[PHONET_NPROTO] __read_mostly;
+static DEFINE_SPINLOCK(proto_tab_lock);
+
+static struct phonet_protocol *phonet_proto_get(int protocol)
+{
+       struct phonet_protocol *pp;
+
+       if (protocol >= PHONET_NPROTO)
+               return NULL;
+
+       spin_lock(&proto_tab_lock);
+       pp = proto_tab[protocol];
+       if (pp && !try_module_get(pp->prot->owner))
+               pp = NULL;
+       spin_unlock(&proto_tab_lock);
+
+       return pp;
+}
+
+static inline void phonet_proto_put(struct phonet_protocol *pp)
+{
+       module_put(pp->prot->owner);
+}
 
 /* protocol family functions */
 
@@ -375,10 +396,6 @@ static struct packet_type phonet_packet_type = {
        .func = phonet_rcv,
 };
 
-/* Transport protocol registration */
-static struct phonet_protocol *proto_tab[PHONET_NPROTO] __read_mostly;
-static DEFINE_SPINLOCK(proto_tab_lock);
-
 int __init_or_module phonet_proto_register(int protocol,
                                                struct phonet_protocol *pp)
 {
@@ -412,27 +429,6 @@ void phonet_proto_unregister(int protocol, struct phonet_protocol *pp)
 }
 EXPORT_SYMBOL(phonet_proto_unregister);
 
-static struct phonet_protocol *phonet_proto_get(int protocol)
-{
-       struct phonet_protocol *pp;
-
-       if (protocol >= PHONET_NPROTO)
-               return NULL;
-
-       spin_lock(&proto_tab_lock);
-       pp = proto_tab[protocol];
-       if (pp && !try_module_get(pp->prot->owner))
-               pp = NULL;
-       spin_unlock(&proto_tab_lock);
-
-       return pp;
-}
-
-static inline void phonet_proto_put(struct phonet_protocol *pp)
-{
-       module_put(pp->prot->owner);
-}
-
 /* Module registration */
 static int __init phonet_init(void)
 {