can: move sanity check for bitrate and tq into can_get_bittiming
authorOliver Hartkopp <socketcan@hartkopp.net>
Fri, 28 Feb 2014 15:36:21 +0000 (16:36 +0100)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Fri, 7 Mar 2014 08:18:21 +0000 (09:18 +0100)
commitd5298dffebae76810a6a942bc6467f893bc11eee
tree7f9ccb872c6e0f2415595d8ea602121634f1a1df
parentb30749fdfb9b72f4b1f03673cb5e45b8d4331188
can: move sanity check for bitrate and tq into can_get_bittiming

This patch moves a sanity check in order to have a second user for CAN FD.
Also simplify the return value generation in can_get_bittiming() as only
correct return values of can_[calc|fixup]_bittiming() lead to a return value of
zero.

Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
Acked-by: Stephane Grosjean <s.grosjean@peak-system.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
drivers/net/can/dev.c