fix nvram_get checking on non-WGT634U (#4975)
authorFlorian Fainelli <florian@openwrt.org>
Tue, 21 Apr 2009 09:25:51 +0000 (09:25 +0000)
committerFlorian Fainelli <florian@openwrt.org>
Tue, 21 Apr 2009 09:25:51 +0000 (09:25 +0000)
SVN-Revision: 15319

package/switch/src/switch-robo.c

index 46abc94e901f61d926c6c1b8efeab705b3920e59..21343edf0ae6f8bb3530d7cabbb87d121ea12261 100644 (file)
@@ -70,6 +70,7 @@
 
 
 extern char *nvram_get(const char *name);
+#define getvar(str) (nvram_get(str)?:"")
 
 /* Data structure for a Roboswitch device. */
 struct robo_switch {
@@ -275,7 +276,7 @@ static int robo_switch_enable(void)
        }
 
        /* WAN port LED, except for Netgear WGT634U */
-       if (strcmp(nvram_get("nvram_type"), "cfe"))
+       if (strcmp(getvar("nvram_type"), "cfe") != 0)
                robo_write16(ROBO_CTRL_PAGE, 0x16, 0x1F);
 
        return 0;