From: Thomas Gleixner Date: Tue, 18 Mar 2014 17:19:15 +0000 (+0000) Subject: can: c_can: Avoid led toggling for every packet. X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=b1d8e431bd5639c03ff99d08fd2d5d621969bdc5;p=openwrt%2Fstaging%2Fblogic.git can: c_can: Avoid led toggling for every packet. There is no point to toggle the RX led for every packet. Especially if we have a full FIFO we want to avoid everything we can. Signed-off-by: Thomas Gleixner Signed-off-by: Marc Kleine-Budde --- diff --git a/drivers/net/can/c_can/c_can.c b/drivers/net/can/c_can/c_can.c index 42c038d523c9..01dc4941e3d0 100644 --- a/drivers/net/can/c_can/c_can.c +++ b/drivers/net/can/c_can/c_can.c @@ -433,9 +433,6 @@ static int c_can_read_msg_object(struct net_device *dev, int iface, int ctrl) stats->rx_packets++; stats->rx_bytes += frame->can_dlc; - - can_led_event(dev, CAN_LED_EVENT_RX); - return 0; } @@ -901,6 +898,10 @@ static int c_can_do_rx_poll(struct net_device *dev, int quota) pkts += n; quota -= n; } + + if (pkts) + can_led_event(dev, CAN_LED_EVENT_RX); + return pkts; }