swconfig: simplify init code
authorJonas Gorski <jogo@openwrt.org>
Sun, 24 Jan 2016 12:36:06 +0000 (12:36 +0000)
committerJonas Gorski <jogo@openwrt.org>
Sun, 24 Jan 2016 12:36:06 +0000 (12:36 +0000)
Directly return the return value of genl_register_family_with_ops()
instead of storing it in a temporary variable, then returning it.

Signed-off-by: Jonas Gorski <jogo@openwrt.org>
SVN-Revision: 48472

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

index a47af3c0c640c8fbd4139387b21bb78735c3d773..4bfe64fbd0dc62a3007802eaeb1b4fef8e6cc956 100644 (file)
@@ -1172,14 +1172,9 @@ EXPORT_SYMBOL_GPL(unregister_switch);
 static int __init
 swconfig_init(void)
 {
-       int err;
-
        INIT_LIST_HEAD(&swdevs);
        
-       err = genl_register_family_with_ops(&switch_fam, swconfig_ops);
-       if (err)
-               return err;
-       return 0;
+       return genl_register_family_with_ops(&switch_fam, swconfig_ops);
 }
 
 static void __exit