can: dev: Consolidate and unify state change handling
authorAndri Yngvason <andri.yngvason@marel.com>
Wed, 3 Dec 2014 17:54:13 +0000 (17:54 +0000)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Sun, 7 Dec 2014 20:22:09 +0000 (21:22 +0100)
commitbac78aabcfece0c493b2ad824c68fbdc20448cbc
tree01465ed5ab04a32590aa36b13aef94a2a7bafd25
parent04ee0865d11f3f2a395e004a181ccfd2b258d088
can: dev: Consolidate and unify state change handling

The handling of can error states is different between platforms.
This is an attempt to correct that problem.

I've moved this handling into a generic function for changing the
error state. This ensures that error state changes are handled
the same way everywhere (where this function is used).

This new mechanism also adds reverse state transitioning in error
frames, i.e. the user will be notified through the socket interface
when the state goes down.

Signed-off-by: Andri Yngvason <andri.yngvason@marel.com>
Acked-by: Wolfgang Grandegger <wg@grandegger.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
drivers/net/can/dev.c
include/linux/can/dev.h
include/uapi/linux/can/error.h