From patchwork Thu Jan 18 15:22:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Hugo Villeneuve X-Patchwork-Id: 189263 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2bc4:b0:101:a8e8:374 with SMTP id hx4csp420258dyb; Thu, 18 Jan 2024 07:31:48 -0800 (PST) X-Google-Smtp-Source: AGHT+IGN50dYzSOt0BGyW2il49SuKQv3xA7OCCsOJEuwpaDpAR2nlnIQQ8bfXEMOdl4VgiV0RlC8 X-Received: by 2002:a17:907:7890:b0:a23:7576:3552 with SMTP id ku16-20020a170907789000b00a2375763552mr424319ejc.45.1705591907773; Thu, 18 Jan 2024 07:31:47 -0800 (PST) Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id gw11-20020a170906f14b00b00a2d4dee078csi4725137ejb.541.2024.01.18.07.31.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Jan 2024 07:31:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-30259-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@hugovil.com header.s=x header.b=A90jpAoR; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel+bounces-30259-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-30259-ouuuleilei=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 649961F28641 for ; Thu, 18 Jan 2024 15:24:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 008A62D046; Thu, 18 Jan 2024 15:22:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=hugovil.com header.i=@hugovil.com header.b="A90jpAoR" Received: from mail.hugovil.com (mail.hugovil.com [162.243.120.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 20BFD2C864; Thu, 18 Jan 2024 15:22:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=162.243.120.170 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705591353; cv=none; b=kjJwdvRXWQRcUYQbCfCSNA5smtBoRro2EuwoU3ZFNlMMNxI1roe09NoXU43blnSuOeU+qWJ1ZNCXZdFsWxFMf1ZaBzwZ7aBlZqbKQaFXJuCC5ZsAFQRi60+OWiuIOBAKJPDdptsrlz7Cy3TzUl/IHEweO3aJlGg/j+WA/eUlXKs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705591353; c=relaxed/simple; bh=yzcAS27fypeYF2xSvuB6sRiOfb2C9qOYS1MIp8jc1x4=; h=DKIM-Signature:Received:From:To:Cc:Date:Message-Id:X-Mailer: In-Reply-To:References:MIME-Version:Content-Type: Content-Transfer-Encoding:X-SA-Exim-Connect-IP:X-SA-Exim-Mail-From: X-Spam-Checker-Version:X-Spam-Level:X-Spam-Report:X-Spam-Status: Subject:X-SA-Exim-Version:X-SA-Exim-Scanned; b=kfQxeX0Ju7QDupNq8b9xwGrQP+B6ZWZ0obpL6uP26fRkUB9ztVfGv3pZqJQpxdBePJXMhAsPAMqeXeE452QFjlYmHHqMmb4/1QW3negESigpRqaWqoSyAFSF/BKpCWfSV6MIZyYiP8x2QS7vp+dOKQAIKp3khnOhcUUq9McbaKs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=hugovil.com; spf=pass smtp.mailfrom=hugovil.com; dkim=pass (1024-bit key) header.d=hugovil.com header.i=@hugovil.com header.b=A90jpAoR; arc=none smtp.client-ip=162.243.120.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=hugovil.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=hugovil.com 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=zC3bqoaLG/JWHahgf64dXD3E0eIjCOYXIjC2TGYWHbo=; b=A90jpAoRC2GFIZ9y4BC4Ym4Waw 9VmocsMr+nliRBiHqxbHg4PfScjBQGoLQKvVnCGbTy6jrC8EyiqVIkcMEb/kkNz/fUqfo+4WMaIKw NP8YS2CoYYLRQICswyMJ+P3QSAb4axlwEOie9J/WgoY3rhjyxbensyOd+3tcVsyT4OtA=; Received: from modemcable168.174-80-70.mc.videotron.ca ([70.80.174.168]:57058 helo=pettiford.lan) by mail.hugovil.com with esmtpa (Exim 4.92) (envelope-from ) id 1rQUDp-0002lf-OZ; Thu, 18 Jan 2024 10:22:27 -0500 From: Hugo Villeneuve 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 , =?utf-8?q?Jan?= =?utf-8?q?_Kundr=C3=A1t?= Date: Thu, 18 Jan 2024 10:22:03 -0500 Message-Id: <20240118152213.2644269-8-hugo@hugovil.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240118152213.2644269-1-hugo@hugovil.com> References: <20240118152213.2644269-1-hugo@hugovil.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-SA-Exim-Connect-IP: 70.80.174.168 X-SA-Exim-Mail-From: hugo@hugovil.com X-Spam-Level: X-Spam-Report: * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP * -0.0 T_SCC_BODY_TEXT_LINE No description available. Subject: [PATCH v2 07/17] serial: max310x: add macro for max number of 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) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1788442740149898625 X-GMAIL-MSGID: 1788442740149898625 From: Hugo Villeneuve Add macro to hold the maximum number of UART ports per IC/device. Reviewed-by: Andy Shevchenko Reviewed-by: Jan Kundrát Tested-by: Jan Kundrát Link: https://lore.kernel.org/all/ddbc67dd-f8a3-4a6a-954a-bee49260ecab@cesnet.cz/ Signed-off-by: Hugo Villeneuve --- 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;