From patchwork Wed Jan 17 22:38:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Hugo Villeneuve X-Patchwork-Id: 188951 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:30f:b0:101:a8e8:374 with SMTP id ia15csp228082dyb; Wed, 17 Jan 2024 14:42:17 -0800 (PST) X-Google-Smtp-Source: AGHT+IERi3efd1xYNKKVNCVVcZzEdI1mq8aXLkltUkKIARe57uIzq7YYsucmmWZDNgrPfVQK+gY7 X-Received: by 2002:ac5:c347:0:b0:4b6:c9fb:b186 with SMTP id l7-20020ac5c347000000b004b6c9fbb186mr5036144vkk.3.1705531336786; Wed, 17 Jan 2024 14:42:16 -0800 (PST) Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id qf13-20020a0562144b8d00b006818c2de31dsi93243qvb.502.2024.01.17.14.42.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jan 2024 14:42:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-29499-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@hugovil.com header.s=x header.b=vyO0ZbdH; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel+bounces-29499-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-29499-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 93A5F1C21E94 for ; Wed, 17 Jan 2024 22:42:16 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D64932D639; Wed, 17 Jan 2024 22:39:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=hugovil.com header.i=@hugovil.com header.b="vyO0ZbdH" 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 8901928E08; Wed, 17 Jan 2024 22:39:20 +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=1705531161; cv=none; b=V285b+eoTy0DSjTUMEKAWC2re8M+PU2RjQ0BMst7Ca4LvvI1QX9iALMe0b1uPexaC9rNOlBoDbpJ4JJoCxNUEhjp7VK36zAYNCwE207okl7SmL/8ombqo8qfC0Zp+0MEMENJ3BukYfjjEGXFEWvjAikyDhKK2uJbOc7OJz1WYK0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705531161; c=relaxed/simple; bh=nd6v9ymESTz+pPY5dO6Su9kUiKnyUwRPab1CNAWZxH0=; 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=Cpy57ZSxVzw+DVpdAbsYEloMqAh11vqFzb55c/VWUNHDAboE11F65Vk2KA8gtqrVESmu/w7GnOXxmUYkmnPaEsUFV9jvrCSTFueifFXyRfz0NznFC/8lGcBGq6j57lnDgEgJq6DVLSKbpWssvIDgHKFMi/YhmtpG3c5ro2o/3TU= 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=vyO0ZbdH; 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=a9f/Dsr9bsIr037f2wYcnLfCqwzTzik3k5wVA/R7lVk=; b=vyO0ZbdHpqyl/uEmPNUV9/b8RL v+qCgIQRNXgx7O9PoTMjA279we11ayYj5cwD+Ecw5Xg4Svq1T0OOodzCR3HASIixitSjwVG0NLKmF S98hROSXUWAkPKM91fGMalg3EQaRcmsn2L8XwLmbtDAt6dCPJj+811OavLTkwfEwrHa0=; Received: from modemcable168.174-80-70.mc.videotron.ca ([70.80.174.168]:52924 helo=pettiford.lan) by mail.hugovil.com with esmtpa (Exim 4.92) (envelope-from ) id 1rQEYw-000155-3y; Wed, 17 Jan 2024 17:39:11 -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: Wed, 17 Jan 2024 17:38:45 -0500 Message-Id: <20240117223856.2303475-8-hugo@hugovil.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240117223856.2303475-1-hugo@hugovil.com> References: <20240117223856.2303475-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 07/18] 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: 1788379227312674321 X-GMAIL-MSGID: 1788379227312674321 From: Hugo Villeneuve Add macro to hold the maximum number of UART ports per IC/device. 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;