Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 351691
b: refs/heads/master
c: a04282f
h: refs/heads/master
i:
  351689: f8963c0
  351687: dc85079
v: v3
  • Loading branch information
Fabio Baltieri authored and Marc Kleine-Budde committed Jan 26, 2013
1 parent f7a5127 commit f90b098
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: eb072a9baebefeef33ece48c0a6fc2f8200e5ed2
refs/heads/master: a04282f54b52cf5a629a98f09712da1e630a1060
17 changes: 16 additions & 1 deletion trunk/drivers/net/can/sja1000/sja1000.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@

#include <linux/can/dev.h>
#include <linux/can/error.h>
#include <linux/can/led.h>

#include "sja1000.h"

Expand Down Expand Up @@ -368,6 +369,8 @@ static void sja1000_rx(struct net_device *dev)

stats->rx_packets++;
stats->rx_bytes += cf->can_dlc;

can_led_event(dev, CAN_LED_EVENT_RX);
}

static int sja1000_err(struct net_device *dev, uint8_t isrc, uint8_t status)
Expand Down Expand Up @@ -521,6 +524,7 @@ irqreturn_t sja1000_interrupt(int irq, void *dev_id)
can_get_echo_skb(dev, 0);
}
netif_wake_queue(dev);
can_led_event(dev, CAN_LED_EVENT_TX);
}
if (isrc & IRQ_RI) {
/* receive interrupt */
Expand Down Expand Up @@ -575,6 +579,8 @@ static int sja1000_open(struct net_device *dev)
/* init and start chi */
sja1000_start(dev);

can_led_event(dev, CAN_LED_EVENT_OPEN);

netif_start_queue(dev);

return 0;
Expand All @@ -592,6 +598,8 @@ static int sja1000_close(struct net_device *dev)

close_candev(dev);

can_led_event(dev, CAN_LED_EVENT_STOP);

return 0;
}

Expand Down Expand Up @@ -639,6 +647,8 @@ static const struct net_device_ops sja1000_netdev_ops = {

int register_sja1000dev(struct net_device *dev)
{
int ret;

if (!sja1000_probe_chip(dev))
return -ENODEV;

Expand All @@ -648,7 +658,12 @@ int register_sja1000dev(struct net_device *dev)
set_reset_mode(dev);
chipset_init(dev);

return register_candev(dev);
ret = register_candev(dev);

if (!ret)
devm_can_led_init(dev);

return ret;
}
EXPORT_SYMBOL_GPL(register_sja1000dev);

Expand Down

0 comments on commit f90b098

Please sign in to comment.