Use the CAN_MHZ define when assigning frequencies. Signed-off-by: Jimmy Assarsson <extja@xxxxxxxxxx> --- drivers/net/can/usb/kvaser_usb/kvaser_usb_hydra.c | 7 ++++--- drivers/net/can/usb/kvaser_usb/kvaser_usb_leaf.c | 3 ++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/net/can/usb/kvaser_usb/kvaser_usb_hydra.c b/drivers/net/can/usb/kvaser_usb/kvaser_usb_hydra.c index aa81b92237ca..221339338414 100644 --- a/drivers/net/can/usb/kvaser_usb/kvaser_usb_hydra.c +++ b/drivers/net/can/usb/kvaser_usb/kvaser_usb_hydra.c @@ -25,6 +25,7 @@ #include <linux/usb.h> #include <linux/can.h> +#include <linux/can/bittiming.h> #include <linux/can/dev.h> #include <linux/can/error.h> #include <linux/can/netlink.h> @@ -2034,7 +2035,7 @@ const struct kvaser_usb_dev_ops kvaser_usb_hydra_dev_ops = { static const struct kvaser_usb_dev_cfg kvaser_usb_hydra_dev_cfg_kcan = { .clock = { - .freq = 80000000, + .freq = 80 * CAN_MHZ, }, .timestamp_freq = 80, .bittiming_const = &kvaser_usb_hydra_kcan_bittiming_c, @@ -2043,7 +2044,7 @@ static const struct kvaser_usb_dev_cfg kvaser_usb_hydra_dev_cfg_kcan = { static const struct kvaser_usb_dev_cfg kvaser_usb_hydra_dev_cfg_flexc = { .clock = { - .freq = 24000000, + .freq = 24 * CAN_MHZ, }, .timestamp_freq = 1, .bittiming_const = &kvaser_usb_hydra_flexc_bittiming_c, @@ -2051,7 +2052,7 @@ static const struct kvaser_usb_dev_cfg kvaser_usb_hydra_dev_cfg_flexc = { static const struct kvaser_usb_dev_cfg kvaser_usb_hydra_dev_cfg_rt = { .clock = { - .freq = 80000000, + .freq = 80 * CAN_MHZ, }, .timestamp_freq = 24, .bittiming_const = &kvaser_usb_hydra_rt_bittiming_c, diff --git a/drivers/net/can/usb/kvaser_usb/kvaser_usb_leaf.c b/drivers/net/can/usb/kvaser_usb/kvaser_usb_leaf.c index 59ba7c7beec0..506e4b76d119 100644 --- a/drivers/net/can/usb/kvaser_usb/kvaser_usb_leaf.c +++ b/drivers/net/can/usb/kvaser_usb/kvaser_usb_leaf.c @@ -22,6 +22,7 @@ #include <linux/usb.h> #include <linux/can.h> +#include <linux/can/bittiming.h> #include <linux/can/dev.h> #include <linux/can/error.h> #include <linux/can/netlink.h> @@ -31,7 +32,7 @@ /* Forward declaration */ static const struct kvaser_usb_dev_cfg kvaser_usb_leaf_dev_cfg; -#define CAN_USB_CLOCK 8000000 +#define CAN_USB_CLOCK (8 * CAN_MHZ) #define MAX_USBCAN_NET_DEVICES 2 /* Command header size */ -- 2.31.1