modules: update swconfig.c to compile on 3.13 (compile-tested)
authorZoltan Herpai <wigyori@uid0.hu>
Tue, 21 Jan 2014 14:24:45 +0000 (14:24 +0000)
committerZoltan Herpai <wigyori@uid0.hu>
Tue, 21 Jan 2014 14:24:45 +0000 (14:24 +0000)
Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>
SVN-Revision: 39359

target/linux/generic/files/drivers/net/phy/swconfig.c

index 03db7a6ffab7eaa4db779980858cc79487533345..c30deb9fd10717d009a5411e114c9a121ea75ff7 100644 (file)
@@ -24,6 +24,7 @@
 #include <linux/skbuff.h>
 #include <linux/switch.h>
 #include <linux/of.h>
+#include <linux/version.h>
 
 #define SWCONFIG_DEVNAME       "switch%d"
 
@@ -1109,6 +1110,8 @@ swconfig_init(void)
        int i, err;
 
        INIT_LIST_HEAD(&swdevs);
+       
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,13,0))
        err = genl_register_family(&switch_fam);
        if (err)
                return err;
@@ -1120,6 +1123,11 @@ swconfig_init(void)
        }
 
        return 0;
+#else
+       err = genl_register_family_with_ops(&switch_fam, swconfig_ops);
+       if (err)
+               goto unregister;
+#endif
 
 unregister:
        genl_unregister_family(&switch_fam);