summaryrefslogtreecommitdiffstats
path: root/drivers/net/can/mcp251x.c
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2010-09-28 10:00:47 +0200
committerMarc Kleine-Budde <mkl@pengutronix.de>2010-10-18 11:19:42 +0200
commit7e15de3a73899903f33975b1ce57cf59c616d1d9 (patch)
tree3a6d88c72a3b5225c16d233797cce8ae2fd44c86 /drivers/net/can/mcp251x.c
parentf3a3ed3115d39463dc6672454bfbeaff46811a37 (diff)
can: mcp251x: read-modify-write eflag only when needed
Use read-modify-write instead of a simple write to change the register contents, to close existing the race window between the original manual read and write. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Acked-by: Wolfgang Grandegger <wg@grandegger.com>
Diffstat (limited to 'drivers/net/can/mcp251x.c')
-rw-r--r--drivers/net/can/mcp251x.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/can/mcp251x.c b/drivers/net/can/mcp251x.c
index 9b3466aed06..7e2f951002a 100644
--- a/drivers/net/can/mcp251x.c
+++ b/drivers/net/can/mcp251x.c
@@ -785,7 +785,8 @@ static irqreturn_t mcp251x_can_ist(int irq, void *dev_id)
mcp251x_write_bits(spi, CANINTF, intf, 0x00);
- mcp251x_write_reg(spi, EFLG, 0x00);
+ if (eflag)
+ mcp251x_write_bits(spi, EFLG, eflag, 0x00);
/* Update can state */
if (eflag & EFLG_TXBO) {