Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp538775rdb; Thu, 30 Nov 2023 11:11:28 -0800 (PST) X-Google-Smtp-Source: AGHT+IFK1DxEvQ23Zj4OsiyPd1wYfHYr8W3OCRR3V30T5McDXfuOWpDBNB3vfmuVHbYYYj22qD/u X-Received: by 2002:a17:902:e5ce:b0:1cf:dd41:dc8 with SMTP id u14-20020a170902e5ce00b001cfdd410dc8mr13248929plf.13.1701371488188; Thu, 30 Nov 2023 11:11:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701371488; cv=none; d=google.com; s=arc-20160816; b=iq1vxYcr70mbM+GvbNFmdR7/JcVdC6Og1HWdIPJ8a8IK+2TAd2rOS4Amjwt/No6uWA 60VOeD3uLN1iydJKavCzn0qcztk3E3Dtnzh+sg73YTxsTA4G0ieNUNDbv0AotHojEHH9 5+bc+AkpbkhqvZddWOPOX56XMFn35jMcFK6S+sF5whPqDIsnhbhpl0zz2A3LV6DwRTYq YjR0ioR8TS+ZBKME2DP7qFHK4JkG/Hux/GFopMHIFNUra5qugai6aLtP9kcnksyI1oxz jLvxzJ80u/+QA0fItd+q+UAApemcGSyFNWzm+rFwS5TAGGOBORLNirWhjU3KosLXwu4w W1sQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:cc:to:from:dkim-signature; bh=3PnQzZfqCWVmo+CDz3VaUAypnIbooDxJULrp2OY6blg=; fh=TwCzphd3GvIn5DzVyM5Tad6hmxhn7TdVF0rNjlsRujg=; b=E/mSrQ1IvWtfrD4Hm0MB6OqDHaRbjVyG9aiQS8szLFGuERyziwzoAcK0b5VfM4oTQ1 STPFgZvJqlVZsW2qrIqYGCqtjYIXLOOF7JUh5UBGqO/2rm/r4hh0hcOLJ/2hcldXh5FY BujSY2EotImx0Foym6emFYEKAnUptni4iM8OBR+D6jN8l+xOg4pyC/qP/mbMut18MJ0/ yW+OCuyCOOzcmwLV4E7sruLUuoA4s++oNZJK3Vu8KRLsG/qIwSXcTbrdqvwKa4PFhkfa FBH+k86Sr1n6788cTwJgP0SwQN9CE09cusfIfKWxiSy94pmho03drzY1kcbwHACSfmI0 AEcQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@hugovil.com header.s=x header.b=KEht41Db; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id y14-20020a1709027c8e00b001cfc4215864si1653552pll.588.2023.11.30.11.11.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Nov 2023 11:11:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@hugovil.com header.s=x header.b=KEht41Db; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id B203282CD6C0; Thu, 30 Nov 2023 11:11:23 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346843AbjK3TLC (ORCPT + 99 others); Thu, 30 Nov 2023 14:11:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41538 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346785AbjK3TKy (ORCPT ); Thu, 30 Nov 2023 14:10:54 -0500 Received: from mail.hugovil.com (mail.hugovil.com [162.243.120.170]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4911310EF; Thu, 30 Nov 2023 11:11:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=hugovil.com ; s=x; h=Subject:Content-Transfer-Encoding:MIME-Version:Message-Id:Date:Cc:To :From:subject:date:message-id:reply-to; bh=3PnQzZfqCWVmo+CDz3VaUAypnIbooDxJULrp2OY6blg=; b=KEht41DbYffU6ijOAh53f96ftD AtlM0PWbyApl6BpKhSjnIk8GaKfOhHkaFIMzykvAEh+Nz3YVTYbdP1eNdKytpd2/XY9Rljim+MgFn UCu6enfHxXSXkGRjSha326AhtlLEAKQ66xFvDQTyam8RV3PuQjZPggn9YlRrFmNY02/s=; Received: from modemcable168.174-80-70.mc.videotron.ca ([70.80.174.168]:48272 helo=pettiford.lan) by mail.hugovil.com with esmtpa (Exim 4.92) (envelope-from ) id 1r8mR7-0003sb-Qr; Thu, 30 Nov 2023 14:10:58 -0500 From: Hugo Villeneuve To: gregkh@linuxfoundation.org, jirislaby@kernel.org, hvilleneuve@dimonoff.com Cc: linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, hugo@hugovil.com Date: Thu, 30 Nov 2023 14:10:46 -0500 Message-Id: <20231130191050.3165862-5-hugo@hugovil.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231130191050.3165862-1-hugo@hugovil.com> References: <20231130191050.3165862-1-hugo@hugovil.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 70.80.174.168 X-SA-Exim-Mail-From: hugo@hugovil.com X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_CSS autolearn=unavailable autolearn_force=no version=3.4.6 Subject: [PATCH 4/7] serial: sc16is7xx: add macro for max number of UART ports X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.hugovil.com) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Thu, 30 Nov 2023 11:11:24 -0800 (PST) From: Hugo Villeneuve Add macro to hold the maximum number of UART ports per IC/device. Signed-off-by: Hugo Villeneuve --- drivers/tty/serial/sc16is7xx.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/tty/serial/sc16is7xx.c b/drivers/tty/serial/sc16is7xx.c index eb2c0dcd3775..750c55b93f5e 100644 --- a/drivers/tty/serial/sc16is7xx.c +++ b/drivers/tty/serial/sc16is7xx.c @@ -28,6 +28,7 @@ #define SC16IS7XX_NAME "sc16is7xx" #define SC16IS7XX_MAX_DEVS 8 +#define SC16IS7XX_MAX_PORTS 2 /* Maximum number of UART ports per IC. */ /* SC16IS7XX register definitions */ #define SC16IS7XX_RHR_REG (0x00) /* RX FIFO */ @@ -1399,7 +1400,7 @@ static void sc16is7xx_setup_irda_ports(struct sc16is7xx_port *s) int i; int ret; int count; - u32 irda_port[2]; + u32 irda_port[SC16IS7XX_MAX_PORTS]; struct device *dev = s->p[0].port.dev; count = device_property_count_u32(dev, "irda-mode-ports"); @@ -1426,7 +1427,7 @@ static int sc16is7xx_setup_mctrl_ports(struct sc16is7xx_port *s, int i; int ret; int count; - u32 mctrl_port[2]; + u32 mctrl_port[SC16IS7XX_MAX_PORTS]; struct device *dev = s->p[0].port.dev; count = device_property_count_u32(dev, "nxp,modem-control-line-ports"); @@ -1716,7 +1717,7 @@ static unsigned int sc16is7xx_regmap_port_mask(unsigned int port_id) static int sc16is7xx_spi_probe(struct spi_device *spi) { const struct sc16is7xx_devtype *devtype; - struct regmap *regmaps[2]; + struct regmap *regmaps[SC16IS7XX_MAX_PORTS]; unsigned int i; int ret; @@ -1791,7 +1792,7 @@ static int sc16is7xx_i2c_probe(struct i2c_client *i2c) { const struct i2c_device_id *id = i2c_client_get_device_id(i2c); const struct sc16is7xx_devtype *devtype; - struct regmap *regmaps[2]; + struct regmap *regmaps[SC16IS7XX_MAX_PORTS]; unsigned int i; if (i2c->dev.of_node) { -- 2.39.2