can: c_can: Fix berr reporting
authorThomas Gleixner <[email protected]>
Fri, 11 Apr 2014 08:13:13 +0000 (08:13 +0000)
committerMarc Kleine-Budde <[email protected]>
Thu, 24 Apr 2014 20:08:56 +0000 (22:08 +0200)
commit097aec19689d8f2f76fd0c1becacf32801ae94c7
tree3d42c12965531640ec9d2a6e70e17a10d5a583dc
parentf058d548e8071a1d148d6ebd94888d011c3ca71e
can: c_can: Fix berr reporting

Reading the LEC type with

  return (mode & ENABLED) && (status & LEC_MASK);

is not guaranteed to return (status & LEC_MASK) if the enabled bit in
mode is set. It's guaranteed to return 0 or !=0.

Remove the inline function and call unconditionally into the
berr_handling code and return early when the reporting is disabled.

Signed-off-by: Thomas Gleixner <[email protected]>
Tested-by: Alexander Stein <[email protected]>
Signed-off-by: Marc Kleine-Budde <[email protected]>
drivers/net/can/c_can/c_can.c