All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hugo Villeneuve <hugo@hugovil.com>
To: gregkh@linuxfoundation.org, jirislaby@kernel.org,
	hvilleneuve@dimonoff.com
Cc: linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org,
	hugo@hugovil.com
Subject: [PATCH 6/7] serial: max310x: add macro for max number of ports
Date: Thu, 30 Nov 2023 14:10:48 -0500	[thread overview]
Message-ID: <20231130191050.3165862-7-hugo@hugovil.com> (raw)
In-Reply-To: <20231130191050.3165862-1-hugo@hugovil.com>

From: Hugo Villeneuve <hvilleneuve@dimonoff.com>

Add macro to hold the maximum number of UART ports per IC/device.

Signed-off-by: Hugo Villeneuve <hvilleneuve@dimonoff.com>
---
 drivers/tty/serial/max310x.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/tty/serial/max310x.c b/drivers/tty/serial/max310x.c
index f3a99daebdaa..58dd5cc62014 100644
--- a/drivers/tty/serial/max310x.c
+++ b/drivers/tty/serial/max310x.c
@@ -30,6 +30,7 @@
 #define MAX310X_MAJOR			204
 #define MAX310X_MINOR			209
 #define MAX310X_UART_NRMAX		16
+#define MAX310X_MAX_PORTS		4 /* Maximum number of UART ports per IC. */
 
 /* MAX310X register definitions */
 #define MAX310X_RHR_REG			(0x00) /* RX FIFO */
@@ -1502,7 +1503,7 @@ static const struct max310x_if_cfg __maybe_unused max310x_spi_if_cfg = {
 static int max310x_spi_probe(struct spi_device *spi)
 {
 	const struct max310x_devtype *devtype;
-	struct regmap *regmaps[4];
+	struct regmap *regmaps[MAX310X_MAX_PORTS];
 	unsigned int i;
 	int ret;
 
@@ -1605,7 +1606,7 @@ static int max310x_i2c_probe(struct i2c_client *client)
 	const struct max310x_devtype *devtype =
 			device_get_match_data(&client->dev);
 	struct i2c_client *port_client;
-	struct regmap *regmaps[4];
+	struct regmap *regmaps[MAX310X_MAX_PORTS];
 	unsigned int i;
 	u8 port_addr;
 
-- 
2.39.2


  parent reply	other threads:[~2023-11-30 19:11 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-30 19:10 [PATCH 0/7] serial: sc16is7xx and max310x: regmap fixes and improvements Hugo Villeneuve
2023-11-30 19:10 ` [PATCH 1/7] serial: sc16is7xx: fix snprintf format specifier in sc16is7xx_regmap_name() Hugo Villeneuve
2023-12-06  6:29   ` kernel test robot
2023-12-07 17:52     ` Hugo Villeneuve
2023-12-07 18:24       ` Andy Shevchenko
2023-12-07 19:02         ` Hugo Villeneuve
2023-12-12 20:03         ` Hugo Villeneuve
2023-12-13 14:43           ` Andy Shevchenko
2023-12-07 19:45       ` David Laight
2023-12-07  1:44   ` Greg KH
2023-12-07 16:02     ` Hugo Villeneuve
2023-12-07  1:45   ` Greg KH
2023-12-07 16:05     ` Hugo Villeneuve
2023-11-30 19:10 ` [PATCH 2/7] serial: sc16is7xx: remove global regmap from struct sc16is7xx_port Hugo Villeneuve
2023-11-30 19:10 ` [PATCH 3/7] serial: sc16is7xx: remove unused line structure member Hugo Villeneuve
2023-11-30 19:10 ` [PATCH 4/7] serial: sc16is7xx: add macro for max number of UART ports Hugo Villeneuve
2023-11-30 19:10 ` [PATCH 5/7] serial: sc16is7xx: improve sc16is7xx_regmap_name() buffer size computation Hugo Villeneuve
2023-11-30 19:10 ` Hugo Villeneuve [this message]
2023-12-01 15:59   ` [PATCH 6/7] serial: max310x: add macro for max number of ports Jan Kundrát
2023-11-30 19:10 ` [PATCH 7/7] serial: max310x: use separate regmap name for each port Hugo Villeneuve
2023-12-01 16:00   ` Jan Kundrát
2023-12-06 14:22   ` kernel test robot

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=20231130191050.3165862-7-hugo@hugovil.com \
    --to=hugo@hugovil.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hvilleneuve@dimonoff.com \
    --cc=jirislaby@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@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.