diff --git a/econet/econet.c b/econet/econet.c index 94a79584aeb46b74c080d03947fc3acbd8922236..72c4f361513d9f99f77df415cc42206ea6c31e03 100644 --- a/econet/econet.c +++ b/econet/econet.c @@ -67,15 +67,11 @@ int econet_eth_get_stats(const char *ifname, struct eth_stats *stats) /* Check and fetch stats if the Interface belongs to hsgmii_lan driver */ if (!hsgmii_lan_prvt_get_port_statistics(ifname, stats, NULL)) { return 0; - } - libethernet_err("invalid port name: %s\n", ifname); - return -1; - } - - if (!strcmp(ifname, "ae_wan")) { - /* Check and fetch rstats if the Interface belongs to ae_wan driver */ - if (!ae_wan_prvt_get_port_statistics(stats, NULL)) { - return 0; + } else if (!strcmp(ifname, "ae_wan")) { + /* Check and fetch rstats if the Interface belongs to ae_wan driver */ + if (!ae_wan_prvt_get_port_statistics(stats, NULL)) { + return 0; + } } libethernet_err("error reading stats for interface %s\n", ifname); @@ -100,16 +96,11 @@ int econet_eth_get_rmon_stats(const char *ifname, struct eth_rmon_stats *rstats) /* Check and fetch rstats if the Interface belongs to hsgmii_lan driver */ if (!hsgmii_lan_prvt_get_port_statistics(ifname, NULL, rstats)) { return 0; - } - - libethernet_err("invalid port name: %s\n", ifname); - return -1; - } - - if (!strcmp(ifname, "ae_wan")) { - /* Check and fetch rstats if the Interface belongs to ae_wan driver */ - if (!ae_wan_prvt_get_port_statistics(NULL, rstats)) { - return 0; + } else if (!strcmp(ifname, "ae_wan")) { + /* Check and fetch rstats if the Interface belongs to ae_wan driver */ + if (!ae_wan_prvt_get_port_statistics(NULL, rstats)) { + return 0; + } } libethernet_err("error reading rmon stats for interface %s\n", ifname);