Skip to content

Commit

Permalink
can: c_can: Avoid led toggling for every packet.
Browse files Browse the repository at this point in the history
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 <tglx@linutronix.de>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
  • Loading branch information
Thomas Gleixner authored and Marc Kleine-Budde committed Apr 1, 2014
1 parent 5a7513a commit b1d8e43
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions drivers/net/can/c_can/c_can.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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;
}

Expand Down

0 comments on commit b1d8e43

Please sign in to comment.