]> git.baikalelectronics.ru Git - kernel.git/commit
can: c_can: Fix berr reporting
authorThomas Gleixner <tglx@linutronix.de>
Fri, 11 Apr 2014 08:13:13 +0000 (08:13 +0000)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Thu, 24 Apr 2014 20:08:56 +0000 (22:08 +0200)
commit6b7ba18185b12eb7ccc9f27f80e4f2e6f48da006
tree3d42c12965531640ec9d2a6e70e17a10d5a583dc
parent5b2806d0364fc75098a3354b84426e0f5df8bf51
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 <tglx@linutronix.de>
Tested-by: Alexander Stein <alexander.stein@systec-electronic.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
drivers/net/can/c_can/c_can.c