From: Sascha Hauer Date: Tue, 28 Sep 2010 08:00:47 +0000 (+0200) Subject: can: mcp251x: read-modify-write eflag only when needed X-Git-Tag: MMI-PSA29.97-13-9~21994^2~100^2~4 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=7e15de3a73899903f33975b1ce57cf59c616d1d9;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git 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 --- 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) {