From: Florian Fainelli Date: Fri, 19 Jun 2009 13:12:00 +0000 (+0000) Subject: ensure ledtrig-netdev will compile even if CONFIG_COMPAT_NET_DEV_OPS is unset X-Git-Tag: reboot~23160 X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=d41b9133c78ef5aa9b172fad8c7c5529017f7bd8;p=openwrt%2Fstaging%2Fblogic.git ensure ledtrig-netdev will compile even if CONFIG_COMPAT_NET_DEV_OPS is unset SVN-Revision: 16516 --- diff --git a/target/linux/generic-2.6/files-2.6.30/drivers/leds/ledtrig-netdev.c b/target/linux/generic-2.6/files-2.6.30/drivers/leds/ledtrig-netdev.c index fac3571bdd84..4193e4eda369 100644 --- a/target/linux/generic-2.6/files-2.6.30/drivers/leds/ledtrig-netdev.c +++ b/target/linux/generic-2.6/files-2.6.30/drivers/leds/ledtrig-netdev.c @@ -317,8 +317,11 @@ static void netdev_trig_timer(unsigned long arg) led_set_brightness(trigger_data->led_cdev, ((trigger_data->mode & MODE_LINK) != 0 && trigger_data->link_up) ? LED_FULL : LED_OFF); goto no_restart; } - +#ifdef CONFIG_COMPAT_NET_DEV_OPS dev_stats = trigger_data->net_dev->get_stats(trigger_data->net_dev); +#else + dev_stats = trigger_data->net_dev->netdev_ops->ndo_get_stats(trigger_data->net_dev); +#endif new_activity = ((trigger_data->mode & MODE_TX) ? dev_stats->tx_packets : 0) + ((trigger_data->mode & MODE_RX) ? dev_stats->rx_packets : 0);