Skip to content

Commit acd7f11

Browse files
hvilleneuvedoogregkh
authored andcommitted
serial: sc16is7xx: add macro for max number of UART ports
Add macro to hold the maximum number of UART ports per IC/device. Signed-off-by: Hugo Villeneuve <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent d9ffada commit acd7f11

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

drivers/tty/serial/sc16is7xx.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929

3030
#define SC16IS7XX_NAME "sc16is7xx"
3131
#define SC16IS7XX_MAX_DEVS 8
32+
#define SC16IS7XX_MAX_PORTS 2 /* Maximum number of UART ports per IC. */
3233

3334
/* SC16IS7XX register definitions */
3435
#define SC16IS7XX_RHR_REG (0x00) /* RX FIFO */
@@ -1398,7 +1399,7 @@ static void sc16is7xx_setup_irda_ports(struct sc16is7xx_port *s)
13981399
int i;
13991400
int ret;
14001401
int count;
1401-
u32 irda_port[2];
1402+
u32 irda_port[SC16IS7XX_MAX_PORTS];
14021403
struct device *dev = s->p[0].port.dev;
14031404

14041405
count = device_property_count_u32(dev, "irda-mode-ports");
@@ -1425,7 +1426,7 @@ static int sc16is7xx_setup_mctrl_ports(struct sc16is7xx_port *s,
14251426
int i;
14261427
int ret;
14271428
int count;
1428-
u32 mctrl_port[2];
1429+
u32 mctrl_port[SC16IS7XX_MAX_PORTS];
14291430
struct device *dev = s->p[0].port.dev;
14301431

14311432
count = device_property_count_u32(dev, "nxp,modem-control-line-ports");
@@ -1727,7 +1728,7 @@ static unsigned int sc16is7xx_regmap_port_mask(unsigned int port_id)
17271728
static int sc16is7xx_spi_probe(struct spi_device *spi)
17281729
{
17291730
const struct sc16is7xx_devtype *devtype;
1730-
struct regmap *regmaps[2];
1731+
struct regmap *regmaps[SC16IS7XX_MAX_PORTS];
17311732
unsigned int i;
17321733
int ret;
17331734

@@ -1798,7 +1799,7 @@ MODULE_ALIAS("spi:sc16is7xx");
17981799
static int sc16is7xx_i2c_probe(struct i2c_client *i2c)
17991800
{
18001801
const struct sc16is7xx_devtype *devtype;
1801-
struct regmap *regmaps[2];
1802+
struct regmap *regmaps[SC16IS7XX_MAX_PORTS];
18021803
unsigned int i;
18031804

18041805
devtype = i2c_get_match_data(i2c);

0 commit comments

Comments
 (0)