[PATCH 10/18] serial: sc16is7xx: use HZ_PER_MHZ macro to improve readability

Hugo Villeneuve posted 18 patches 1 year, 12 months ago
There is a newer version of this series
[PATCH 10/18] serial: sc16is7xx: use HZ_PER_MHZ macro to improve readability
Posted by Hugo Villeneuve 1 year, 12 months ago
From: Hugo Villeneuve <hvilleneuve@dimonoff.com>

Improves code readability by making it more obvious that it is a MHz value.

Suggested-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Hugo Villeneuve <hvilleneuve@dimonoff.com>
---
 drivers/tty/serial/sc16is7xx.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/tty/serial/sc16is7xx.c b/drivers/tty/serial/sc16is7xx.c
index 29844e2eefc5..7d5eec2d0e94 100644
--- a/drivers/tty/serial/sc16is7xx.c
+++ b/drivers/tty/serial/sc16is7xx.c
@@ -24,6 +24,7 @@
 #include <linux/tty_flip.h>
 #include <linux/spi/spi.h>
 #include <linux/uaccess.h>
+#include <linux/units.h>
 #include <uapi/linux/sched/types.h>
 
 #define SC16IS7XX_NAME			"sc16is7xx"
@@ -1741,7 +1742,7 @@ static int sc16is7xx_spi_probe(struct spi_device *spi)
 	spi->bits_per_word	= 8;
 	/* only supports mode 0 on SC16IS762 */
 	spi->mode		= spi->mode ? : SPI_MODE_0;
-	spi->max_speed_hz	= spi->max_speed_hz ? : 15000000;
+	spi->max_speed_hz	= spi->max_speed_hz ? : 15 * HZ_PER_MHZ;
 	ret = spi_setup(spi);
 	if (ret)
 		return ret;
-- 
2.39.2
Re: [PATCH 10/18] serial: sc16is7xx: use HZ_PER_MHZ macro to improve readability
Posted by Andy Shevchenko 1 year, 12 months ago
On Tue, Dec 19, 2023 at 12:18:54PM -0500, Hugo Villeneuve wrote:
> From: Hugo Villeneuve <hvilleneuve@dimonoff.com>
> 
> Improves code readability by making it more obvious that it is a MHz value.

Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>

-- 
With Best Regards,
Andy Shevchenko