From patchwork Thu Nov 30 19:10:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hugo Villeneuve X-Patchwork-Id: 172049 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp619399vqy; Thu, 30 Nov 2023 11:11:28 -0800 (PST) X-Google-Smtp-Source: AGHT+IFVFYGHwSIgXt94uTT/fDCmPRRTym1F8+vjnac5B6bNDrMjvlofag1XF1HPVdhy2dpo1zxs X-Received: by 2002:a05:6a00:1ca8:b0:6cd:e52c:8d62 with SMTP id y40-20020a056a001ca800b006cde52c8d62mr3444136pfw.1.1701371487726; Thu, 30 Nov 2023 11:11:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701371487; cv=none; d=google.com; s=arc-20160816; b=nUy0kVrXrPEQxE10hM8woC5HjZXedIER7T6HmqbJSLjWPhcLkOKzc9184Annr2YUUE 67Gu4MgxpTsYbdOge37SEkSixCrw91L+2zcrWSmYZYHanE2IoTWIDxAR00hakmHuqroL NuWQdg5rv46XpR8+GByBffv1oZipJntPhP7MW9sOpipAyXuIC5GbEt42FmhTrGUxFDHT wL4YS/oxtguTy4SeD1uvFBKpJObCdxYL/CxBpvokZ9zZnE1y81IaiYmn3sTTIW0z1Rwx r7m3/NXqcZOqlWOOqy09fsbyyXGOHcfovBSoAaY+YYf/ROFKDw1KmmZTswcRSXsmbWtz tzeA== 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 Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id e19-20020a656793000000b005be10ed80d9si1881944pgr.177.2023.11.30.11.11.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Nov 2023 11:11:27 -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 3A0618027B62; Thu, 30 Nov 2023 11:11:17 -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 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:17 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1784017308862146444 X-GMAIL-MSGID: 1784017308862146444 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) {