serial: 8250_bcm7271: Replace custom unit definitions
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Thu, 15 Feb 2024 16:02:34 +0000 (18:02 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 18 Feb 2024 17:59:58 +0000 (18:59 +0100)
Replace custom unit definitions that are available via units.h.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
Link: https://lore.kernel.org/r/20240215160234.653305-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/8250/8250_bcm7271.c

index 504c4c02085776c610e8a6d9010f6982046c674a..1532fa2e8ec4fae9bdf3468dabd6ef2c565571eb 100644 (file)
@@ -22,6 +22,7 @@
 #include <linux/delay.h>
 #include <linux/clk.h>
 #include <linux/debugfs.h>
+#include <linux/units.h>
 
 #include "8250.h"
 
 #define TX_BUF_SIZE 4096
 #define RX_BUF_SIZE 4096
 #define RX_BUFS_COUNT 2
-#define KHZ    1000
-#define MHZ(x) ((x) * KHZ * KHZ)
 
 static const u32 brcmstb_rate_table[] = {
-       MHZ(81),
-       MHZ(108),
-       MHZ(64),                /* Actually 64285715 for some chips */
-       MHZ(48),
+       81 * HZ_PER_MHZ,
+       108 * HZ_PER_MHZ,
+       64 * HZ_PER_MHZ,                /* Actually 64285715 for some chips */
+       48 * HZ_PER_MHZ,
 };
 
 static const u32 brcmstb_rate_table_7278[] = {
-       MHZ(81),
-       MHZ(108),
+       81 * HZ_PER_MHZ,
+       108 * HZ_PER_MHZ,
        0,
-       MHZ(48),
+       48 * HZ_PER_MHZ,
 };
 
 struct brcmuart_priv {