From 7e15de3a73899903f33975b1ce57cf59c616d1d9 Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Tue, 28 Sep 2010 10:00:47 +0200 Subject: [PATCH] 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 Signed-off-by: Marc Kleine-Budde Acked-by: Wolfgang Grandegger --- drivers/net/can/mcp251x.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/can/mcp251x.c b/drivers/net/can/mcp251x.c index 9b3466aed06d..7e2f951002a5 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) { -- 2.20.1