From: Hugo Villeneuve <hugo@hugovil.com>
To: gregkh@linuxfoundation.org, jirislaby@kernel.org,
cosmin.tanislav@analog.com, andy.shevchenko@gmail.com,
shc_work@mail.ru
Cc: linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org,
hugo@hugovil.com, "Hugo Villeneuve" <hvilleneuve@dimonoff.com>,
"Jan Kundrát" <jan.kundrat@cesnet.cz>
Subject: [PATCH 07/18] serial: max310x: add macro for max number of ports
Date: Wed, 17 Jan 2024 17:38:45 -0500 [thread overview]
Message-ID: <20240117223856.2303475-8-hugo@hugovil.com> (raw)
In-Reply-To: <20240117223856.2303475-1-hugo@hugovil.com>
From: Hugo Villeneuve <hvilleneuve@dimonoff.com>
Add macro to hold the maximum number of UART ports per IC/device.
Reviewed-by: Jan Kundrát <jan.kundrat@cesnet.cz>
Tested-by: Jan Kundrát <jan.kundrat@cesnet.cz>
Link: https://lore.kernel.org/all/ddbc67dd-f8a3-4a6a-954a-bee49260ecab@cesnet.cz/
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 21f2fa3a91e5..6549eee4f6a6 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;
@@ -1604,7 +1605,7 @@ static int max310x_i2c_probe(struct i2c_client *client)
{
const struct max310x_devtype *devtype;
struct i2c_client *port_client;
- struct regmap *regmaps[4];
+ struct regmap *regmaps[MAX310X_MAX_PORTS];
unsigned int i;
u8 port_addr;
--
2.39.2
next prev parent reply other threads:[~2024-01-17 22:39 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-17 22:38 [PATCH 00/18] serial: max310x: cleanups and improvements Hugo Villeneuve
2024-01-17 22:38 ` [PATCH 01/18] serial: max310x: fix NULL pointer dereference in I2C instantiation Hugo Villeneuve
2024-01-17 22:38 ` [PATCH 02/18] serial: max310x: add I2C device table for instantiation from userspace Hugo Villeneuve
2024-01-17 22:38 ` [PATCH 03/18] serial: max310x: use i2c_get_match_data() Hugo Villeneuve
2024-01-17 22:38 ` [PATCH 04/18] serial: max310x: use spi_get_device_match_data() Hugo Villeneuve
2024-01-17 22:38 ` [PATCH 05/18] serial: max310x: fix syntax error in IRQ error message Hugo Villeneuve
2024-01-17 22:38 ` [PATCH 06/18] serial: max310x: remove holes in struct max310x_devtype Hugo Villeneuve
2024-01-17 22:38 ` Hugo Villeneuve [this message]
2024-01-17 22:38 ` [PATCH 08/18] serial: max310x: use separate regmap name for each port Hugo Villeneuve
2024-01-17 22:38 ` [PATCH 09/18] serial: max310x: simplify probe() and remove() error handling Hugo Villeneuve
2024-01-17 22:38 ` [PATCH 10/18] serial: max310x: add explicit return for some switch default cases Hugo Villeneuve
2024-01-17 22:38 ` [PATCH 11/18] serial: max310x: use dev_err_probe() instead of dev_err() Hugo Villeneuve
2024-01-17 22:38 ` [PATCH 12/18] serial: max310x: replace hardcoded masks with preferred GENMASK() Hugo Villeneuve
2024-01-17 22:38 ` [PATCH 13/18] serial: max310x: use common detect function for all variants Hugo Villeneuve
2024-01-17 22:38 ` [PATCH 14/18] serial: max310x: use common power " Hugo Villeneuve
2024-01-17 22:38 ` [PATCH 15/18] serial: max310x: replace ENOTSUPP with preferred EOPNOTSUPP (checkpatch) Hugo Villeneuve
2024-01-17 23:24 ` Andy Shevchenko
2024-01-17 23:59 ` Hugo Villeneuve
2024-01-18 8:59 ` Andy Shevchenko
2024-01-18 13:15 ` Kent Gibson
2024-01-17 22:38 ` [PATCH 16/18] serial: max310x: replace bare use of 'unsigned' with 'unsigned int' (checkpatch) Hugo Villeneuve
2024-01-17 22:38 ` [PATCH 17/18] serial: max310x: reformat and improve comments Hugo Villeneuve
2024-01-17 22:38 ` [PATCH 18/18] serial: max310x: fix indentation Hugo Villeneuve
2024-01-17 23:26 ` [PATCH 00/18] serial: max310x: cleanups and improvements Andy Shevchenko
2024-01-18 0:00 ` Hugo Villeneuve
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=20240117223856.2303475-8-hugo@hugovil.com \
--to=hugo@hugovil.com \
--cc=andy.shevchenko@gmail.com \
--cc=cosmin.tanislav@analog.com \
--cc=gregkh@linuxfoundation.org \
--cc=hvilleneuve@dimonoff.com \
--cc=jan.kundrat@cesnet.cz \
--cc=jirislaby@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=shc_work@mail.ru \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox