can: only send bitrate data via netlink when available
authorOliver Hartkopp <socketcan@hartkopp.net>
Fri, 28 Feb 2014 15:36:20 +0000 (16:36 +0100)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Fri, 7 Mar 2014 08:18:21 +0000 (09:18 +0100)
commitb30749fdfb9b72f4b1f03673cb5e45b8d4331188
treebe63b059e8044248ae877243c3b8a2faf02d250a
parenta94bc9c46e8e3e1bb5f707e81fd8c60fd93266e6
can: only send bitrate data via netlink when available

When setting the bitrate both can_calc_bittiming() and can_fixup_bittiming()
lead to the bitrate variable to be set, when a proper bit timing is available.
Only then the bitrate configuration is stored for the device, so checking for
priv->bittiming.bitrate is always sufficient.

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