All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jimmy Assarsson <extja@kvaser.com>
To: linux-can@vger.kernel.org
Cc: Jimmy Assarsson <jimmyassarsson@gmail.com>,
	Jimmy Assarsson <extja@kvaser.com>
Subject: [PATCH v1 4/5] can: kvaser_usb: Use CAN_MHZ define in assignment of frequency
Date: Fri, 19 Nov 2021 14:19:14 +0100	[thread overview]
Message-ID: <20211119131915.2033234-5-extja@kvaser.com> (raw)
In-Reply-To: <20211119131915.2033234-1-extja@kvaser.com>

Use the CAN_MHZ define when assigning frequencies.

Signed-off-by: Jimmy Assarsson <extja@kvaser.com>
---
 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


  parent reply	other threads:[~2021-11-19 13:20 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-19 13:19 [PATCH v1 0/5] kvaser_{pciefd,usb} fixes Jimmy Assarsson
2021-11-19 13:19 ` [PATCH v1 1/5] can: kvaser_pciefd: Do not increase stats->rx_{packets,bytes} for error frames Jimmy Assarsson
2021-11-20  3:06   ` Vincent Mailhol
2021-11-23  7:44     ` Jimmy Assarsson
2021-11-19 13:19 ` [PATCH v1 2/5] can: kvaser_pciefd: Increase correct stats->{rx,tx}_errors counter Jimmy Assarsson
2021-11-19 13:19 ` [PATCH v1 3/5] can: kvaser_usb: Do not increase stats->rx_{packets,bytes} for error frames Jimmy Assarsson
2021-11-19 13:19 ` Jimmy Assarsson [this message]
2021-11-19 13:30   ` [PATCH v1 4/5] can: kvaser_usb: Use CAN_MHZ define in assignment of frequency Jimmy Assarsson
2021-11-19 15:42     ` Vincent MAILHOL
2021-11-19 15:48       ` Vincent MAILHOL
2021-11-19 13:19 ` [PATCH v1 5/5] can: kvaser_usb: Get CAN clock frequency from device Jimmy Assarsson
2021-12-08  9:27 ` [PATCH v1 0/5] kvaser_{pciefd,usb} fixes Marc Kleine-Budde
2021-12-08 11:13   ` Jimmy Assarsson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211119131915.2033234-5-extja@kvaser.com \
    --to=extja@kvaser.com \
    --cc=jimmyassarsson@gmail.com \
    --cc=linux-can@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.