From nobody Tue Sep 29 00:31:23 2026 Received: from mail-wr1-f52.google.com (mail-wr1-f52.google.com [209.85.221.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 53FB145C6F7 for ; Fri, 14 Aug 2026 09:19:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786699198; cv=none; b=kRwkn6XWYh+NQu2Im0sp8h5dFoPbCublVwpYIe+lcdFIPUmZrWsgRQ5KRU5vKkAQx7257rpRDSh6C1eKxKSg2GAx5M8jSVKfQ1NQN+6tsolql8A/CW5AC5wZ2HjjLihtkdnCm85XbfGaUx6/aVSEJWQir7WHnrIuxy89IRHgvtU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786699198; c=relaxed/simple; bh=B0hyRg6SFBi4I7J+00dwIsyuLQTakRVhZSTprV+T5Uo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=XVTmKtVnYeG1D//TZQWt20oRvVQxJdNiRV3CN2aSDyC5iNNxNJvKK4/pjWRTzy+vUHUz0DeVL1SyjOLwGcdowhE/c5JvJThlkRTTOaakDD2mrAMA0D7ST5PG/98nt/4/+R+EZEkSp/CbmG+XpYddMsgHB/0HCZaY1WS/0z4CaXM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre.com header.i=@baylibre.com header.b=hP3rn60d; arc=none smtp.client-ip=209.85.221.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre.com header.i=@baylibre.com header.b="hP3rn60d" Received: by mail-wr1-f52.google.com with SMTP id ffacd0b85a97d-47f96c5b722so466669f8f.0 for ; Fri, 14 Aug 2026 02:19:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre.com; s=google; t=1786699194; x=1787303994; darn=vger.kernel.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to:content-type; bh=dNFeMWmv+NMrZw4pQd0HP59/wbeuN2eBHRitJa7/Q2M=; b=hP3rn60dfgjAbAViLOAwBJi0MPkGFn562xbp7+0zlhpeDsWzNTm/X6PoZpweBmBx9u 5gG+hb3tb66IfaaOVxgVLDhSTZEVhMqmnXCW/Bn5T9mzt5ONk+t1ioppEb8uhKC9ozQI nm+KsLxjcYd5mXWzqq0No30+9LP38qYFl/9YuShvNW9tTEhzBSbOqKy8kQQ4spXPFuUF Thv7Fwdvab9viGttVH+QSLpyXWQJySbAWkgYjdL0HQILGxT2iCQeKBAi1dYe8xNCwr3i 3FHtki4spLpCfXYsqRaZm/36LEv/2UoEo4h2ISsTnK4cyzyUvk/7DuTX8gDFtCUEiq8O c5uQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786699194; x=1787303994; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=dNFeMWmv+NMrZw4pQd0HP59/wbeuN2eBHRitJa7/Q2M=; b=M1Y+HEjtmy63CaR+yi/VRYfaGiaQScmLVysFClWO5v1I1sXmZxoiUanzpKNl5+1LtS JqphFlupF3cmq6A/sadWengMH3HsDI2SzvcO7NLOU5y9CJ7HMhl8gRv6XZJW1hsB1oId t/88WHXkuSt8zBmxNBeQDZ9ipE4H3W647K3HpkJC06noTJYC36wUWRywXoDFOQDwDhwH jg0Ag7x0eJj5DWdX2iZ7v253pSVXpHw4UWt6jwUKVSaI2sZK6my4izElBGP6LeURNkqP E8L1r5ZWZsVhVE/eSv8tc/etcRyEsVupDJnXsUPAayYjqM7tTbkGBOBdaETM3aatg+R+ xw6w== X-Forwarded-Encrypted: i=1; AHgh+RqR7ixqmTihVH90TSRkZ61slgMjVXD9BmweUUvjDcxqcM6xCXhZU2Egf10Bx8Oic2nw01nKKdzkZ3PXJIA=@vger.kernel.org X-Gm-Message-State: AOJu0Yx0WJ2R/7cAIz9SI3o4GNcngsJChSbKpK+6vzQHZA2li6DuIbLf bza72Ho4iooxZRzbsiamIQE2EtQ6YFRhDQqWXdJ9g1dVGkHk+mqR/svsiTOoJjxdrHA= X-Gm-Gg: AR+sD10Ul6O27L5leuRyguPcyStxksDTALLUCVN4EKLZV35OegdjqcSt5s5eBe43H5g qQF+PoUVDNr+55ksJSpQ9/BpxjvcbgXqOcDAviROstbt8xTZGGdV6bg2EDgFiIbD7Cz55znJHQZ ux3n70BhT/XyTmgOW9/Lkxws0pvdxklZ1SrsYqZsU64adqpaGtgc8BrBSeG3z1B5VWBDAyMVePc hMRNYz+ieo8DoPCd9cef9h3n0dRGh/FJJSB+5p5bw+4YyqVECRShCXOyIEfZy4bc84HWXAnAkIj fxlStRj+bMhw0BDqu9L84kZlDN5aLlTgGPFYge/+smmxI7/g6f9qpSQ60dxjb40A/m7CnTE9/FR nI+FJLbYRAXy/PhRfjDW5W9Zrah/bIR+BfsPZFZno1UZRxT+aLlbhJuNshuKqLmFZtCv/7z4MOy NhxDvIvCGItA4aDn5NT0XSSIthGqzOrA4FOTHayjdsu847no25ewRHeHWaHaY+EJvzzpbkXql9V blvY1gKQ4BDOebUfFpELRXsBHP1BnoHzhyV49axPkayKrU537dq X-Received: by 2002:a05:6000:2588:b0:47f:97f6:d39a with SMTP id ffacd0b85a97d-48160799ccemr6465996f8f.17.1786699194189; Fri, 14 Aug 2026 02:19:54 -0700 (PDT) Received: from localhost (p200300f65f017104e65cfeae4f257a65.dip0.t-ipconnect.de. [2003:f6:5f01:7104:e65c:feae:4f25:7a65]) by smtp.gmail.com with UTF8SMTPSA id ffacd0b85a97d-4815f21a31dsm6965832f8f.9.2026.08.14.02.19.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Aug 2026 02:19:53 -0700 (PDT) From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig=20=28The=20Capable=20Hub=29?= To: Greg Kroah-Hartman , Jiri Slaby Cc: Andy Shevchenko , Atsushi Nemoto , John Ogness , linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, Geert Uytterhoeven , Geert Uytterhoeven Subject: [PATCH v3 1/7] serial: txx9: Drop noop probe function and dangerous remove callback Date: Fri, 14 Aug 2026 11:19:27 +0200 Message-ID: X-Mailer: git-send-email 2.55.0.11.g153666a7d9bb In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" X-Developer-Signature: v=1; a=openpgp-sha256; l=3918; i=u.kleine-koenig@baylibre.com; h=from:subject:message-id; bh=B0hyRg6SFBi4I7J+00dwIsyuLQTakRVhZSTprV+T5Uo=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBqft2jybxHqf0a1w9LvKFG+VYlXe6SVBgm1L+/w zlz4nZyL6CJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCan7dowAKCRCPgPtYfRL+ TspCCACYF7opJX/K1T2ZMtOngChkkQfRZQHXw2ooDb95aHFGig/MRZhKwGrdbv78HLh6q/wvsp6 wteg9r7QdAHTULqArGu+Sv0/8/vghcHVMERW7V7Fn2fHDMUssa5e5Zb1sr7atCEGoPXt5SwxEq0 Z672evxL/i0kR0by+pwTz+pPwcjLLVjnx8Adx3TEW2Fdwflrqz4GcaEdO4rF6YAvz3f0SsHQ7dV +GxPGB2Negt9yVNm6l/LYV4BnfKPwdEHEXYg+3/wmuFPO6LZPSPljPxfdjAXN6VVziSWC5642ea JGpOCMCDhe5GmSd9FpZV9dOIggUinu5C9pOXJGDShhgWjrPw X-Developer-Key: i=u.kleine-koenig@baylibre.com; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 Content-Transfer-Encoding: quoted-printable The only platform device that can be bound to the driver is allocated by the driver itself. That device doesn't have platdata, so the probe function only consists of a loop that is never run and thus can be dropped without loss of functionality. The remove function then should better not undo things that were not done in the first place. That happens because serial_txx9_init() calls serial_txx9_register_ports() with the created platform device and so up->dev =3D=3D &dev->dev evaluates to true and uart_remove_one_port() is called twice for each port. So let serial_txx9_exit() undo exactly what serial_txx9_init() does and remove the useless respectively wrong functions. Fixes: 0970769aceb9 ("[SERIAL] serial_txx9 driver update") Reviewed-by: Atsushi Nemoto Tested-by: Geert Uytterhoeven Acked-by: Andy Shevchenko Signed-off-by: Uwe Kleine-K=C3=B6nig (The Capable Hub) --- drivers/tty/serial/serial_txx9.c | 55 ++------------------------------ 1 file changed, 3 insertions(+), 52 deletions(-) diff --git a/drivers/tty/serial/serial_txx9.c b/drivers/tty/serial/serial_t= xx9.c index 4ae9a45c8e3a..ef56979321b9 100644 --- a/drivers/tty/serial/serial_txx9.c +++ b/drivers/tty/serial/serial_txx9.c @@ -1009,7 +1009,8 @@ static void serial_txx9_unregister_port(int line) struct uart_port *uart =3D &serial_txx9_ports[line]; =20 mutex_lock(&serial_txx9_mutex); - uart_remove_one_port(&serial_txx9_reg, uart); + if (uart->iobase || uart->mapbase) + uart_remove_one_port(&serial_txx9_reg, uart); uart->flags =3D 0; uart->type =3D PORT_UNKNOWN; uart->iobase =3D 0; @@ -1019,52 +1020,6 @@ static void serial_txx9_unregister_port(int line) mutex_unlock(&serial_txx9_mutex); } =20 -/* - * Register a set of serial devices attached to a platform device. - */ -static int serial_txx9_probe(struct platform_device *dev) -{ - struct uart_port *p =3D dev_get_platdata(&dev->dev); - struct uart_port port; - int ret, i; - - memset(&port, 0, sizeof(struct uart_port)); - for (i =3D 0; p && p->uartclk !=3D 0; p++, i++) { - port.iobase =3D p->iobase; - port.membase =3D p->membase; - port.irq =3D p->irq; - port.uartclk =3D p->uartclk; - port.iotype =3D p->iotype; - port.flags =3D p->flags; - port.mapbase =3D p->mapbase; - port.dev =3D &dev->dev; - port.has_sysrq =3D IS_ENABLED(CONFIG_SERIAL_TXX9_CONSOLE); - ret =3D serial_txx9_register_port(&port); - if (ret < 0) { - dev_err(&dev->dev, "unable to register port at index %d " - "(IO%lx MEM%llx IRQ%d): %d\n", i, - p->iobase, (unsigned long long)p->mapbase, - p->irq, ret); - } - } - return 0; -} - -/* - * Remove serial ports registered against a platform device. - */ -static void serial_txx9_remove(struct platform_device *dev) -{ - int i; - - for (i =3D 0; i < UART_NR; i++) { - struct uart_port *up =3D &serial_txx9_ports[i]; - - if (up->dev =3D=3D &dev->dev) - serial_txx9_unregister_port(i); - } -} - #ifdef CONFIG_PM static int serial_txx9_suspend(struct platform_device *dev, pm_message_t s= tate) { @@ -1096,8 +1051,6 @@ static int serial_txx9_resume(struct platform_device = *dev) #endif =20 static struct platform_driver serial_txx9_plat_driver =3D { - .probe =3D serial_txx9_probe, - .remove =3D serial_txx9_remove, #ifdef CONFIG_PM .suspend =3D serial_txx9_suspend, .resume =3D serial_txx9_resume, @@ -1251,9 +1204,7 @@ static void __exit serial_txx9_exit(void) platform_driver_unregister(&serial_txx9_plat_driver); platform_device_unregister(serial_txx9_plat_devs); for (i =3D 0; i < UART_NR; i++) { - struct uart_port *up =3D &serial_txx9_ports[i]; - if (up->iobase || up->mapbase) - uart_remove_one_port(&serial_txx9_reg, up); + serial_txx9_unregister_port(i); } =20 uart_unregister_driver(&serial_txx9_reg); --=20 2.55.0.11.g153666a7d9bb From nobody Tue Sep 29 00:31:23 2026 Received: from mail-wr1-f53.google.com (mail-wr1-f53.google.com [209.85.221.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 441D845C713 for ; Fri, 14 Aug 2026 09:19:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786699199; cv=none; b=M6WhdDzSG1psg3L10FCvAsLitaygc1gIuDkYSb0TiJP+N5q5r1fsf2lA8flcRKc4UiaJ8xby/FHU4eG4+QVrbLbnrwcDveia7aGCBQ302TvDJAyQSKtk5PxzDBvIciIVTiwvKZbBLzabZRswJNpyzWScOAA+R0DidoH3U73MK1o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786699199; c=relaxed/simple; bh=1Tf/eLztcajZ7S8Q0F+FjtJiQzvzesbS3paGTmNNuxI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=PinD2m+tfahZ9GLPskOy4dEGKg16WH+ZZ3FkUDLQARjXtjdb/VwptQeraQilBaiPHsLLW4MFizKqCM8I+cZxscJn0WKOSDivYnhTGKeQMmxz7Z6w+DivEQJQ9ZjFA//VjEQk0XsXWPhbnyustD4s4GbQ4vne8aavXrPMtaQrKxY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre.com header.i=@baylibre.com header.b=o6PXVG70; arc=none smtp.client-ip=209.85.221.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre.com header.i=@baylibre.com header.b="o6PXVG70" Received: by mail-wr1-f53.google.com with SMTP id ffacd0b85a97d-47362928f65so731090f8f.2 for ; Fri, 14 Aug 2026 02:19:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre.com; s=google; t=1786699195; x=1787303995; darn=vger.kernel.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to:content-type; bh=3xLyJAYPS0unz+4dcq3L1U9sMIMO3rlmUhONpX0XaOA=; b=o6PXVG70Mx27qFe4P0gF8afUDYWmroX4zp6bmsFxyCBX3h4V6fjX+/BymCs6J8iasI 2hbquThdBdhBOqpLE2QF26MhTbd5Ruwu0nkRjlSo6Be5Mi6Agr48EP0iezCHxfi8e0Kv eUoAU8nzHr08TxjjqRhN2XmK2oEfnXfqDrfD8jnTL/5htf6PTRjHKtpW8oa5nS6zwT0Y +hEKoCrNK7xoTPEtLtdoBIsXC98iw+oeo8w1EUC6K4QL5ZZwOt9DSC0yPNcFpz5sF7RS LoBBDy5Os7VBAh83tEFnA6EMl2O+ndbVWuykEb8ztz2ltq5aCppWz4+dhKYTotj5FzqN 0a6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786699195; x=1787303995; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=3xLyJAYPS0unz+4dcq3L1U9sMIMO3rlmUhONpX0XaOA=; b=fwRCnBWdRqGFVooRgXUKlVU1QukbTDmie4jPL6bF9Oaej8b9u4NYMEsOZQv3N4yErQ 6PhZj/iDlgke7/cQgbJyrbbcR++WND4JIy6a3EtlelT3sJuvnqBltCUAVP3JxBngyGh3 qGX4a71uEfuUE018ZMtzdC/jw2UZFwTrR1TSEfbvLkbDNSyKhb9Ni+g1sAuPFDrES6kY dWuELAY6MqiuY7f0aP14EG8xr9sqQGILW4BI2Msxl2qktBEn5Ah8iw2dFy5mqrUwMQPL 7N/9rc8WkifilqQ7I9kWUudCOoO3+FlZezM8N+ih3F3H0Tu4QSkViEYvNX8UDlRJ+4o8 P7+g== X-Forwarded-Encrypted: i=1; AHgh+Rr/e5gUSnkiGar34AXfh6GOZFTQ2XCeUeInKFMHc9FdImU3f2Ddmi5SGINr/8lFpaNB8Gaoy8T2k9s0rDo=@vger.kernel.org X-Gm-Message-State: AOJu0Yw29mfTVpg750+YBL3NczSvbo4issobNG/C0KmAXs79EJct6VkS F5FyP5LTEKvqeLoMIZ2jenss4WQMPpRS5EbOFW6f1LzTHEttNjPdGVxL5X25HsFxWiY= X-Gm-Gg: AR+sD10KUVu60l7ZkhMsolsN32ivUvdVv7tKs9dJP9rL6goPNg3kaBVh3uygVqmeEsN JSEAHaOdIgngvbWF4Ptu2EVHegk8tmtrDH7qfHIRXC8+TNqhaynBrSACDJI147okHpaAQs2dmR5 CT1CJAkdwBFivueq5GBdxwoJ6KOcRHN7mlnBsJUtgM+oQoUAtFEAM1nB4Nik0lPsX8pS1Zvda+q t9lfWPuUJJlFiiIevcUvUQVt8TXVAH41xmD6skflSr0nbrIT9HjDMPrkfXo5vIoXafxmeFMC90A x3OJkZNJCG/WdE4+tiabJ2UmzcBVAlo2ja8OzlNaAvud/n62+Baa+OcFeoVnrMWhsp0sL5pA4bl hJDToN7MmvPg/lCtBhG+ffQWL5NcvmZ62KTZe4hZTwL7rJoLBHpBEspj/pNx4BkRd7AqAiYYjRi 6cnh2qJejxJf0WmkPzXwxCaI/j8adD1AzInKk52BWpI6H1lmnxhzvLd7vVDQTjqy0is5ObWZ6JQ IwHjXcmY52d+xkSvdH2QrC1dyPFbtUEDNH/GYWIU+WLtXQX04maY2qc8G/kSJc= X-Received: by 2002:a05:6000:260c:b0:47f:97e9:fe60 with SMTP id ffacd0b85a97d-481607540e2mr6284706f8f.15.1786699195567; Fri, 14 Aug 2026 02:19:55 -0700 (PDT) Received: from localhost (p200300f65f017104e65cfeae4f257a65.dip0.t-ipconnect.de. [2003:f6:5f01:7104:e65c:feae:4f25:7a65]) by smtp.gmail.com with UTF8SMTPSA id ffacd0b85a97d-4815f2c6115sm6510009f8f.32.2026.08.14.02.19.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Aug 2026 02:19:55 -0700 (PDT) From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig=20=28The=20Capable=20Hub=29?= To: Greg Kroah-Hartman , Jiri Slaby Cc: Andy Shevchenko , Atsushi Nemoto , John Ogness , linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH v3 2/7] serial: txx9: Drop usage of uart_match_port() Date: Fri, 14 Aug 2026 11:19:28 +0200 Message-ID: X-Mailer: git-send-email 2.55.0.11.g153666a7d9bb In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" X-Developer-Signature: v=1; a=openpgp-sha256; l=1195; i=u.kleine-koenig@baylibre.com; h=from:subject:message-id; bh=1Tf/eLztcajZ7S8Q0F+FjtJiQzvzesbS3paGTmNNuxI=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBqft2lBdej6+oWxYZYWWKZtZlB7quUTjW42xBkf fniCEVsD0uJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCan7dpQAKCRCPgPtYfRL+ Tu7gB/9BYIkVUopJOi02OxCh2FlG546H2RnSQZKMV/e9NSPryOfGiVxUSv+azmGgE1ZpOv3tuxP W1fCx2ny3EL7d2nKmp3SZgwdbH0N57UEr6mKZqeLU0/JWqtvoc57RYCmtXPJmvC5xYY6KggVeWq faws/y1Bz+ru+0LHghFRTK9FCnVW7FixKhFa9kXcOHbBU5wUihu3RI9CZqw5CdNIZVPces1ZQpT yH2xraUH4DujgeRmzJxroAr4zsA0EcCptoLdykM3O7yepFRIi2TyNxZiaRbK8As05e49CLwz/E/ M8d7yJ0PwX6EotQMhU5wABNrjkuglUbI07n4OBHPZRf7E9Yg X-Developer-Key: i=u.kleine-koenig@baylibre.com; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 Content-Transfer-Encoding: quoted-printable Where the uart_match_port() function is used it's known that .iotype is UPIO_PORT. So uart_match_port() is equivalent to comparing .iobase. Remove the call to uart_match_port() which then only has a single caller that is handled in the next commit. Signed-off-by: Uwe Kleine-K=C3=B6nig (The Capable Hub) Reviewed-by: Atsushi Nemoto Reviewed-by: Geert Uytterhoeven --- drivers/tty/serial/serial_txx9.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/tty/serial/serial_txx9.c b/drivers/tty/serial/serial_t= xx9.c index ef56979321b9..5b574ed276b2 100644 --- a/drivers/tty/serial/serial_txx9.c +++ b/drivers/tty/serial/serial_txx9.c @@ -965,7 +965,12 @@ static int serial_txx9_register_port(struct uart_port = *port) mutex_lock(&serial_txx9_mutex); for (i =3D 0; i < UART_NR; i++) { uart =3D &serial_txx9_ports[i]; - if (uart_match_port(uart, port)) { + /* + * serial_txx9_register_port() is only called from + * pciserial_txx9_init_one(). So .iotype is UPIO_PORT and + * comparing .iobase serves to distinguish ports. + */ + if (uart->iobase =3D=3D port->iobase) { uart_remove_one_port(&serial_txx9_reg, uart); break; } --=20 2.55.0.11.g153666a7d9bb From nobody Tue Sep 29 00:31:23 2026 Received: from mail-wr1-f54.google.com (mail-wr1-f54.google.com [209.85.221.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E0BCB45C6FC for ; Fri, 14 Aug 2026 09:19:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786699200; cv=none; b=m0CwJTnGbYR15p/TacAVSndKFbd3EVzldqeuJ6c1zFqUt/fzv+aXQkjjYTcClEl8XZCV5h/I9xdxScYbqcJE3mQ8feAkNAqezPdeTTNxkpTvQQA121AQHxT2sWWkfflI6HAYwZFJ6GHNlUcZXBIm2HSXc/Jbpj2L6U4KLlEnkAc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786699200; c=relaxed/simple; bh=2sNSyeHwlo1iJxAfsdit9RrWvURm4tpiXcynTe0rlZI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=FDokIyoB5Xl/ju7OppeucAmOIrg9eaBBR6BA39xNJpPEpiAzBgozv9/Wd9k1JshixJMvfsu8CjHXmJzX6BMV7wkPSV4NbT7WUhGcqdQcpijzfBTuSAsgpQR2s4spPkij+gLU0wZjE/h0vy+XbdK24Csy33+FHwH+YI+PKsxbWZk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre.com header.i=@baylibre.com header.b=I6MviUYU; arc=none smtp.client-ip=209.85.221.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre.com header.i=@baylibre.com header.b="I6MviUYU" Received: by mail-wr1-f54.google.com with SMTP id ffacd0b85a97d-47f904e80eeso748238f8f.1 for ; Fri, 14 Aug 2026 02:19:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre.com; s=google; t=1786699197; x=1787303997; darn=vger.kernel.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to:content-type; bh=DtoSRUtagmG4idUbZhP76t47NSwZbUeuCRMUScCpafc=; b=I6MviUYUxv0bpz2qHs7q+NgYqPfW0atSOJqn9rSI14rytPPDDHQZZGMoCCFzjMlxe4 T9yyZ5id58O1Y9DidVVVdVzcgwFtIHHARQy57yQ9t9N7zXSCTZlnpaD9k37I/C1zd7KK EBhQiSCj0g08KzlRTMjv+KmliXqMRb/TaSsARdCWdDpjDX8XrLbVdsQiQHNZmyAU80FL tzHVF5vyZz5ycS/7aQX/XYJ5wdasC7gRiHsZjzmZvVpDq3KmNV/snwr3YOslZL6JlFMK w4Q1n9CkeQBEiT4BqcgqEaSWoQuJpZeBWUD9wcax3umsJG37lhdzKc32bcaDTyRF1GsM I72g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786699197; x=1787303997; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=DtoSRUtagmG4idUbZhP76t47NSwZbUeuCRMUScCpafc=; b=sY9LLp4Ct/8VfJUHxZPtl9YyvLMTfhUvq4FRea9L8G30b184NQDy+1uAj3HlByZa+C PYXbxFnwmcW/GDY9gDfzoQnAU0kHh9J8t3zhAjaxonvUy1czHn4Aqb2b5RspOj5kdr16 OVHlsdNvxsgHDZJAQzTTd4dG8YZ25c26XTESz5pXi31PSTpgXWm9L/qNDZ8PDxnMCR+Y Ou5sM/jqqY8k7Dd58QOtv5wSF0whOixtgUYRUsodGIhtHQAWn71EhNQ7YcmBcBkMp70s kFZUG171uBpeacdDsTVezOYSLEi+j7EQW9iQ0xjC9w+h0dPW/ErsDCK7jCMBXivrJ+k8 L4+w== X-Forwarded-Encrypted: i=1; AHgh+RpVGqaITd9XjtJSiPCZVIKIH7/CAWb30ZpLAYjDo2NV0Gswkr/zSnVw5KqMJsBtftopPktvkGNKV0szt7E=@vger.kernel.org X-Gm-Message-State: AOJu0YxBWTZbdskCZXPfR8k+dKLCsay9V+fFyfSICx752d9roWF6DPjb TBz/3m07fMbUZpUEiyCLEl+wXk79vY0RDp9F5k6vo4z8569JIlzDbuoSByFQ4Se8K7U= X-Gm-Gg: AR+sD13TMuXH6HChQF40QDN1nOdh94804lFJliO6xl5EOD1h6OkIvkrxEVh/ZvAwQfO ztB3NqsgdjtR/T0KbueFPDHzytaRViRqgDNIQOMjCqtbVzmaqbgnF37mBlfjGdmBbyCnaEjzTaB BYox3BKPQyygccBRRprDEkNa2lLyI6OdWxsikwJtt7W+v30yzcFnfT9xPVougSstQ0DjOZUdOxD uUaXkAN0sg2xxrk2xu+rNWaBeYyXprEQhaulxfxIMS6qePiLkiO563elTZ2MGBFO7zE8seOlCwT KV8h1/ogjMJsWRknGVGUBjWgRXnmirR+QdTlzgyXzRXZAEvzeLiauHUWlyHBDrcNg/MadU7dl4n 8ZSQNTK23pXE7kIsE4lV51T5383HTyyssl1mO5Y3opc484eSQQi2NB2jW9z/53GnykFFTy4s3Ih LZEXYWA829KsaTphlevjsZuPpohMEytj2OJArEUTOzSSx8ZcpAW+itUdi0lrUObKcZykhS/3R10 Pzf3iBDngjJ3yzrAsn8W8ERMXMjq47oucPwEH2jCAJ4o2pYf2bqn3h3qz+/7l0= X-Received: by 2002:a05:600c:364a:b0:499:8156:cd3f with SMTP id 5b1f17b1804b1-499879533dcmr42065965e9.8.1786699196972; Fri, 14 Aug 2026 02:19:56 -0700 (PDT) Received: from localhost (p200300f65f017104e65cfeae4f257a65.dip0.t-ipconnect.de. [2003:f6:5f01:7104:e65c:feae:4f25:7a65]) by smtp.gmail.com with UTF8SMTPSA id 5b1f17b1804b1-499899afae3sm14329385e9.3.2026.08.14.02.19.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Aug 2026 02:19:56 -0700 (PDT) From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig=20=28The=20Capable=20Hub=29?= To: Greg Kroah-Hartman , Jiri Slaby Cc: Jonathan Corbet , Shuah Khan , Randy Dunlap , John Ogness , Crescent Hsieh , Fushuai Wang , Hugo Villeneuve , Karl Mehltretter , linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, linux-doc@vger.kernel.org, Geert Uytterhoeven , Andy Shevchenko Subject: [PATCH v3 3/7] serial: 8250: Make uart_match_port() a 8250 specific function Date: Fri, 14 Aug 2026 11:19:29 +0200 Message-ID: X-Mailer: git-send-email 2.55.0.11.g153666a7d9bb In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" X-Developer-Signature: v=1; a=openpgp-sha256; l=5044; i=u.kleine-koenig@baylibre.com; h=from:subject:message-id; bh=2sNSyeHwlo1iJxAfsdit9RrWvURm4tpiXcynTe0rlZI=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBqft2nVTAW4cKsaw0QBBZvU9e91i3V/p3V0GC55 arZnOgna3GJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCan7dpwAKCRCPgPtYfRL+ Thj7B/9R0tQWGSjjBZByxpMi7NiBJSakjzGXj4jea+eqhNG7C3opAdsLL+b+2UicscEZci0jEGv kKNTV6WaaH2156OkJ8keS7g50MnygGTz1fpV5Db+BrMbmZCTQp94x/PVJ3G5g5MZdwh5LeU1cU8 lSm34dZgHneMekiwcCjOs5oinRgmwxqzVuEykxi+7VhNk/30FWnZ7arQ3qrE3+t8vR6gT8Y7v2i tplP3N/VTdkdR0goRnD+nQAMxKPJBVhv3I02B9+WX4faCWOE+tRJa8vdOiAVHlIS+cbH/WRuxaH GcUyRU7j6rBLubwtXUC26AvEDCPlkv4dWYJ4C5jHz2Ci/VGu X-Developer-Key: i=u.kleine-koenig@baylibre.com; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 Content-Transfer-Encoding: quoted-printable The 8250 driver conglomerate is the only user of uart_match_port() and in fact it already is 8250 specific as it uses hub6_match_port() which is defined in drivers/tty/serial/8250/8250_hub6.c unless the dummy implementation is in use. Acked-by: Andy Shevchenko Signed-off-by: Uwe Kleine-K=C3=B6nig (The Capable Hub) --- Documentation/driver-api/serial/driver.rst | 2 +- drivers/tty/serial/8250/8250_core.c | 27 +++++++++++++++++++++- drivers/tty/serial/serial_core.c | 27 ---------------------- include/linux/serial_core.h | 2 -- 4 files changed, 27 insertions(+), 31 deletions(-) diff --git a/Documentation/driver-api/serial/driver.rst b/Documentation/dri= ver-api/serial/driver.rst index c1db6a1a67c4..975b0ba53e98 100644 --- a/Documentation/driver-api/serial/driver.rst +++ b/Documentation/driver-api/serial/driver.rst @@ -70,7 +70,7 @@ Other functions =20 .. kernel-doc:: drivers/tty/serial/serial_core.c :identifiers: uart_update_timeout uart_get_baud_rate uart_get_divisor - uart_match_port uart_write_wakeup uart_register_driver + uart_write_wakeup uart_register_driver uart_unregister_driver uart_suspend_port uart_resume_port uart_add_one_port uart_remove_one_port uart_console_write uart_parse_earlycon uart_parse_options uart_set_options diff --git a/drivers/tty/serial/8250/8250_core.c b/drivers/tty/serial/8250/= 8250_core.c index b875d394796f..d8199c583830 100644 --- a/drivers/tty/serial/8250/8250_core.c +++ b/drivers/tty/serial/8250/8250_core.c @@ -673,6 +673,31 @@ EXPORT_SYMBOL(serial8250_resume_port); */ static DEFINE_MUTEX(serial_mutex); =20 +/** + * serial8250_match_port - are the two ports equivalent? + * @port1: first port + * @port2: second port + * + * This utility function can be used to determine whether two uart_port + * structures describe the same port. + */ +static bool serial8250_match_port(const struct uart_port *port1, + const struct uart_port *port2) +{ + if (port1->iotype !=3D port2->iotype) + return false; + else if (port1->iotype =3D=3D UPIO_PORT) + return port1->iobase =3D=3D port2->iobase; + else if (port1->iotype =3D=3D UPIO_HUB6) + return hub6_match_port(port1, port2); + else if (uart_iotype_mmio(port1->iotype)) + return port1->mapbase =3D=3D port2->mapbase; + else if (port1->iotype =3D=3D UPIO_BUS) + return true; + else + return false; +} + static struct uart_8250_port *serial8250_find_match_or_unused(const struct= uart_port *port) { int i; @@ -681,7 +706,7 @@ static struct uart_8250_port *serial8250_find_match_or_= unused(const struct uart_ * First, find a port entry which matches. */ for (i =3D 0; i < nr_uarts; i++) - if (uart_match_port(&serial8250_ports[i].port, port)) + if (serial8250_match_port(&serial8250_ports[i].port, port)) return &serial8250_ports[i]; =20 /* try line number first if still available */ diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_c= ore.c index 95774b0f1484..ee75f53979bd 100644 --- a/drivers/tty/serial/serial_core.c +++ b/drivers/tty/serial/serial_core.c @@ -33,7 +33,6 @@ #include =20 #include "serial_base.h" -#include "8250/8250.h" /* For hub6_match_port() */ =20 /* * This is used to lock changes in serial line configuration. @@ -3233,32 +3232,6 @@ static void serial_core_remove_one_port(struct uart_= driver *drv, state->uart_port =3D NULL; } =20 -/** - * uart_match_port - are the two ports equivalent? - * @port1: first port - * @port2: second port - * - * This utility function can be used to determine whether two uart_port - * structures describe the same port. - */ -bool uart_match_port(const struct uart_port *port1, - const struct uart_port *port2) -{ - if (port1->iotype !=3D port2->iotype) - return false; - else if (port1->iotype =3D=3D UPIO_PORT) - return port1->iobase =3D=3D port2->iobase; - else if (port1->iotype =3D=3D UPIO_HUB6) - return hub6_match_port(port1, port2); - else if (uart_iotype_mmio(port1->iotype)) - return port1->mapbase =3D=3D port2->mapbase; - else if (port1->iotype =3D=3D UPIO_BUS) - return true; - else - return false; -} -EXPORT_SYMBOL(uart_match_port); - static struct serial_ctrl_device * serial_core_get_ctrl_dev(struct serial_port_device *port_dev) { diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h index 904760876ca8..4eeb8253752a 100644 --- a/include/linux/serial_core.h +++ b/include/linux/serial_core.h @@ -1140,8 +1140,6 @@ int uart_add_one_port(struct uart_driver *reg, struct= uart_port *port); void uart_remove_one_port(struct uart_driver *reg, struct uart_port *port); int uart_read_port_properties(struct uart_port *port); int uart_read_and_validate_port_properties(struct uart_port *port); -bool uart_match_port(const struct uart_port *port1, - const struct uart_port *port2); =20 /* * Power Management --=20 2.55.0.11.g153666a7d9bb From nobody Tue Sep 29 00:31:23 2026 Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 90D0445DF63 for ; Fri, 14 Aug 2026 09:20:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786699202; cv=none; b=KrxacrUtQoWEHxD6eQjIzfhPx73yzrH4FrNB+SmMXneFhjFZJ5t855oMJ+8ioUFX2zt5ynaYaRZ6IFTcS8WZr/52UIO9CEhuv0yd52SFexWmJbcEQNi+Z7AyZWBAwG8AwGK+FJOWgASQ3NyBWN9oKdoIOEJRvBvffdOyMCTx880= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786699202; c=relaxed/simple; bh=TQ2fAV07zoYNEgVpLO4kdUMaIC9Q2NtdaXJZiFWN6G4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=TljggRRGQdr2mNzUacQnM7JRDM0AZEvi+jhgqoWoMmXD6ia3FCARNrATHM1b41RzIVxNOhXltK4GEBl2K45mmgD7Bbi9VgMZJwnC/VTl3NJrT16ocYND9+MSxlcy+ZTiu7gOkpzNRULPShydktJdaTs+f0uDMqH5PON8XrvA75c= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre.com header.i=@baylibre.com header.b=cNCLbC+x; arc=none smtp.client-ip=209.85.128.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre.com header.i=@baylibre.com header.b="cNCLbC+x" Received: by mail-wm1-f54.google.com with SMTP id 5b1f17b1804b1-49954b88fffso9747195e9.0 for ; Fri, 14 Aug 2026 02:20:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre.com; s=google; t=1786699199; x=1787303999; darn=vger.kernel.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to:content-type; bh=prvetDAp1SQsL701LfHd3g6Dmr8EOWFJnI5IgqjID8s=; b=cNCLbC+xHAvf9tRAg3IUhyghxsq6NiGaxHWcPxUlplaNEwIvIe4t4YARXcRDDk0CZ6 YGMJhx0O3wBtsJTtEgxQG+3Dxn3n/E6ry6y0S9HOzfyNjKSmRnWfFQJei+ixYxDHiuSd lomGBd0mh08HNy15Gf63Qj5GrxNkxzbHvghKqGQMv1PxEHVq0H5pJ0kOd+jmC5bIwxMR ZrDu/XCsbTUMaSz3bK/H01+/YADeJmjQsOCsyl+ik3s5wvT3tf5CpKw/8PSx30neXnJG LBQrVL7AJrO4qaum7rRFaJw5MYWvlkLvtYkuV2yHFZOJdWDMyUHPzZADrx1uUKPdXAeH 7Y6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786699199; x=1787303999; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=prvetDAp1SQsL701LfHd3g6Dmr8EOWFJnI5IgqjID8s=; b=lhK0NiwFKlri8WFqwrETh/sI75pRCXWhw7ZqQ+kBGAexoRksh/VIDXC58kiBRpLFHD G9n3S/LT2panqeQHJ9b4URp53aiE8aOq3PoY4NQp2gB5XnVemxoNcRV6J1hc92/h7429 0iMGRuxygSBW/AfFnZCoIsAyJps4zbIkKYnFeH1pF0TqooQcU7k8codWY4Z488BYrqNp D95SWeSvUhQelrd55xMIoZXxlqrMXkFTFvSO96/b4ukcCwEeIy34wC7pmhyLdYNJINej zMOoZDbymnWs2j+HBK5aHGAu9GvnE6IrcvzIHTqIkbO6GOkOAPBryOvxTsjJEJJBmYxO 5+xQ== X-Forwarded-Encrypted: i=1; AHgh+RrBfC1saOlXv8+Z7Qp4V/AfHVb2uYzOwnnZOAmfOcMcZjuzrSJen1Bat+haUZ/ZuFUUIqf7NupkOh4LjRQ=@vger.kernel.org X-Gm-Message-State: AOJu0YwXgisPuy20nl1M+2ywu17iITm3h4rVrpOR0JJjVx6zYYxefKT9 cK6YksJrRiKzGdn/vX8DasKfOzFGBxV6NMt1ijb9zxqoOcYnm73cB9Ux8O2wLwT50SM= X-Gm-Gg: AR+sD10L/idyud0KzppPyW4XNtiGzEW4sz29DNtC8py1pzRLAvN3BSo1zeYid0SLqXa fXBIaSoLvaJ/9BjqdFno5Zof08IsVSyrZsoK6WernSRGnZ5wZlfkvVwfGtAWLdLqsujPKhYdPHu 9xbQM2/KpJ1+HgXFsBq1RSBIq+g/ibSK8R1pXlf+L7JVyRy2VBkB13shq0T112HYBYPQL6Rh9gu hi6JbVZVDqZgptG37XdWIRZ4naVQ4e5yIbNaacDpfSZfKUjOItipU81IJj2JguBjbhpwbhpAjZv H7pCXQbVg7it8gXvoBeXXYzQY8WPmFw1YKgkRdWt9+t1VSMoCEByWj+pwFXYXq45pyrnlICa6nV 8Xz3dtYTuN0+esVukA0cq13QeSWCZfCLNqotE92C4Bk0TllFuVVWiPi4UfJC8AiApvrV4Pdvo7M wj1aV8RkrvVNWyZjUXDCY/iSyJozN1KUquu8bbpfKyEuRUlR49L7n89ojWITdD/Ef4QK8OEsNne GKbUxbKWsumgWp8M/WKc0j+7c9I4OAUVDLDlgCfihUejaS30y+R X-Received: by 2002:a05:600c:1906:b0:499:8467:3f2d with SMTP id 5b1f17b1804b1-499879b611dmr47497955e9.19.1786699198380; Fri, 14 Aug 2026 02:19:58 -0700 (PDT) Received: from localhost (p200300f65f017104e65cfeae4f257a65.dip0.t-ipconnect.de. [2003:f6:5f01:7104:e65c:feae:4f25:7a65]) by smtp.gmail.com with UTF8SMTPSA id 5b1f17b1804b1-49988ae8b62sm36844295e9.5.2026.08.14.02.19.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Aug 2026 02:19:57 -0700 (PDT) From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig=20=28The=20Capable=20Hub=29?= To: Greg Kroah-Hartman , Jiri Slaby Cc: John Ogness , Fushuai Wang , Crescent Hsieh , linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, Geert Uytterhoeven , Hugo Villeneuve , Andy Shevchenko Subject: [PATCH v3 4/7] serial: 8250: Simplify serial8250_match_port() Date: Fri, 14 Aug 2026 11:19:30 +0200 Message-ID: <5723fc435061359f9f6206d20413276de7a659a4.1786697789.git.u.kleine-koenig@baylibre.com> X-Mailer: git-send-email 2.55.0.11.g153666a7d9bb In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" X-Developer-Signature: v=1; a=openpgp-sha256; l=1008; i=u.kleine-koenig@baylibre.com; h=from:subject:message-id; bh=TQ2fAV07zoYNEgVpLO4kdUMaIC9Q2NtdaXJZiFWN6G4=; b=kA0DAAoBj4D7WH0S/k4ByyZiAGp+3aqi3MiEBwktDey5S458qdGH55oxfyWa/ViWMpeGka8cK 4kBMwQAAQoAHRYhBD+BrGk6eh5Zia3+04+A+1h9Ev5OBQJqft2qAAoJEI+A+1h9Ev5OhSQH+wWQ f2zBwDlIPJbB6qX8ngnOQxzvfbkDAm7B1CjKMqVh/4suww926Y3XK1bCRrMPASyYyTH8qAIzR0j h0zYx2hW26Ybgf6GFMZAD1aL5ysOW2EYx80Hq6Defv4MS4pidI14vyfabUdjr9TiNucXr9x2o21 pe+b7eo0jhAkD2quYVB+Y+bHCK5XtLesENTR2wjx4I0tYX//kV0e7YD0t3/mmT7rVMV/Bm0pKjc xZRgV/MS2APIa3mahvyB66nvg/zHVSJAi+ot7tsqVMGxhTcf5Nl1RZTAWBzDSwSeSiaXqAxqP3q QbtP3DjpSPqMvNi3/iGE7Pu6zBTI6dfK7dxrAzY= X-Developer-Key: i=u.kleine-koenig@baylibre.com; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 Content-Transfer-Encoding: quoted-printable For 8250 devices .iotype is never UPIO_BUS, so drop the respective if branch. Suggested-by: Hugo Villeneuve Link: https://lore.kernel.org/linux-serial/20260803152228.9e3cd296a41e68304= b82a22a@hugovil.com Acked-by: Andy Shevchenko Signed-off-by: Uwe Kleine-K=C3=B6nig (The Capable Hub) --- drivers/tty/serial/8250/8250_core.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/tty/serial/8250/8250_core.c b/drivers/tty/serial/8250/= 8250_core.c index d8199c583830..11424fef7c08 100644 --- a/drivers/tty/serial/8250/8250_core.c +++ b/drivers/tty/serial/8250/8250_core.c @@ -692,8 +692,6 @@ static bool serial8250_match_port(const struct uart_por= t *port1, return hub6_match_port(port1, port2); else if (uart_iotype_mmio(port1->iotype)) return port1->mapbase =3D=3D port2->mapbase; - else if (port1->iotype =3D=3D UPIO_BUS) - return true; else return false; } --=20 2.55.0.11.g153666a7d9bb From nobody Tue Sep 29 00:31:23 2026 Received: from mail-wr1-f45.google.com (mail-wr1-f45.google.com [209.85.221.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9CFFF45FFBE for ; Fri, 14 Aug 2026 09:20:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786699204; cv=none; b=RCdj4hHhq5TchWc4+m1Ae2u169hw6kjsvx5YUb3E6zB4V+kTVVTHYVEU06C4Aqt1jLF6kFXbRs+Viq+xPsaP6O5btuDXJiMAUc1ajt3v1Ikq8HG5RT1xElfbqI/p1gZkLwCAi1TB8hxYuKkH75/H3tVvaVofj53aijO5cIlnuWQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786699204; c=relaxed/simple; bh=QTuOizhRHoClmZYTKOw9cEJ+rMnns4nYIgpLTQdaR04=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=AsstUAA5zSYxi9bABSjE8W/Yel9FdFlKwGIyzCWOfkm/RVkmijTOw8TBYb/lpDcuJafU2lNMhrpfkGQ2ldGULq+oSRcidGhIbprKtb/4WuhG5Hd6fwBgZ7L7YYcplSjDtfutxiziTTyjRK/84vIxjAUwIA6TBXDx8+XgsbLCxd0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre.com header.i=@baylibre.com header.b=Ptxzl5Fl; arc=none smtp.client-ip=209.85.221.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre.com header.i=@baylibre.com header.b="Ptxzl5Fl" Received: by mail-wr1-f45.google.com with SMTP id ffacd0b85a97d-47fe89fb333so442718f8f.3 for ; Fri, 14 Aug 2026 02:20:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre.com; s=google; t=1786699200; x=1787304000; darn=vger.kernel.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to:content-type; bh=VMzgJV+k3ROB9Sa1xAtrYA5khAOy2hOXI1Okgba0+eI=; b=Ptxzl5FluFa0XQJx2qSjnj/MtBtp+Oo3fwSOpPdYhHRXmzMlQwGYbrJ8lu18fHrKGY sowjnJSfQAcDIXd5zd/dK6IOWi+hFJOtwh1T5AsXGHoC49EsBQajVkmuO5qhJo+8t6s4 thUttEKLXTQ2NFnOU+Dc0mblGHaxVebSzmQNj5CmpKJyHhIORYk6wzGAQUdEdkiJWSTG SenjwGu2+RwCbwunsJYnFLrh0yInx7a2oCZBMfgaYHTbw6TYTKdpefKeMLq9wUpsCDAZ D4Nq2UgAl+rx8mDjyOb9Hac6DOVPAoI7yG50OpQUJnpYJDsoeEGBoVML0q0tlKMGFl+0 ejQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786699200; x=1787304000; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=VMzgJV+k3ROB9Sa1xAtrYA5khAOy2hOXI1Okgba0+eI=; b=gLoR+JCrpgTSagFHZ7xIkAMZqTCz28ZulUH/zNPZ3UHC1lzXyXf+u04RGUfFNO3X3W piYtHAL4IXWkBfVxI34j/a10BPtFS7QMFMglF4w580+z5Jhjm924kOvr+ZdjR5ar4yke 0TKzJQExDTNkDwgoZ6ZK4dkQXBWwCh5VpkTCT/r6oqSgh5+fFJ6QVW4GxVJfN9yU1MED ag4bsHzDCRnYgjVZS191ZR6VgbkbUfWb2OZXeolxiPD9+deRUpe1IgOso2kza4Lb8B/A 3R/MHwMuWTo23FfXoJLykuDCLnHU+w10NPvzvFTWxDtTENuGxOztTCsPGpknlqt4R6Oa 21xw== X-Forwarded-Encrypted: i=1; AHgh+RofsfNnbx1fjDA1LjGe7uqBeXMX9ZQlXFiCCNFsHSNFJIKKEmxlI98JoEvi6smmRq7w1RBMnXoS5Q/6TU4=@vger.kernel.org X-Gm-Message-State: AOJu0YxR6kl0MrelBxprJ3hC0hH5edHZVJt50TcBMFh/5Zz3iA2BiRWN Dg0bCeGDKx+QYnqnWWt2azm6V0L4TRAG4SPtfVwdFdKuK/iC5cDYScynle1DENLVzAA= X-Gm-Gg: AR+sD12PB14kT92DN0sOYLSa+CjS9KgZEHpSyguBOhR8EgS8+fdXABPNFu6ONd+anDJ wZcWfdE1DFL4M+aVvBYW3bgPou0lTeiN6dvcqQRqiABf6xOzVdDi1zjgrjXLFdeSNMoiTZ7N5BM OY3690a8UP1SPYmYatoL/+J3Vmo6XyqDx7zbXHJqDN4gYJJ0xScqKsc9YwpY+jSaXV5vtRrLX2d HlwCOgspssPqb/mvbn8Xyc3PQ/k5hiBCTrElTNWrSvnaLID9XtgKXYjorUdUVmweOigArSvcPjo 1wVYgMK6hQbobPHOdqa+bivoCNE+prHf5oGN024sZET+QnJJqNE9UELflC/iPM65qffsChLeCP3 SZyCsFxQxEkqOoXe86CXS4EbDTP8HT48D3aC3D0vXjOfrpEVbH+R6+Yv6Vaw+c3OXBpVG3PS7Qv f9f+WgeNZ81125OUrx/D0O4qgTZx7cWuRh7itRjBg9CR4n7Oqkin+S6t2HhQZkJiASw0Ux5XDZg /oXYn5s3F/70oAoWijUYTsaSBfYyfTo38j882SZU9DwnaMX8MNEAePmUSjfIhA= X-Received: by 2002:a05:6000:2588:b0:47f:97f6:d39a with SMTP id ffacd0b85a97d-48160799ccemr6466977f8f.17.1786699199787; Fri, 14 Aug 2026 02:19:59 -0700 (PDT) Received: from localhost (p200300f65f017104e65cfeae4f257a65.dip0.t-ipconnect.de. [2003:f6:5f01:7104:e65c:feae:4f25:7a65]) by smtp.gmail.com with UTF8SMTPSA id ffacd0b85a97d-4815f2cc811sm6432734f8f.33.2026.08.14.02.19.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Aug 2026 02:19:59 -0700 (PDT) From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig=20=28The=20Capable=20Hub=29?= To: Greg Kroah-Hartman , Jiri Slaby Cc: Andy Shevchenko , Hugo Villeneuve , =?utf-8?q?Ilpo_J=C3=A4rvinen?= , John Ogness , Abinash Singh , Rahul Bukte , Kees Cook , Randy Dunlap , Lukas Wunner , Gerhard Engleder , Rong Zhang , Binbin Zhou , Crescent Hsieh , Haowei Zheng , linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH v3 5/7] serial: 8250: Fix corner case for port matching Date: Fri, 14 Aug 2026 11:19:31 +0200 Message-ID: <9ad6983ae584ce9d962f2a841f4d5e90c2012ceb.1786697789.git.u.kleine-koenig@baylibre.com> X-Mailer: git-send-email 2.55.0.11.g153666a7d9bb In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" X-Developer-Signature: v=1; a=openpgp-sha256; l=4924; i=u.kleine-koenig@baylibre.com; h=from:subject:message-id; bh=QTuOizhRHoClmZYTKOw9cEJ+rMnns4nYIgpLTQdaR04=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBqft2swfFzcYUUx6vh4ZvnCzAFXvSsotLVerHa6 8+xt3TmiIaJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCan7drAAKCRCPgPtYfRL+ TqlWB/4gy/VvGhrzhpcWuR5oQLWBnFaVaIT0lz0/S6b85umczwGT0uN8lh+XDBsD4F+gcSa+EPn fxgDa/SU53riFERWU1lkBDioI3OYUgqfcuzmnQa2KhWDlk2cC8jUE3ZaxTGjc0mVx2whV5fFge/ SGPkHYxiTDSUI4Zb/D3wLkWKpF+l1+szklFJEh6ZgMPvg8nZbDVsAD46FVfve9h+ZT0LW7WJQlv u+Fpe37hLi2OJu40q91j80AKnSk5zr4CTVn8gBeePRPEf/1Z8TPPUtz9SVPYS/QLe9+bBYLAO19 KqMk5Vn8wnm9RUVKzkODWsCMNIDAOixDeNv4jcvvKHks/bkR X-Developer-Key: i=u.kleine-koenig@baylibre.com; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 Content-Transfer-Encoding: quoted-printable In the case CONFIG_SERIAL_8250=3Dy + CONFIG_SERIAL_8250_HUB6=3Dm hub6_match_port() evaluates statically to false in serial8250_match_port() which is a bug and a change in behavior compared to before commit 7ab80d1e7243 ("serial: 8250: fix compile error with hub6_match_port() when compiled as a module"). To make the comparison correct, the dummy implementation of hub6_match_port() must only be used if CONFIG_SERIAL_8250_HUB6 is disabled. Then as there is a bidirectional dependency between 8250_hub6.c and 8250_core.c, put both in the same module. Fixes: 7ab80d1e7243 ("serial: 8250: fix compile error with hub6_match_port(= ) when compiled as a module") Acked-by: Andy Shevchenko Signed-off-by: Uwe Kleine-K=C3=B6nig (The Capable Hub) --- drivers/tty/serial/8250/8250.h | 8 +++++++- drivers/tty/serial/8250/8250_hub6.c | 8 +------- drivers/tty/serial/8250/8250_platform.c | 4 ++++ drivers/tty/serial/8250/Kconfig | 4 ++-- drivers/tty/serial/8250/Makefile | 2 +- 5 files changed, 15 insertions(+), 11 deletions(-) diff --git a/drivers/tty/serial/8250/8250.h b/drivers/tty/serial/8250/8250.h index 9337fec9394e..3fd25b7a7b81 100644 --- a/drivers/tty/serial/8250/8250.h +++ b/drivers/tty/serial/8250/8250.h @@ -316,6 +316,12 @@ static inline int serial8250_pnp_init(void) { return 0= ; } static inline void serial8250_pnp_exit(void) { } #endif =20 +#ifdef CONFIG_SERIAL_8250_HUB6 +int serial8250_hub6_init(void); +#else +static inline int serial8250_hub6_init(void) { return 0; } +#endif + #ifdef CONFIG_SERIAL_8250_RSA void univ8250_rsa_support(struct uart_ops *ops, const struct uart_ops *cor= e_ops); void rsa_enable(struct uart_8250_port *up); @@ -336,7 +342,7 @@ int fintek_8250_probe(struct uart_8250_port *uart); static inline int fintek_8250_probe(struct uart_8250_port *uart) { return = 0; } #endif =20 -#if IS_REACHABLE(CONFIG_SERIAL_8250_HUB6) +#if IS_ENABLED(CONFIG_SERIAL_8250_HUB6) bool hub6_match_port(const struct uart_port *port1, const struct uart_port= *port2); #else static inline bool hub6_match_port(const struct uart_port *port1, const st= ruct uart_port *port2) diff --git a/drivers/tty/serial/8250/8250_hub6.c b/drivers/tty/serial/8250/= 8250_hub6.c index b6767633c966..3e548530ec4e 100644 --- a/drivers/tty/serial/8250/8250_hub6.c +++ b/drivers/tty/serial/8250/8250_hub6.c @@ -49,13 +49,7 @@ bool hub6_match_port(const struct uart_port *port1, cons= t struct uart_port *port } EXPORT_SYMBOL_GPL(hub6_match_port); =20 -static int __init hub6_init(void) +int __init serial8250_hub6_init(void) { return platform_device_register(&hub6_device); } - -module_init(hub6_init); - -MODULE_AUTHOR("Russell King"); -MODULE_DESCRIPTION("8250 serial probe module for Hub6 cards"); -MODULE_LICENSE("GPL"); diff --git a/drivers/tty/serial/8250/8250_platform.c b/drivers/tty/serial/8= 250/8250_platform.c index af946d12e764..3a2dff9ce7b7 100644 --- a/drivers/tty/serial/8250/8250_platform.c +++ b/drivers/tty/serial/8250/8250_platform.c @@ -319,6 +319,10 @@ static int __init serial8250_init(void) if (ret) goto unreg_uart_drv; =20 + ret =3D serial8250_hub6_init(); + if (ret) + goto unreg_pnp; + serial8250_isa_devs =3D platform_device_alloc("serial8250", PLAT8250_DEV_= LEGACY); if (!serial8250_isa_devs) { ret =3D -ENOMEM; diff --git a/drivers/tty/serial/8250/Kconfig b/drivers/tty/serial/8250/Kcon= fig index fa6f33303cb0..1d3f7e57e959 100644 --- a/drivers/tty/serial/8250/Kconfig +++ b/drivers/tty/serial/8250/Kconfig @@ -304,8 +304,8 @@ config SERIAL_8250_EXAR_ST16C554 will be called 8250_exar_st16c554. =20 config SERIAL_8250_HUB6 - tristate "Support Hub6 cards" - depends on SERIAL_8250 !=3D n && ISA && SERIAL_8250_MANY_PORTS + bool "Support Hub6 cards" + depends on SERIAL_8250_MANY_PORTS && ISA help Say Y here if you have a HUB6 serial board. =20 diff --git a/drivers/tty/serial/8250/Makefile b/drivers/tty/serial/8250/Mak= efile index 46adadcfe072..330dd6cf7c83 100644 --- a/drivers/tty/serial/8250/Makefile +++ b/drivers/tty/serial/8250/Makefile @@ -7,6 +7,7 @@ obj-$(CONFIG_SERIAL_8250) +=3D 8250.o 8250-y :=3D 8250_core.o 8250-y +=3D 8250_platform.o 8250-$(CONFIG_SERIAL_8250_PNP) +=3D 8250_pnp.o +8250-$(CONFIG_SERIAL_8250_HUB6) +=3D 8250_hub6.o =20 obj-$(CONFIG_SERIAL_8250) +=3D 8250_base.o 8250_base-y :=3D 8250_port.o @@ -35,7 +36,6 @@ obj-$(CONFIG_SERIAL_8250_EXAR_ST16C554) +=3D 8250_exar_st= 16c554.o obj-$(CONFIG_SERIAL_8250_FOURPORT) +=3D 8250_fourport.o obj-$(CONFIG_SERIAL_8250_FSL) +=3D 8250_fsl.o obj-$(CONFIG_SERIAL_8250_HP300) +=3D 8250_hp300.o -obj-$(CONFIG_SERIAL_8250_HUB6) +=3D 8250_hub6.o obj-$(CONFIG_SERIAL_8250_INGENIC) +=3D 8250_ingenic.o obj-$(CONFIG_SERIAL_8250_IOC3) +=3D 8250_ioc3.o obj-$(CONFIG_SERIAL_8250_KEBA) +=3D 8250_keba.o --=20 2.55.0.11.g153666a7d9bb From nobody Tue Sep 29 00:31:23 2026 Received: from mail-wr1-f54.google.com (mail-wr1-f54.google.com [209.85.221.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 018B045C6F7 for ; Fri, 14 Aug 2026 09:20:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786699204; cv=none; b=tgJvr2Td80HfNJUDMXTGwnAmkS2/5aliQa2RPiY483IJ/q5Rqv/LoPthafScuBaIo31wkwaGai6QBDtq4G6mlm2N3jYBmD7ZTbGyYlUZwXUwqp0SaXGx51XQWqMI/YB138L69BDKEY4kLICcIBNzuXfHP7tFzK9H8GhRWRRhHag= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786699204; c=relaxed/simple; bh=6P8MPEPf/cBvWOJG5iAtcz4MIxJaCtBUcbTcKXStiIg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=CzlLfn0sns7Cx0DAE5ErcG3pwwXYC7mfRz8nrIJka7KrSzD29S9t9KONIAXTZopu3UYX4w8kc0Af3Le1kbRvtZ/e0WAtjb3GZHsWEAD8L/XCMNJL8NxlEu2VGMm6Y69KLigmXJXK+Ex/JSC3zUjUx9G28zY0Rcu6w73ji9txDqQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre.com header.i=@baylibre.com header.b=Yv6MRn/j; arc=none smtp.client-ip=209.85.221.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre.com header.i=@baylibre.com header.b="Yv6MRn/j" Received: by mail-wr1-f54.google.com with SMTP id ffacd0b85a97d-480033bdcf4so438900f8f.2 for ; Fri, 14 Aug 2026 02:20:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre.com; s=google; t=1786699201; x=1787304001; darn=vger.kernel.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to:content-type; bh=lmQn0kgJJZu42pOWlBVe9VCRdEn4YGhm8ifFpJVQMus=; b=Yv6MRn/jgyVBlO/ik+YanS/behjgGAPh7Na9xE+Hvx21a0nv576W4z3IieCub93aB5 kMnemyqcyoWBKvJgF/puan3m/lp+kR95YzTakwmHjcYoBfIV8YEtX9atxZ2HJhShMKrF C1DSbFz/YhD/kNk3YcknsqKCsZ+r42BTuodcFWYFDxw5G77AmQOIP3/cSA+SaniwhgNy Mttjt9Ot5lWICuQYhHj+muAqQfpQTh6+q1V5l7JUozjmBH9eafHD4tkq4Wd5j+Z6qtfL 1g8Q9x3kDkNxVFBj+9OmBeOrQ2GfYn6bz3rW3nDF0+IFNkts5tb6P9hu5vocViECe/RK BmRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786699201; x=1787304001; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=lmQn0kgJJZu42pOWlBVe9VCRdEn4YGhm8ifFpJVQMus=; b=cmR/OtYo5y2ccvW/j1Xgdw4RFbAOdIR2YhfiAEZwEzZGPG/C/WeOBVSyytSv9cYwhS L66vWhHGnTNEGKxHOovZGcmA3XgoCX7yYtDtMpSgGzNqIctCQYH8xHGyTHXcqeBO5gjz zNlRdrTyVGhQHh0Y+BL3lGii8Dc5S1474uvrT47ZI3n7cK/2SZ/OykqO8k99fglYx3Tt Hkn54AypIc6CatRcAso+BA78FRLcYLTx7gGDP6dAnnjCESH7t1P378dEictyrBX0/Pg6 3st4JlhdFrqvRVvdLScKwR0k3FKzS6G6kfkOcfk+M7YlB7SfA1lvixVRqtrInvWnola7 uOgg== X-Forwarded-Encrypted: i=1; AHgh+RrZ5HjkXp/uWmGERbyjkiXONSfmW1qM4s0Wr11Y1Lefx5fcKoTOF00xokuzOA0H+LB5140z6Q+BIvP/aHA=@vger.kernel.org X-Gm-Message-State: AOJu0YwYEhJJ8fueQpTG+Al50tEigqpVT2kC0PlzoLPEgSStrqwExsVr lORHe0QsRnJoL0hYLw+5K6dNvZYx7y0e6RbbHMaRGuyOnzoIiC/imW0khs7Qz4l4tOo= X-Gm-Gg: AR+sD13FdUXdr1rIjUq5FQGvyhFc6pT3z/OpUqbebX8/vjGrstCsAucmj7tIRViU6dc IT7c1Ol6yCm8vAY1oAGH4HZ7sfy8LHgN/gCnLG97dle3AX6bAaZJw/gAbHeH7pPInRgpDgbtats QnHQJP7zZQlqg9fiDsONrK0/lSQU42Rilu6FBHXIKxZo9zLqE5bSk2Hm2mCOy/wZh5HlfrrhP69 33pfknsiC00pLZCAewi3ei23v8rkPdxF0gpFEtjzfDsDPO80ZRRVFTY6lXEJIe1ZtlGKkwPDxZ5 RBU7VusI2hGsSx5FRxQRGnqj7OMkJd6Lj6olyO68o7TxfzBaNZgacbUSxm7XeQDc2QJQmXS/RLY gczupqm/w1TsCwjI3aCX0LzciM7X3ePxF7Na/tQGM1zK7osMTxCHlaAkiI4xsEhreAe4oO7mMdb 9uaAy/76ZEcCJq1dIwO2VKs+4bP/Qrl8WGkkD/ele9NgH+Gg6SbiCHCIi7tvLZX6P4hz/4EcvlE QVBW7lgjp6JIHLiGpcerRzu7aKRJOx+r5hvpKxag+oUK0UOWy/I X-Received: by 2002:a5d:5f56:0:b0:481:5167:a9a4 with SMTP id ffacd0b85a97d-4816071c181mr6677214f8f.7.1786699201165; Fri, 14 Aug 2026 02:20:01 -0700 (PDT) Received: from localhost (p200300f65f017104e65cfeae4f257a65.dip0.t-ipconnect.de. [2003:f6:5f01:7104:e65c:feae:4f25:7a65]) by smtp.gmail.com with UTF8SMTPSA id ffacd0b85a97d-4815f219e12sm5937562f8f.10.2026.08.14.02.20.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Aug 2026 02:20:00 -0700 (PDT) From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig=20=28The=20Capable=20Hub=29?= To: Greg Kroah-Hartman , Jiri Slaby Cc: Andy Shevchenko , Hugo Villeneuve , =?utf-8?q?Ilpo_J=C3=A4rvinen?= , John Ogness , Abinash Singh , Rahul Bukte , Kees Cook , Russell King , linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH v3 6/7] serial: 8250: hub6: Add cleanup code Date: Fri, 14 Aug 2026 11:19:32 +0200 Message-ID: <4f1903ff2907f3e8bbabce345f628771e0bbd4e1.1786697789.git.u.kleine-koenig@baylibre.com> X-Mailer: git-send-email 2.55.0.11.g153666a7d9bb In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" X-Developer-Signature: v=1; a=openpgp-sha256; l=2554; i=u.kleine-koenig@baylibre.com; h=from:subject:message-id; bh=6P8MPEPf/cBvWOJG5iAtcz4MIxJaCtBUcbTcKXStiIg=; b=owGbwMvMwMXY3/A7olbonx/jabUkhqy6u+ujfhz5/eZVYrPdpbZy5dvWhhPcgxjvZauZXe7dW Sb8/vbtTkZjFgZGLgZZMUUW+8Y1mVZVcpGda/9dhhnEygQyhYGLUwAmovCM/Q9/UYBR4rm4pqVB K/wT1XQTyqYJ++ofFvrUUtDuZbAoZYOOvV5kWwljd/zdQ4zz21OtyuRKzjJn9exPiwgpCl/YruI Y2RQ3a24to8urvCOCtR4hT776Pl2107ipYmXTmsf56YvTump3rtwfb+6ZJtGxw2LKW/UFsxXY5F KlfnHoNgY+lawL+y6Vu8lU+DH3vuf3Zl45J7OtLGC6lffCshMV/39oZYvXVRpl/AmQTLF7EWt1Z PK+SLPIVVubW7UnlzDmHP0xebaN/BkZhVO35G32Jh1P+7jM/uXJhpMu+jlnFM5lN72ew3+yIW7K +0VnWju1lRrFZ2lO28D3/IJizOblRW5sikFh0antSfsB X-Developer-Key: i=u.kleine-koenig@baylibre.com; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 Content-Transfer-Encoding: quoted-printable At module load time a platform device is registered. That should be undone when the module is unloaded. Fixes: ec9f47cd6a14 ("[PATCH] Serial: Split 8250 port table") Acked-by: Andy Shevchenko Signed-off-by: Uwe Kleine-K=C3=B6nig (The Capable Hub) --- drivers/tty/serial/8250/8250.h | 2 ++ drivers/tty/serial/8250/8250_hub6.c | 5 +++++ drivers/tty/serial/8250/8250_platform.c | 5 ++++- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/tty/serial/8250/8250.h b/drivers/tty/serial/8250/8250.h index 3fd25b7a7b81..f197db78c60c 100644 --- a/drivers/tty/serial/8250/8250.h +++ b/drivers/tty/serial/8250/8250.h @@ -318,8 +318,10 @@ static inline void serial8250_pnp_exit(void) { } =20 #ifdef CONFIG_SERIAL_8250_HUB6 int serial8250_hub6_init(void); +void serial8250_hub6_exit(void); #else static inline int serial8250_hub6_init(void) { return 0; } +static inline void serial8250_hub6_exit(void) { } #endif =20 #ifdef CONFIG_SERIAL_8250_RSA diff --git a/drivers/tty/serial/8250/8250_hub6.c b/drivers/tty/serial/8250/= 8250_hub6.c index 3e548530ec4e..4d4c54c951cb 100644 --- a/drivers/tty/serial/8250/8250_hub6.c +++ b/drivers/tty/serial/8250/8250_hub6.c @@ -53,3 +53,8 @@ int __init serial8250_hub6_init(void) { return platform_device_register(&hub6_device); } + +void __init_or_module serial8250_hub6_exit(void) +{ + platform_device_unregister(&hub6_device); +} diff --git a/drivers/tty/serial/8250/8250_platform.c b/drivers/tty/serial/8= 250/8250_platform.c index 3a2dff9ce7b7..0570366a71d0 100644 --- a/drivers/tty/serial/8250/8250_platform.c +++ b/drivers/tty/serial/8250/8250_platform.c @@ -326,7 +326,7 @@ static int __init serial8250_init(void) serial8250_isa_devs =3D platform_device_alloc("serial8250", PLAT8250_DEV_= LEGACY); if (!serial8250_isa_devs) { ret =3D -ENOMEM; - goto unreg_pnp; + goto unreg_hub6; } =20 ret =3D platform_device_add(serial8250_isa_devs); @@ -342,6 +342,8 @@ static int __init serial8250_init(void) platform_device_del(serial8250_isa_devs); put_dev: platform_device_put(serial8250_isa_devs); +unreg_hub6: + serial8250_hub6_exit(); unreg_pnp: serial8250_pnp_exit(); unreg_uart_drv: @@ -369,6 +371,7 @@ static void __exit serial8250_exit(void) platform_driver_unregister(&serial8250_isa_driver); platform_device_unregister(isa_dev); =20 + serial8250_hub6_exit(); serial8250_pnp_exit(); =20 #ifdef CONFIG_SPARC --=20 2.55.0.11.g153666a7d9bb From nobody Tue Sep 29 00:31:23 2026 Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C6D7C463B70 for ; Fri, 14 Aug 2026 09:20:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786699207; cv=none; b=JxVW1DDfPz1PvGdixh/5v9P97MfzuCGRs/WBm1EVR+yGAqvAbZHrfIIdro6VrH+QnnVmtok4jcFlYBxtRq+rWEQIevHjqIHwrduVMEv7j4KvQIOS+87shoMoSGl6bDNMeUkhgauK9k/wD93IeyYdD32854P2r8eIspW737e+q+U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786699207; c=relaxed/simple; bh=7BtFn6FyDnHzVGZovCy5KcaiOnDY+M4o0HFfzl14hSk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=COMCVEAzh9x8/UMJf/vyGTjViUm5nzeapAN/F4Vd6tOOGQbMAvTQ1w/X0wxXEx8Pb5mnOUiXLK916HnO2txfHndu0r/wBLBcxAiESETTPxz+TApjtK/Nu0BPLiuCpJ60wbumqDpRZ07vRt/lrL57Bn/P6MPwobz3zOyIOiB3avg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre.com header.i=@baylibre.com header.b=lPoiOyu0; arc=none smtp.client-ip=209.85.128.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre.com header.i=@baylibre.com header.b="lPoiOyu0" Received: by mail-wm1-f49.google.com with SMTP id 5b1f17b1804b1-4954a2e73a9so5761765e9.3 for ; Fri, 14 Aug 2026 02:20:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre.com; s=google; t=1786699203; x=1787304003; darn=vger.kernel.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to:content-type; bh=yRCd4sQSxi4fAf0Ym6TjKMG0TipxAR6pT/43UC1Xlc0=; b=lPoiOyu0RMbyz5+Z2GjKKOEE9yJd4kKAzxDzNBJhHk9X089C9X/+vSBKJtt6JUVx3M QcMquu7nchpe0EanOVvD3XeybgjnXZ0HDrjuClBPLjOv3caoUaUamHnjJKveRoEsesBD iZtM/x1cSekBh4Wy6zBxrKpcMsTD18XCdzzyGpWFqt1de+00wZ4COTwm5TpVEAnQlPxi wJJ/hAsnhki2Um3OtHLUOz5usdSFfDnfpbb6/OL6j1u/oZHxogbIwTNjNVh0IHdEmVMR kDdMlLhIb/x6Bvfm8IdiDRvr8Dbs1kVtTngLJEyS/FDRMaROnh+4JvdYD3+wnh8FXJDD O4gQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786699203; x=1787304003; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=yRCd4sQSxi4fAf0Ym6TjKMG0TipxAR6pT/43UC1Xlc0=; b=ShTM9MR5Y1umPfJeccM+LfbnBuS6Z6hecAYr1ybgKPWqkKlOw5T4bvQIzP+obwkb+g hQZBUxwhyangPtqg3sqCuYgufkzv/hFZXtebxKkFktX6TPmBTZFWip37jpVULwMhHiu6 H10sU0+Mr8Ch8Tnq4+QEkCybwEGZboTNY/AYFvvVyD9dTTCbpRuTUpuZZlG630DZ/oP1 feeuhvH693Aj1et9EOd2ko1UVVL18dgfraYUoGaZwuQLdXhuw3FK9MkU0vJq6Z8Fbqck PydAqc88VmguGSJedBl/qvgI6vOEvRm1U8SgAP5/dZNdqXxMq6uDAYBua/I1Syn3aFfo eigQ== X-Forwarded-Encrypted: i=1; AHgh+RrqGsUJ1L2wij16o6SdIufVacUI5fI+5Osza0VCWbPXJxE3WnhWcZXRYBuY+5RU9lOfipxvmEwonDS2JhQ=@vger.kernel.org X-Gm-Message-State: AOJu0Yy7L3jrg7dB1yD/uMWQtAFdUkH4Bz1sb6MOAGMJ8li74DdJk5lm l+CdkzwWgPfUdalFw6mMcg7Ptt7jPlmLj1pVIlfPhcYWpt0eeD+AcYE1uB2CUBieosQ= X-Gm-Gg: AR+sD12CIqVfx54qIPaO2YMd/A0kmpOahvv7Nn333jnQJFux5e/GaarcZuVOEpd2r/D qtLrtlRkxSCz4OGShgRBQ++CR1GX42hsgaEialq5WW7J4pveFuC3l9CdFdHe4E+D/7WeQuyBLir bU0c19J3CZiTc2HMG4+nmEOWo/d0k/ByJHfwkRH5tswdM9Ubs842GP+xODxsAY4t+0orRs4jo+1 HrU+QdnxZ+9MQRzZCkae7YUeBanhpIWf4kGe1t+5EsXgnUsrWXYWTK18WlphvRp/avM+QEj56ic oi0znz5vZHPbofGMF8scsEv6DubWuMbKhrCu7o9csO1dVLj8PgqA5kd+pyc0/sOECF2VLr1gD+m pY2A8dMVngtmcP8c+Q5Phmn4wIq+GQmX6yaIkZyFSSDFSsp+neoqIMWGQSI4L7nVDsHAAIqKmHh 6q+ViT07CKDm7ADPTICyyM1DbfIJNE9oDVDKGo3T4H/UVISKjAP/ue4GLSGJkiY9gWZxrT/8UvI s1q2B6yYnOZo+IYcEnBlLBzAsRsE+82se+r4IAbEuftn9WvY3z2 X-Received: by 2002:a05:600c:364a:b0:499:8156:cd3f with SMTP id 5b1f17b1804b1-499879533dcmr42073375e9.8.1786699202739; Fri, 14 Aug 2026 02:20:02 -0700 (PDT) Received: from localhost (p200300f65f017104e65cfeae4f257a65.dip0.t-ipconnect.de. [2003:f6:5f01:7104:e65c:feae:4f25:7a65]) by smtp.gmail.com with UTF8SMTPSA id 5b1f17b1804b1-49989af26eesm14204495e9.15.2026.08.14.02.20.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Aug 2026 02:20:02 -0700 (PDT) From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig=20=28The=20Capable=20Hub=29?= To: Greg Kroah-Hartman , Jiri Slaby Cc: Andy Shevchenko , Rahul Bukte , linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH v3 7/7] serial: 8250: pnp: Annotate init and exit functions for conditional discarding Date: Fri, 14 Aug 2026 11:19:33 +0200 Message-ID: <15308b3e517a9d7894d1dd1a1ad7163e78bb5929.1786697789.git.u.kleine-koenig@baylibre.com> X-Mailer: git-send-email 2.55.0.11.g153666a7d9bb In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" X-Developer-Signature: v=1; a=openpgp-sha256; l=1130; i=u.kleine-koenig@baylibre.com; h=from:subject:message-id; bh=7BtFn6FyDnHzVGZovCy5KcaiOnDY+M4o0HFfzl14hSk=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBqft2yS57GZTnG04Lm83pscpEo0KMl6Tvh2h99h gB4A5VLEKSJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCan7dsgAKCRCPgPtYfRL+ TrO5B/4kc0QRP287fyEHUG/Gcu2BmYwwkXtqTwbPsWdEylGXwozSdPgiv5Zzn2NvuDDAmTJXeaE docfQtkW5J9P02lWuejIiQkLZQr9OVEZ7ZvqBbUDz9N0SXB1aye34siHguN+0LU62rnLIgXCG80 1vBSd9S0AV74MklekyK4RQD5JIDc/K4EV9guopVzdscy31klgwW1hZZ+bKmi2QmrGTCAX1ivQ2m 8jBkP7ecDrKR/SEZFqNWr9VjOKj4fGiHt0+VYOq9v6LPc7YbdXS4DE7hq7wjQXLauxCO2UwAESo gSKqq6llsDARSJp30QR+8YGpe/P1f8yyOzdWfg8sZxCAY9j/ X-Developer-Key: i=u.kleine-koenig@baylibre.com; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 Content-Transfer-Encoding: quoted-printable serial8250_pnp_init() is only called from serial8250_init() which is marked with __init, so the pnp init function can also get the same marking. serial8250_pnp_exit() is only called from __init and __exit code, so __init_or_module is appropriate for that. Acked-by: Andy Shevchenko Signed-off-by: Uwe Kleine-K=C3=B6nig (The Capable Hub) --- drivers/tty/serial/8250/8250_pnp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/tty/serial/8250/8250_pnp.c b/drivers/tty/serial/8250/8= 250_pnp.c index 6bfdeff5fe22..7decf62400ab 100644 --- a/drivers/tty/serial/8250/8250_pnp.c +++ b/drivers/tty/serial/8250/8250_pnp.c @@ -526,12 +526,12 @@ static struct pnp_driver serial_pnp_driver =3D { .id_table =3D pnp_dev_table, }; =20 -int serial8250_pnp_init(void) +int __init serial8250_pnp_init(void) { return pnp_register_driver(&serial_pnp_driver); } =20 -void serial8250_pnp_exit(void) +void __init_or_module serial8250_pnp_exit(void) { pnp_unregister_driver(&serial_pnp_driver); } --=20 2.55.0.11.g153666a7d9bb