From nobody Fri Oct 2 06:57:57 2026 Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) (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 C94C3442FB1 for ; Tue, 4 Aug 2026 08:58:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785833909; cv=none; b=NpYQ3RNe2u3Psffr2VbVahooHMgLnoAax0K0UZ69iob+uaMYIrJs7Lfcsr0BIGJU1Ug/an0EiCJYernbol9Lu/i/qCJE444BFt+/QEemKOEX1Z37YysVfJGrdHlgJaXEwUQ864gU4Haov9Q9SJVt+dXEpgZYQWvtRSAGu20WaeQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785833909; c=relaxed/simple; bh=71axuqcdIWYyzTSqeq7Ho6eKIQvZa/VH/yJAtF1pi4Y=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=NnqggI2du74pw239lrEuTqk4WDNXZTmDQZCwChT9lbHciGicahAmUVvO91KeUE+SYufLiu8x3hwwbWJlvg4OvaS4rToUBozoPAbsWFGRjMJKwPRNEU7wIbmL62awCqR+dNri5FQ+m2UsICsJL4k2eh9Qoy97olSr8OhXbJ9rmdE= 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=grUTPq8S; arc=none smtp.client-ip=209.85.128.47 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="grUTPq8S" Received: by mail-wm1-f47.google.com with SMTP id 5b1f17b1804b1-4954aff6088so26707855e9.3 for ; Tue, 04 Aug 2026 01:58:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre.com; s=google; t=1785833906; x=1786438706; 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=qZlncH+fc7Qjn+MG/IiL0HUtec9ZDNYqZDynW85gEes=; b=grUTPq8SXzE0DSQkMMfjkwqLWgrPiDNCySqTCAHGEX664eP/rIpQJXUrHJ6dxFPWLc t/uvZlsyaMvE5XckmIhwj17ClVhbuhKN7Sqsr+OpEcnNVOW3XmBTTWnpidD7+jAzy6hn vvjo29Q/YkHjk6lqgSciq9trLyCs/Br3jH65j8hkYQuUFxE00VMCDaF0glTD694hJuVK qKrbwAZXCzedLCUSA7CL9FibQ/oZBXG9HfxxtBcH7dWf06Qww+MnDQ7uZpR+/xw3Sg05 5ExJ1OP+k1xDCH/Wm/mufq2OkI3wvpq7Z5+2eQxVYCoCVjMO/bYBqu6avgxwHK/3udpB hhkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785833906; x=1786438706; 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=qZlncH+fc7Qjn+MG/IiL0HUtec9ZDNYqZDynW85gEes=; b=Hydt6ZEIePksF6mJsxaAPhkzZZIVfsr9eiSILwEWQS0YR8GMoXfUNUF+a0fet0cSHk KYDMVZZo19vKdML7r6+TzvC2ko536RwDz4LXp3GYkp72HsusEamsDoK2fUjBbwkruIq0 3QW79l//Irutw2vmACmuBZ++tnkzWQMuW9UR7Apr50vD29RxaJ+u+NhI1WxyiEAESUUd z7jNsaiApWPQQi4F1FdPBiKLttEsHj3NWtLeNNWQnJ4ksuVHcOdSBFXVmio4tWk7hsIf OzCYY4wMrKwVKTF/z0wbFicGvOsp8gpCs/5MszHQhXlIXs64k0KwQwF2i2bAJnJTKVrc M12w== X-Forwarded-Encrypted: i=1; AHgh+Rpb49se08er8HGLTUtkNg63X0A72wA0f5613i6jKgd7DSCactapADjPHBcO3VzD4u0EUOUgpgMmWVZOOiI=@vger.kernel.org X-Gm-Message-State: AOJu0YynZ2zedooqGZckf+WlyA/inchhD+FelTpFNSEZJU2N3GdHv3Lq YKDICSht+23aaxaPkMWEWwwqIJ2qdztyJ4DqlP80PXg/8W+2pmJLjQmde/sa6KpXY7c= X-Gm-Gg: AR+sD12/KUGNb73A3xESb2qey9ZQ0jw2U0+SD61wrvoZLAF08wiqIQP6HL3b/NEU1gg izdVUdEwaPTCc4us/i7Uw0wgK+ElYyO6wqYd6x+nntm/ou5e035KTmWx+xOxwcTRdI367cSeii6 7xA5pDdH1f7O0QRtX8O4xFPzbTbirQRBvTTh0q9iJtCpp9dhooLTbnV81qmUpMGj5ZTXFR9/iRx U+osEaK2PdmyhInVH9hnRj7JJHEpIPCZQpIJXcJAFXYuN2x6hEr+PwByBNg9d61KWX8BX0oCFIh KHH3GfY3Jj+Ho3/T9AH6tuapUWNrfOQVTxVNCJt1uuJWblZxRnqHUkUfVqDtw5ALHXqUy3h9Liq /Cl6MWXB5lQOcJjV4/y9rFl8q+5zNhyDucblkSsos9s47NH93giuiK//u5JPxqlRI51NgqzyeqG ARLgLosrJwF8MCWsHk+5bYsjrmRj9GnzhDrzQZEzcsZG2WNzJ7zxwcEzasS8z8H/ryLcTb6dwTe 6kCjQToWwV733BWxeLcBULmH9y8D46DYW3wQOf+URmzL4rdia2ZRxuE3POTrSY= X-Received: by 2002:a05:600c:19cf:b0:496:bbce:fd with SMTP id 5b1f17b1804b1-4980c66c73amr312828585e9.6.1785833905661; Tue, 04 Aug 2026 01:58:25 -0700 (PDT) Received: from localhost (p200300f65f01710496a76592f11363a3.dip0.t-ipconnect.de. [2003:f6:5f01:7104:96a7:6592:f113:63a3]) by smtp.gmail.com with UTF8SMTPSA id 5b1f17b1804b1-49949fe2f4fsm80024315e9.10.2026.08.04.01.58.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Aug 2026 01:58:25 -0700 (PDT) From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig=20=28The=20Capable=20Hub=29?= To: Greg Kroah-Hartman , Jiri Slaby Cc: Hugo Villeneuve , John Ogness , Alan Cox , Atsushi Nemoto , linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org Subject: [PATCH v2 1/8] serial: txx9: Drop noop probe function and dangerous remove callback Date: Tue, 4 Aug 2026 10:57:53 +0200 Message-ID: <2165469758f26f79c0267386bc6cd92379fb0e2c.1785832297.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=3747; i=u.kleine-koenig@baylibre.com; h=from:subject:message-id; bh=71axuqcdIWYyzTSqeq7Ho6eKIQvZa/VH/yJAtF1pi4Y=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBqcamUBn9d6xxzHZR29Wzep6BwAsgONGRDSv6dv JzcS96Gb1GJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCanGplAAKCRCPgPtYfRL+ TtrSB/9HfkwZiuuKjzYm3o4SLkH6gd+MsJayTzE3p/ymmYqLKJMLN87mxU4USYadZWhBt+zQzRz WmlxDjLM+sJ16dteRlyIY6RReOr1VK+OvW4VrU0dxmD9LCgot1HbWKUcuCFaoL54DhIF3rFpqVz vdFBemEc7Vjq3xEspLiIR5vb9CdF2qs0SueY3HVoN9DuTY47qlUQuqmgXydOwIttpeXBdP3ZWpV fr7MmJvnbFQ4/kCYQTPbb6F+gB4LpJCAA0m+6fwKSvXj6fKR9Y5gLQMPuM5hig59vETVDMH+JTg yBC/3svog1Bff0WAz69VSWfufwnVIMdkyPY5jbB6V3N73y8J 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") Signed-off-by: Uwe Kleine-K=C3=B6nig (The Capable Hub) Acked-by: Andy Shevchenko Reviewed-by: Atsushi Nemoto Tested-by: Geert Uytterhoeven --- 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 Fri Oct 2 06:57:57 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 D1305446823 for ; Tue, 4 Aug 2026 08:58:28 +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=1785833910; cv=none; b=d6+Wcr+FEGTnUKv9qFjtsqIGZNKzYsBjfsLvYGaNUBvFmC4Nz3l5xC5OovtmFRz29L1FqJpsocUj3VysDLdnk+ZtEkEQJ2dThfvY9FRKY3fAXG38kklY+ND+c6EHmPVcwYsDj0PIlqxvJseZSfofhzzQ2OkSPK5B/cRb9bz74wo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785833910; c=relaxed/simple; bh=gk6JcyJKTdGD6/CklPk8oD3ZXcxR4v8iNyYK3AygeO0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=W/p7/qb5f9DsXuGemjJko4Mla0h8U909+Y6TZ0t2G5iJPYIwtCY4a65qpVmGMEcEARFPjyzkpUs6OFGOldxjbkoKLgCVLdQD3GECwjoK6s4/jInAoSbLiArfkmP5ESgsXeJXgC+n7iMbuPPoIfnnI0R1YpZyYYhHND21+2COa1Q= 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=gOG3vMqr; 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="gOG3vMqr" Received: by mail-wm1-f49.google.com with SMTP id 5b1f17b1804b1-4954df200ddso19728715e9.0 for ; Tue, 04 Aug 2026 01:58:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre.com; s=google; t=1785833907; x=1786438707; 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=92DZp8Jau+VN4V5EfNugjZTHDMsoIzvzLmLfhOU2IAs=; b=gOG3vMqr9FQzw85olRyy42Ok5ak5kP0Awls7rNdctN+LxE14/I7BN603jMw9T6f1U4 VfplqLWcMzWKJwBwvBn7CVuQMgnQAY8wkTdF3Bfuj1yTGlJInmC7Jdo6qV/jNSLqA//W dQ1eUOUeRCleC1X02GNU4MLLqfXWcUN7Fl1JFeBy/1NmdOMdzwR+glW/b9XsB+3rhBjf SytuvdNWyH8ttjzHVdGTx92HciFXfXKo69ky5ysqUCDjBwOrNcEfPbr7jA1vL500pJfk b6tXSvzNqtvhfgSTya0uLiIYJwVBjXiXJnu+XxegkkieV2hK963gsOkd6uH5p8bmBYRL pW1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785833907; x=1786438707; 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=92DZp8Jau+VN4V5EfNugjZTHDMsoIzvzLmLfhOU2IAs=; b=fkyMkkGIL4ipdRgbc7lxDEBQ4d9B+hy+8t6HXNrFEMrWxBRgz16/vVZ/ysTJOAKGka sG6XJjN/Huhz6gyiNOJVBaIEhFIym7IUbjUxMMs0zNY0ushOiy7n/Y/LtIU+n87PicJs g5IQJdhQYlLGIH+V2OnUA2RN4uiUwbQOppqbfqIsGM+fRPR3JzFrxO6Pn0bCDelCu/Az ERCjs+MFLAi+QI355c/PG8DHvnpVR1n0sIceMf5dgO/+HT+t80r7nQvul8rKfMpAbQ3K fwXctlamn2FbUdaISfVzMzvXzL/lR9JRxbsuitldENOPXD/MTqVr1a4uAyuT7Y+LoF6L 8LOA== X-Forwarded-Encrypted: i=1; AHgh+RqHbrCZo5zYplOuNVpnAKu82taToGzqTuH5zaWtw/5FFjZ4n/0AtV0K5cT5NRnDNSlNoEi5W6Fvoy81Fv4=@vger.kernel.org X-Gm-Message-State: AOJu0Yy0+MOrERDpYHB9vGKwcWf1yDUIhid9QOKQu5W/7a6tr8ce+hRN E8cZfSbfDLABZ7BptyigMdgDg4mj48kIP+6P/7f0p8j3Jyd7PuUAksuhnkTPkJPnXtg= X-Gm-Gg: AR+sD12eFsdcgxiO7xnwIA4YE+5P6mz4UMcTKVVv7G1Bh+fBNTcjhgY/+O0E/HLxFnA XrhRczPzjDPdJfssEQYgmKvGez5taIu1XzeEf0Z/L/t2jO8dEn+1GggY1uVxrKvQiK9m8J3S3Z/ z0HuQzCi1SESc6GsH+7wo4vAqcI1VaJc6lS+7YN+h/9vbsNVFd04ICBZFHoOw2nTMJGSs8TXhTc enpGmvqIcXEvOcxeZqJ0GCF8g1+E0v/aDnB6ro5BgDSQhylN9aWgn6FULmOVkjvT7LzNAQ3qm7Z F5/RwTDpom2UJYF37CjqRJ+ZuzBtxFHrFkrl2Q+bbXkw8ILqyTIL3KKwKe69O8RXD0+Tp5ApbFM itAJ3higf+G3+ffXcT9OG8b5Hqd/Qwo4P6yfBxkU9QT35LgQYWBOGYdofzpxzvSJDiI2wOFtV9K 0s0cP2+0kwshiXE87cG5aNIbyugs2bH268yEYJjmO1Po6+np5CMY6d3Ri1seWw0Gcc4iCrhtZ+B XVycaC/n1wP+32aVMIiy/c4aD6tXknSI9V93LcVw/f+zOkEplE/ X-Received: by 2002:a05:600c:548d:b0:495:6134:6d61 with SMTP id 5b1f17b1804b1-4980c674de0mr339437805e9.19.1785833907008; Tue, 04 Aug 2026 01:58:27 -0700 (PDT) Received: from localhost (p200300f65f01710496a76592f11363a3.dip0.t-ipconnect.de. [2003:f6:5f01:7104:96a7:6592:f113:63a3]) by smtp.gmail.com with UTF8SMTPSA id 5b1f17b1804b1-49949fef72esm81915375e9.15.2026.08.04.01.58.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Aug 2026 01:58:26 -0700 (PDT) From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig=20=28The=20Capable=20Hub=29?= To: Greg Kroah-Hartman , Jiri Slaby Cc: Hugo Villeneuve , John Ogness , linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= Subject: [PATCH v2 2/8] serial: txx9: Simplify knowing that .iotype is always UPIO_PORT Date: Tue, 4 Aug 2026 10:57:54 +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=3377; i=u.kleine-koenig@baylibre.com; h=from:subject:message-id; bh=gk6JcyJKTdGD6/CklPk8oD3ZXcxR4v8iNyYK3AygeO0=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBqcamXaDiS3RBR0+qbBwNAwVWgqMVXzklKa4F9s t/YdciWIyWJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCanGplwAKCRCPgPtYfRL+ TpYnCACULkPZUr2OmqjBZ4MUHej3MCGBPub2I3LblGvYBNm2YfQfDoGLZuAYNBbg0qBVyTm3mJM bUxKi6H8sMtNnKBtLty0PyEZMZSF6V82uzdDwH+7YRmxvrVe9rLnmWTmr4Hqsdpl+VxA0b39+fj GEGSIMOltQHQ2MlL6Q+O83TD/UP0N90zNodtJDuQNnM2scpvOxqkotvIO3RqRc1Vi7QssajpNWs ESUsFFdTH+3JJIBP9+EQPKWLioiJcmYC5X/AVMd/Y1Q8O4uDPg+ZbAWiiMDF/jXIdUSx0FgaaZo voB1fD6WCn8TXkmCdjK5cxf0WiDKKRhx5+aH1V7/a8zdz8+e X-Developer-Key: i=u.kleine-koenig@baylibre.com; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 Content-Transfer-Encoding: quoted-printable After the previous commit it's obvious that .iotype is always UPIO_PORT. Simplify some functions accordingly. Suggested-by: Ilpo J=C3=A4rvinen Link: https://lore.kernel.org/linux-serial/01a84877-9cc7-8136-d5a8-e368a36c= da93@linux.intel.com Signed-off-by: Uwe Kleine-K=C3=B6nig (The Capable Hub) Acked-by: Andy Shevchenko --- drivers/tty/serial/serial_txx9.c | 69 ++++---------------------------- 1 file changed, 7 insertions(+), 62 deletions(-) diff --git a/drivers/tty/serial/serial_txx9.c b/drivers/tty/serial/serial_t= xx9.c index ef56979321b9..bda7f7527b8d 100644 --- a/drivers/tty/serial/serial_txx9.c +++ b/drivers/tty/serial/serial_txx9.c @@ -158,25 +158,13 @@ =20 static inline unsigned int sio_in(struct uart_port *up, int offset) { - switch (up->iotype) { - default: - return __raw_readl(up->membase + offset); - case UPIO_PORT: - return inl(up->iobase + offset); - } + return inl(up->iobase + offset); } =20 static inline void sio_out(struct uart_port *up, int offset, int value) { - switch (up->iotype) { - default: - __raw_writel(value, up->membase + offset); - break; - case UPIO_PORT: - outl(value, up->iobase + offset); - break; - } + outl(value, up->iobase + offset); } =20 static inline void @@ -698,57 +686,15 @@ serial_txx9_pm(struct uart_port *port, unsigned int s= tate, =20 static int serial_txx9_request_resource(struct uart_port *up) { - unsigned int size =3D TXX9_REGION_SIZE; - int ret =3D 0; + if (!request_region(up->iobase, TXX9_REGION_SIZE, "serial_txx9")) + return -EBUSY; =20 - switch (up->iotype) { - default: - if (!up->mapbase) - break; - - if (!request_mem_region(up->mapbase, size, "serial_txx9")) { - ret =3D -EBUSY; - break; - } - - if (up->flags & UPF_IOREMAP) { - up->membase =3D ioremap(up->mapbase, size); - if (!up->membase) { - release_mem_region(up->mapbase, size); - ret =3D -ENOMEM; - } - } - break; - - case UPIO_PORT: - if (!request_region(up->iobase, size, "serial_txx9")) - ret =3D -EBUSY; - break; - } - return ret; + return 0; } =20 static void serial_txx9_release_resource(struct uart_port *up) { - unsigned int size =3D TXX9_REGION_SIZE; - - switch (up->iotype) { - default: - if (!up->mapbase) - break; - - if (up->flags & UPF_IOREMAP) { - iounmap(up->membase); - up->membase =3D NULL; - } - - release_mem_region(up->mapbase, size); - break; - - case UPIO_PORT: - release_region(up->iobase, size); - break; - } + release_region(up->iobase, TXX9_REGION_SIZE); } =20 static void serial_txx9_release_port(struct uart_port *up) @@ -983,7 +929,7 @@ static int serial_txx9_register_port(struct uart_port *= port) uart->membase =3D port->membase; uart->irq =3D port->irq; uart->uartclk =3D port->uartclk; - uart->iotype =3D port->iotype; + uart->iotype =3D UPIO_PORT; uart->flags =3D port->flags | UPF_BOOT_AUTOCONF | UPF_FIXED_PORT; uart->mapbase =3D port->mapbase; @@ -1081,7 +1027,6 @@ pciserial_txx9_init_one(struct pci_dev *dev, const st= ruct pci_device_id *ent) port.flags |=3D UPF_TXX9_HAVE_CTS_LINE; port.uartclk =3D 66670000; port.irq =3D dev->irq; - port.iotype =3D UPIO_PORT; port.iobase =3D pci_resource_start(dev, 1); port.dev =3D &dev->dev; line =3D serial_txx9_register_port(&port); --=20 2.55.0.11.g153666a7d9bb From nobody Fri Oct 2 06:57:57 2026 Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) (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 2584E447803 for ; Tue, 4 Aug 2026 08:58:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785833913; cv=none; b=Rl6NHrOixbHtmmGPNrh/HF5a7/MnMUFmmPNmcYapO8yexTCpfor/Y5ezWFh3yxk9x1mKszRTrSQhmUYIoURhhM69agWA6O2C+AtZisZUjLNt33UQ4pwvOLxW2hPqNhedoHg/FxtAqoUL0SCLQhBoe5tvADz8kq0rRoSxUhUuTDo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785833913; c=relaxed/simple; bh=T4T8J6kQtOfKpFrainH/0lAWtwbLoAzsPxkzmb7Aui4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=I226XvUOuzA9LKPettP2zkqM6M8+odvpg19JhjP77uk2MRnl3foHvGhyZoLlj9/VWkkmQRustdu/kF/Csbq+vtzlCUGiGK3yAkrUsTqjNdOLQl2vwGdbdzAW9XD+IHNi8t9RCDJB3og8SBQ9UaLxkgQTpDTEsd+l8stiJzYJ/N0= 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=I5tuoObo; arc=none smtp.client-ip=209.85.128.47 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="I5tuoObo" Received: by mail-wm1-f47.google.com with SMTP id 5b1f17b1804b1-4953de5be0aso20233555e9.0 for ; Tue, 04 Aug 2026 01:58:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre.com; s=google; t=1785833909; x=1786438709; 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=9cVOemErjRgu9665gh0KIaMpm/ugAOnpqNqqlw0YTGk=; b=I5tuoOboUDiT9gCmz7nEQL6YVbNiS79PUmymdtyLXmIgAGwAMJp9tCLH49Pugy2g5h 5EetPqLYQU7a7ad68tCPL8av/7nlEu2TiwlKKY/q1xpqZx48Kue/wqgRweRBYct1FazV hMpT4NBfMIsR22jcGeh0xvAZW8pP144INOA49paeADIpb/zkL/WWTYglOoFDiLOCp8xN EKPyYv+pzzDmEFviZATrBDE8IEcAJ/Z3cAkRB3WYhB+DcbbrxtDkplRaNb47uiXlzBsa BmrkzALM6F+Pj+TDyQWYUTyyQyjNte7nhAQoTNCuFi3DLAC0CnRHf/IvTMrMscyW0ZSR oxgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785833909; x=1786438709; 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=9cVOemErjRgu9665gh0KIaMpm/ugAOnpqNqqlw0YTGk=; b=cLgzuZCq6Xjs2SKV27DA0yxKrxVjAHNgxmVaOvIp4uIJMLQ/xfUUcXr+9OQNvsMj0J oAYtRce3D4w+SN9+VyUcHCK+v4r0oJeevUGGyy1+inlHfNIXjnEoeNaOw+Dz2sLMNqjy LKmTGDWaRkUEgwKAbPHIcpdLEkbjcarZIIMRj8JFPD48ZyseW9gO7eXb/hM3mJS/zs+a yHPMy/z/KeQjRCmguntXtMmsFotOnxJo+PDXss4teehzBbXhyPLY75uFR+M3cKTq6fNu /+dlQYOJW/RcjomY2a+b7Pi0kAkrsj+FvD4C7kFZ5tv3Qm7foExgEWNvpFNRVOIVlNvZ cv6A== X-Forwarded-Encrypted: i=1; AHgh+RqklvneChiXPY2Xwbey82WOkhEjMshAMb8Unmk2AhdBoggoHfVyGp/hfBAcSy2+8CQ3cqZUS0rK5WrwSNc=@vger.kernel.org X-Gm-Message-State: AOJu0YweZYlHIKzFq3zJa5MmCemgOAMYh2JhVdqmT2hCIAJULT/4Fhur LqrW4345RDygZveRquKDD4Zu1LHwfgn1OubwiSy73v8Aw1bLSCEtWllvMHJ8NrYBHI4= X-Gm-Gg: AR+sD10gGzDtQt1QIG4kGSfr89Rqxr4QSC4XC9xuy2LK+WMeHc0vBwDJvOeKZnrcuql XheHAg9/LQwIIvuP1NhPjikWZeg6qjP4/KaxCvG3KfpP0fb2/cFNiyrQdIcud1iCT64vIFGEUV6 85ifuWH8Z8xkY8iuzK5rLuk9DyWkdGxgQwd1I7LOt9ohzs90/Z5Cap+6GP17ynsEmLHdPexPTf/ UgBBUUl88J6keUF0MG6LZJK0r46vRfOfLG+oVxVYkSPP4BWYqZqg4oq14tJ/BiucSOx8UY0XFWD cDB9ls6WJPfsD9GJlPpzuVMWAiYS4JVc6fXztOUt1ds6yWQUghSEDMksa0PdfZqDwgAfkrQly0V wyL6Bh1FQGKjpW91v+cZrWawSrGY9p9CKEj32witJ4dAo57CawxoK+OeTn9BCyc1wSQTZYFYXzp A4BWw8EpradjWJrpjVcFwjelPScmGU0RbTf46J7E4bgyVF8HbIJRbmTLM2u+yJ3uKQThoGzODAV YRIbystBUt4IiAjIVbJaDGwTCf5Rs9wv8UJRH6AYbMY37upR8ss X-Received: by 2002:a05:600c:524a:b0:493:bd2a:93be with SMTP id 5b1f17b1804b1-4980eb5cb45mr283753395e9.6.1785833909415; Tue, 04 Aug 2026 01:58:29 -0700 (PDT) Received: from localhost (p200300f65f01710496a76592f11363a3.dip0.t-ipconnect.de. [2003:f6:5f01:7104:96a7:6592:f113:63a3]) by smtp.gmail.com with UTF8SMTPSA id 5b1f17b1804b1-49807b4d8absm137603905e9.0.2026.08.04.01.58.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Aug 2026 01:58:29 -0700 (PDT) From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig=20=28The=20Capable=20Hub=29?= To: Greg Kroah-Hartman , Jiri Slaby Cc: Hugo Villeneuve , John Ogness , linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org Subject: [PATCH v2 3/8] serial: txx9: Drop usage of uart_match_port() Date: Tue, 4 Aug 2026 10:57:55 +0200 Message-ID: <35779acb88c9507af9ac68bc026070bbc20b33a6.1785832297.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=966; i=u.kleine-koenig@baylibre.com; h=from:subject:message-id; bh=T4T8J6kQtOfKpFrainH/0lAWtwbLoAzsPxkzmb7Aui4=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBqcamZK3gLHTQoOXTf3aRd9dAJv276/odcoMYDe 6eR9ySb82eJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCanGpmQAKCRCPgPtYfRL+ To7BB/97B9HGZvwsJg26L8Nk4yWcxo5pNx3xqaRtDYsM2m4ISQmeoCQrUcyRUliupXclXbiEHin ZtjNRN8gBqg095jKwjPtW6nEeWp9Dnn9xwNVBRrORh4ExOQoeT7mveAafHrHkKCktXgBFjxN1MQ iImepL5PgA9NV/csJXHxEmmjmeFeMrNe0pZ+9lKRC90CPXeL3DdGEj9P0nF8OLdzvvjMQBnS7kG 1XiHxLkzXh66x/b631IXRdOSRTXkckLfnckxb8tQJTFEO/r5quDzAkIu3Lc1/ZPsjRHAe9leJG0 pkgS+f1YW2MMZ/v3i1Fi+7T1vhl/T9z96GGAa6WqlAs8Zhg9 X-Developer-Key: i=u.kleine-koenig@baylibre.com; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 Content-Transfer-Encoding: quoted-printable In the txx9 driver .iotype is always 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) Acked-by: Andy Shevchenko --- drivers/tty/serial/serial_txx9.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/tty/serial/serial_txx9.c b/drivers/tty/serial/serial_t= xx9.c index bda7f7527b8d..8febc0549f76 100644 --- a/drivers/tty/serial/serial_txx9.c +++ b/drivers/tty/serial/serial_txx9.c @@ -911,7 +911,7 @@ 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)) { + if (uart->iobase =3D=3D port->iobase) { uart_remove_one_port(&serial_txx9_reg, uart); break; } --=20 2.55.0.11.g153666a7d9bb From nobody Fri Oct 2 06:57:57 2026 Received: from mail-wm1-f50.google.com (mail-wm1-f50.google.com [209.85.128.50]) (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 B0DB6446C10 for ; Tue, 4 Aug 2026 08:58:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785833914; cv=none; b=lqDQBQPz5hvGrdXv3Yej8mvnPuurwGQmjkF3ucPYK8h/iPzEgAobqDmKyxFXQIDJkBcx8nJf+EHwrCD4pwCwcBQf48uMUwqh0E7hsIz2i/GGbh8tQ7FuAGCvJVGDXJDpWVFiFvGf2y2Ccs9zNlFe6G3/B+zQeKu8MzxQC1cYIoA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785833914; c=relaxed/simple; bh=MRGrhbWZVYwnSjvuiDXUp/YI+gfa7hnsqkfSWAXUbKw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=WEFfuUnqXXv4qhYGSEN1cQmMVHW/ojLeUg950fM7j/zGuhTk1x/7dR71YvmnHRS9kt9VfULyihEVPS6ZFxnG5Qyqr48hcFuaU1Pd434O2WOgWgJoz+mEz0tYbSGY71NQbdh+QhDa5ovORrnY2pI8QEpAN4Sv0fXmvKsbW4Xpqxo= 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=jo5CMF3y; arc=none smtp.client-ip=209.85.128.50 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="jo5CMF3y" Received: by mail-wm1-f50.google.com with SMTP id 5b1f17b1804b1-4956242332dso25319205e9.2 for ; Tue, 04 Aug 2026 01:58:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre.com; s=google; t=1785833911; x=1786438711; 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=haCHOmpHE5y8Tw1drV9culB8U3ivLBg4pq9M6KDTT1U=; b=jo5CMF3yj7wRiZmHNUd1/GU13xTbECXHkJb6VRE+5x6PhzDmju3a2djNnIoEOFQqEn EeGkJY0UYk5LPVZd0Nd8qOdqkcNsMi6uTokpvFVdnwx0afkMkcN5hVq9cN9Rl9WU5SEo HJFvf3fEED8aonzcg0BfhGL5fYx/Ji7S0pKrUKtMDgQJGHlOjuIumKT69xgfPVJUKh3k gyYr9qndBNtsmqQAXOjK6ZgQUEHDopO2zhavu4ielymgYTXhJ72pGDECrhGNST00Ow5a /3tzLXVtxzfMvwScIu7lj/Fuf7Am2S1EJgyQ7cYcvvXB88Olx6YFByccV2AtvAkO5CZN rmhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785833911; x=1786438711; 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=haCHOmpHE5y8Tw1drV9culB8U3ivLBg4pq9M6KDTT1U=; b=gnmOECFnspH2/1I5ua1zCRTLyE2nNbFRoiZY/C/YVpQD+3iECYLpun5MhTqOgoK1ml PG4uPQMm9s9Mt9WRLH2RwcSG5Re5muhadeHhaO6eQvPlF7qbYvx7QBSXPWRmfTAi99V3 oaHV56RnNzr1MkEcJcSFgJNpNJVp2pdo20TA/2Ys0W4r4uOirT27/JOBnHZ0JxLWRje1 brSNsh03R7x/Au233t1wLvwRO7Hv6ib73MTaT72kYSC95ShTpLVVFemVgQUbkcwVvxGC h8rfTnuBjPmCqZ6vigFc0VSBv+t1mb/NdBbH1yXUKeiS8C5cpx+lEBpDLg9Gf6Aqx5qe Qiww== X-Forwarded-Encrypted: i=1; AHgh+Rorpw05eGYn32DfeYIwnbf8gqlPX2XlcjeXGrlVc2Ewha0VlkGUzpwmd9thp8lJcJ4Kp+fSHBA65zq83r4=@vger.kernel.org X-Gm-Message-State: AOJu0YwY6mGIX4EzCTKsK5g7pFCRatyaXhOCeHBdi+oAIAR0Iwq87m+6 2DuHoeMv0fCza6wMjUUFCpcuHx2zw1XM2Mkkd2Fsd6sd03wunP4OlD8pR6HiraSCvfI= X-Gm-Gg: AR+sD10BBtZGc+DPv6Hr1wcER45I0xTcOtkslig0Y1fhfiYxmRG5EkrhJLjcJZ5zkNn 9dhzg5FDC7pHizLZl6uFDlLD+6aO+RAUJEvYwIK1ULwhgRU09M+JECuVT9A7HxifNRfNm6j7Ay/ p8s+uYxbz1UBhtVemWhE6sAfA6QXZkrH69y4QM9X1lTjk4YHEsfqmzQqapGsn1Mz5nf/L+PYidg 6ozx/jryxCSnfuT/WplC98ElI9gXPIvd/udf6ptwNYSx9mr0FprfTcdHXvPC7df8I2yIk63ohIa ZMxU9McBFHpm0tRm23I5C1EXk8O1ULdOkeHKBXJVoz+alKjvKZl/nApIQRbOK4jQGJ9VfvbRbI2 WvN1i8hM3Yv55Js/0jdQbjTxP74QMmlGpoFlCtSBKXQ/+ueio2J2wXKBkaUHWYDSfQlVlozoA1/ wJkjmAmtdEPnF3nnbA5nVH9ZK1+Al0j7TgN98T1w0KPduF7sxt/L1dERBH+UU8VX+gvELAaDTTJ JVsDYsTo2lf7V8ATxeLH1Fhimmj8PwG6lwc1h5f9d0ro5C6Xm3N X-Received: by 2002:a05:600c:3151:b0:496:c378:6420 with SMTP id 5b1f17b1804b1-4980c66c843mr240856375e9.8.1785833910659; Tue, 04 Aug 2026 01:58:30 -0700 (PDT) Received: from localhost (p200300f65f01710496a76592f11363a3.dip0.t-ipconnect.de. [2003:f6:5f01:7104:96a7:6592:f113:63a3]) by smtp.gmail.com with UTF8SMTPSA id 5b1f17b1804b1-4994a0fca55sm74111255e9.13.2026.08.04.01.58.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Aug 2026 01:58:30 -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 , John Ogness , Fushuai Wang , Kees Cook , Hugo Villeneuve , linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, linux-doc@vger.kernel.org Subject: [PATCH v2 4/8] serial: 8250: Make uart_match_port() a 8250 specific function Date: Tue, 4 Aug 2026 10:57:56 +0200 Message-ID: <378b78ace1bf46d384d9ec9f4aec6b49dfb5a0b5.1785832297.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=4981; i=u.kleine-koenig@baylibre.com; h=from:subject:message-id; bh=MRGrhbWZVYwnSjvuiDXUp/YI+gfa7hnsqkfSWAXUbKw=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBqcamcgsluV0MNojtUH94tVM1pfVMSAK1PZgEaZ nb9AwvA6dOJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCanGpnAAKCRCPgPtYfRL+ Tne/CACt23HYm6yxdW3XjMwYv+yy+90brIpRx7heHhWiX4bAYJ8Hqqc1HvPqIKBsJNfPP5KDAH/ /HJzTrXBuhHsegnkWLpBNxCfzE4E5wyQIeKQC4uGAu2kVtmKr8fR2lFy62lCw7hK2NCkdD10yJg rEGzV5FvRrWvUuyxSNqv37rmV7R5i72z+bgRFEtuXby26qj2YIJPYQRWf5/y4dD0D5nJ8KIQx6x PyhsTgl/JcVlwU1xk6nLHsFZ5ymDMeKMwGylsEkQV/ftQnkTPyhuG3oFWQWxLxwRq98a4Jh07Fu vpjQvJFPtzrQ6KxYiKoe/3D0uiGqzHLiJ3ZyhKI8KLf1+rpu 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. Signed-off-by: Uwe Kleine-K=C3=B6nig (The Capable Hub) Acked-by: Andy Shevchenko --- 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 f49862d90eeb..3e53ef54ad7d 100644 --- a/drivers/tty/serial/8250/8250_core.c +++ b/drivers/tty/serial/8250/8250_core.c @@ -630,6 +630,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; @@ -638,7 +663,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 edd1e7be2a5c..8a6c53a9996e 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. @@ -3229,32 +3228,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 c4cc4f66af4b..1659805e2233 100644 --- a/include/linux/serial_core.h +++ b/include/linux/serial_core.h @@ -1137,8 +1137,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 Fri Oct 2 06:57:57 2026 Received: from mail-wr1-f43.google.com (mail-wr1-f43.google.com [209.85.221.43]) (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 204BC442FB1 for ; Tue, 4 Aug 2026 08:58:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785833915; cv=none; b=aPhYBe/ShR/6sLaj10Jno+74RwrefoTZgYiTb7oToyteMAg8w4qm2suob/mMyyCXNqa7BKT3OXiCu0PGAkEk0W8gyi2zTbIuHZcoymRZPndaY0Vc1KyNzXL5KgCN0fgZXKBrMLXJC0rVW+dwCiJvqxaKO3idgswxu2oqPweFR5g= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785833915; c=relaxed/simple; bh=4ZcQn3LfgqwKMW2oGA9kk9dNfQk3j0ydJIkghJZY6DA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=clv/8BqsvKL+WV9SjY1yxG/sgqDYtQPfzxTg8u+w8scyAuaZP0GLHJe4VYg6u+pMCgdJPD0wllja15qO1lO+RwDDVXh0VYfOO7867ZheCq1nDUpPcBVxz/9gZZn56oVRUCUgt3DBN0LvcKcMRVkGAvnfEKzi10T/14RFs3M9ytg= 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=lzEygS1e; arc=none smtp.client-ip=209.85.221.43 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="lzEygS1e" Received: by mail-wr1-f43.google.com with SMTP id ffacd0b85a97d-47f92e3c14bso3122242f8f.0 for ; Tue, 04 Aug 2026 01:58:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre.com; s=google; t=1785833912; x=1786438712; 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=MWBmS5cTt45eJ4D/3lj9BdWfjH07q+yrYeANLUmkgcg=; b=lzEygS1eHw5GW7H7YqZPAbGMbog/9NAHxrMC9ltbQqlDODSGPfeijFjaV8UlHyHNLM JvulmIYz+iTIU19JiOs4s/JO1N72kQVtkTDDOk8TLXNL1sZAcijD1Ckgab2IAA2E6kri bT50oIKDZP43u1V24UBtldC1EfXCBS6gifDJbeYnOzKL6RnVEmrFGSZf1YRee5z//fp+ REB61c3F20sgCIJVlbXRi64XpiEP579/QoLhaRml+WnCHyK9b7wL13CzIqlk5JZrFcfK D58lYETMIJKN888TJEtWoQfoyGcDRbq/2ARWNa+GaNrQuTRFT4+SsfWOOzpAtF0lpRvz 6QYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785833912; x=1786438712; 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=MWBmS5cTt45eJ4D/3lj9BdWfjH07q+yrYeANLUmkgcg=; b=mc2e0Gkr4Y1YwuRk7VfUPvhrPXGPOKS3u3mLdIaV8LdXmUNVoclLRmoGyjiUPBUQTd Q4x8ZNy+gGif/eqpSTuqTrNoq1spoK3WZNlvx5zctrbZaoXxjnmPfvlqy0/z84bJU01q bMFUfpyQ4fMlGLoGFKuOUXvLDigdaQwA4n8MHaS+DYQyIWO0opvRpbOPTbTdKC1wYqqj uFc/REjoNY6zCazTTYI27AjkQaWuOewXAEE0FmMhY1IILYo/cHAmKq/wiXl3Srl5f/tm SqiyztcUJW4XfKcS8orFvfXClZD/D7eeg9f9aSsYUOA+6fLoW9+MHkKDGI64BGrtU24k UnuQ== X-Forwarded-Encrypted: i=1; AHgh+RpkZxQK3C1tSv/qRe6bB4sFptGsNnt6g+FQQ4d7glxmaDqiFHxFouo0p/hJCkqvef+YkMFmhqrVgZ3AhHs=@vger.kernel.org X-Gm-Message-State: AOJu0Yx387/WqsKFYjJG/LXC+1XbLgllDZwQVn1Ia+HGs3ddXnmL2TL1 qM4eaHQNo8xnI2fMXxfMqsJgEoFIpbWp+ReCx5Fd6dsK3gbLtH8PGnZGraJB2AidBJ0= X-Gm-Gg: AR+sD10bbq5UVv9h6MJNO6hF5HQJojsxQZIKQui0w9YUkWPTDJUe+NxmhkI8C7hvteg X33lndskkw5NsFqXGaBPJcjtGZ2kgLorccTGnjv68XK7E2f5DIzUvUAe82nkuVY94JnBbxDq/gL f81IgUkbqEFykWjHbt40UwNiGP+Fr9I0v8DHmOSDuYKHPqfnXPFeXeka5l939XIBgNDJKwmX9NT dLs0mgxFV8e1w+0Q6Zt32VVbSQt8NTAllbzrtUOlPyECtKTbVMiQOCor1VZJg0zr2OsZyEocGpJ HhyLFvLOqA1GXVHW9R6YdcZeyQb6/yrb2xmUNgNhaFltT/g2O5CrUQYzrh+Ji6K1Xm2UNfsEDDq 6RQTeCrFZ4kNpEI4Xr19iXrFEw+1o5NsMKNR02UccWyVuCGpPgQUFjjZ9JBhY2SrEJ7IEWUef3W ITrvXFToxDSLUT4QfLd5e3c5o9F6sK3M5g/ESu0qAE8YYSe7EH4EwxWPWLbkn3AAfNQXGT4SNAx JSx9mq3UXEKqMHOe0ZVTX5hUFczloYDvuXZJE0E2K+APkY9Kblq X-Received: by 2002:a05:6000:430b:b0:47f:e748:3ae3 with SMTP id ffacd0b85a97d-47fe7483af2mr11690155f8f.3.1785833911939; Tue, 04 Aug 2026 01:58:31 -0700 (PDT) Received: from localhost (p200300f65f01710496a76592f11363a3.dip0.t-ipconnect.de. [2003:f6:5f01:7104:96a7:6592:f113:63a3]) by smtp.gmail.com with UTF8SMTPSA id ffacd0b85a97d-47fd41cfde0sm38583143f8f.3.2026.08.04.01.58.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Aug 2026 01:58:31 -0700 (PDT) From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig=20=28The=20Capable=20Hub=29?= To: Greg Kroah-Hartman , Jiri Slaby Cc: Hugo Villeneuve , John Ogness , Fushuai Wang , Kees Cook , linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, Hugo Villeneuve Subject: [PATCH v2 5/8] serial: 8250: Simplify serial8250_match_port() Date: Tue, 4 Aug 2026 10:57:57 +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=945; i=u.kleine-koenig@baylibre.com; h=from:subject:message-id; bh=4ZcQn3LfgqwKMW2oGA9kk9dNfQk3j0ydJIkghJZY6DA=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBqcameFoy48mkKoeGa80zaohBP07PLUzBvofZGW fn8TT6eKNGJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCanGpngAKCRCPgPtYfRL+ TotoCACNgu9JChPIr2zQjWl6/f2lRrkS+2R2NMUa7sjDZIRHGUsP/C/dp5ULGHOkyBLm+WVHGSf HTDByT7+s4X628jqX0BAO+bCbmJZce6qEpkxo6GsJKnbpsanRFoxcQhM+LGmw04LWGNjqOBepWL ByT7VpeOJPgbFyvMKEU5gXzEKOAfbq6DIM6r7jBN8I5R2JEyBxWZFNgYL9yt54t8DZSpEgrz0iw poLnjs07T9MquHCGjh4SgJzQ71n+exsKzzTcwzgOlXJzCpFuwdG59MxMunXobZM2lpm3n9T5oOp BSE//qyXgM7sbI4yxVbHAD3rZ8Lpax1rOK9eCjhDBLW+fnh6 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 Signed-off-by: Uwe Kleine-K=C3=B6nig (The Capable Hub) Acked-by: Andy Shevchenko --- 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 3e53ef54ad7d..f113f8d5d158 100644 --- a/drivers/tty/serial/8250/8250_core.c +++ b/drivers/tty/serial/8250/8250_core.c @@ -649,8 +649,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 Fri Oct 2 06:57:57 2026 Received: from mail-wm1-f48.google.com (mail-wm1-f48.google.com [209.85.128.48]) (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 E0EB24499AC for ; Tue, 4 Aug 2026 08:58:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785833916; cv=none; b=VujBv06q2Evx+n9RKu3wKsBKhS7ccq0JtgPZ+fRMx4q5k+XWiDSk/JNT/H7GDpZB2+2yHkQKlRe5He+39wKROshOHQNwWw5bkxyq11ScXP64ygdCugBWRzzhCEJ8Lqj+gwKbu+R0lAPjTRmPBciBQilIFprRBcahWdgK+2bVMj4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785833916; c=relaxed/simple; bh=g+evHTRP4g65gc5h55+HJoMYHW4T26WZDIbPM78rRDo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=iNH9WvhB+Zh+jh3aP7Tf9rkPEfCA93FHDMVL6ZAn1PIgpBP353QAnj1GGl3gHJNEBcD7pJUEqo+4xgf3Ggp0d+1reUgOQkZ6UxFho1lgJWf/qkLYHEMxRGiNa8claeo4zS7kKcUfEkWn52MxXi9lUsJ6GqXaBV9Di/SFWoFgFH8= 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=Fk2AuA7g; arc=none smtp.client-ip=209.85.128.48 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="Fk2AuA7g" Received: by mail-wm1-f48.google.com with SMTP id 5b1f17b1804b1-495437bb891so6129655e9.1 for ; Tue, 04 Aug 2026 01:58:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre.com; s=google; t=1785833913; x=1786438713; 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=nykDGsyVZBJ9u62/lqEhAC9qbabpwVZT+8aoHcWb4pE=; b=Fk2AuA7gBaoYzWXZaeKZ420UWVnQX0RUXqgQnJzWqw4KeKMI70TkjObAtfAxmo7m7O +GhSmU3Ivus/CnNr/aCeVorYewlP5GX6x5bObP05Y9J9OTJtak/jhGtxmoz0mBpojal8 1Jia6mDZsEkXGLG8M+Jz3X6YL5wASwrzchEywVKr2unuEIyJsjknZj0E5N+OWAfuI3n9 /i5lXo7W1QUcGBPzhZdwjGBaAL/7Mw1kNR4dJW++UbnrRyvUMr79QP5ujZ4kCh3QGEKX +tWNS6xkdvTWMqQrfJmvaVtJf0vAl2BHhotlEr2zjFTEm4kghZDOmI6jOILOJlXONsaY TyFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785833913; x=1786438713; 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=nykDGsyVZBJ9u62/lqEhAC9qbabpwVZT+8aoHcWb4pE=; b=I75NsTKLiMs9wsFrWtF1mna2+qZenfoUm5nMpYqzRNhSi1y1uIamt+ruhPukhwY43+ MAXuxUnubE07Mvg+xS03tE/6+oP4FXd+YKv7oDrH8SvFOHzkIMofO2v50MMn1tfKzvPZ DBOYkKOELTpz3dXstugN5eHE5AazWU6lLR7r5/UWn5S3Z5nh+JTJLxW5bmRH1ai7wvhd w4thz5uUtNZiOLQfXdlCLPbrHrCdnd2OQBw8BI+B9Na+HG+DpIjRj19P9S+MlBUE4sjF 6MYuSWSKrPckOMwcPuTc6h5bfuKSTZ3Jif0fuRKI61m4HeqaWnXhCAclACAYLy3FqcoT 6hwg== X-Forwarded-Encrypted: i=1; AHgh+RpcB7WxUY7XfipNonMcbUOP4QG+2ptwCwIrpK38fnc+IiL7uJKnx6aFxQk+XT/+URcvUrhOu/jM0OejXBM=@vger.kernel.org X-Gm-Message-State: AOJu0Yx4PBYFAA383fLSNEdun/1/j8s8XU3xIH2S0dgE3ioT2sC6hpcG qxTQ13la2u/xpw9foLPwVGPj+4aRN9j9WTLHwXYwiumTCLpIlBhK56j5O4lfUH9EVG0= X-Gm-Gg: AR+sD10obwpPqOPl+2YOjCv3D7XjJPdntWtH1Mcyqm7Cxxe1jMsokqy84D1EW5rbytT zk6Yme0QNcjJCcF3OrnuYwwTXwm8QZmr9fG4ZM3kok4J/RzWuA2YTqAM1IyBuMIofRPjfS0kuZH sl3DB7Lqnn0VXiOnCmzfvxOJU8mI1cGuHB5nOBJ5jAzntdupaN+Pp57l6qCD5d6vK0nvOH2yemy VYpBYLmcM90VcXJY1CBguW/7YGC5PH7TTwA6J02Jtgch9ef2HFYygnFpJgYWo/5d8ob447pYtIo bU9kGi28jsoy+4iss2sMrVBjt44KCgaEy7NQvBPfmIoCbw4InRgMmX3r8exO4Ns4zOsFzr5El6q A4s8LODrxNlI9VUsPERWCsxkrLx4CIkk8ywDWfpK2cpSsrAZ9H6maGsI7acpCI8VQ6SXa6F8Y+V 9b3OmgXuTHkY3MU6O9vGNWchpqspJAQW0L/E8IxD0+63a90Ugvbu/5x+lYFHQeUPkmFyy5w9vi+ c9ZTHG8fHHZdoKmtyDFzVFVbHenS86n0FWlLOozw5pwR9GUeXw0 X-Received: by 2002:a05:600c:4f86:b0:493:f783:c46a with SMTP id 5b1f17b1804b1-4994a0fc5f1mr52353335e9.6.1785833913211; Tue, 04 Aug 2026 01:58:33 -0700 (PDT) Received: from localhost (p200300f65f01710496a76592f11363a3.dip0.t-ipconnect.de. [2003:f6:5f01:7104:96a7:6592:f113:63a3]) by smtp.gmail.com with UTF8SMTPSA id 5b1f17b1804b1-49949fd0a08sm71408695e9.5.2026.08.04.01.58.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Aug 2026 01:58:32 -0700 (PDT) From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig=20=28The=20Capable=20Hub=29?= To: Greg Kroah-Hartman , Jiri Slaby Cc: =?utf-8?q?Ilpo_J=C3=A4rvinen?= , Andy Shevchenko , Hugo Villeneuve , Abinash Singh , Rahul Bukte , Kees Cook , Randy Dunlap , Lukas Wunner , Huacai Chen , Haowei Zheng , Rong Zhang , Gerhard Engleder , Binbin Zhou , linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org Subject: [PATCH v2 6/8] serial: 8250: Fix corner case for port matching Date: Tue, 4 Aug 2026 10:57:58 +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=4861; i=u.kleine-koenig@baylibre.com; h=from:subject:message-id; bh=g+evHTRP4g65gc5h55+HJoMYHW4T26WZDIbPM78rRDo=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBqcamgvTO+R6M3hvF4UpaLb/icPCTsWQDiX5j6+ bgs5RTmH7+JATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCanGpoAAKCRCPgPtYfRL+ TtRmB/9HfgsfngOin172tw2vfNWCrW+uvI4rv9WxeIg+d0g4o/1JVBrG/TLwq6Q+E+yGXIynw9Z x6OvvhiVTnLHQpfzeVCEQfypZIgfXsxLeUdgbb7o8KF5qsG9zeiBsUCoAHs3sOn94eMRRsoLi8o xDOVYTKfdM8lXGMUYQMuusGG3971A5vBeHqX771Qn9wB/va/7WJ8Cbd8T2OroJbscy36R3Vacne CnKIER4uryF0WhhImpW6eBWjw2MYASNV5LuYxry5DJ1B0lBCdJWJkpA02V/Tjc2X2Kv2USxu56h cqaBGmjG4ViOrZR0TCHUfu4rkraZMqjixIPKBNwznmJRIjJi 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") Signed-off-by: Uwe Kleine-K=C3=B6nig (The Capable Hub) Acked-by: Andy Shevchenko --- 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 b62f88eec881..39d72f1480c0 100644 --- a/drivers/tty/serial/8250/8250.h +++ b/drivers/tty/serial/8250/8250.h @@ -315,6 +315,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); @@ -335,7 +341,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 fc3e58d62233..00c2ced12717 100644 --- a/drivers/tty/serial/8250/Kconfig +++ b/drivers/tty/serial/8250/Kconfig @@ -294,8 +294,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 6d21402b4435..416c32e3aba2 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 Fri Oct 2 06:57:57 2026 Received: from mail-wr1-f44.google.com (mail-wr1-f44.google.com [209.85.221.44]) (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 67BFD449988 for ; Tue, 4 Aug 2026 08:58:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785833917; cv=none; b=O0DY1S/hbxNEpHEEU93CEfs/Ksd4Ge+7rwQ8PsjiY12X354NI0+UtbaHFU8UlPejLgzHG8OCS2iZ6EYXHf9Y/5Pt8AipTOiWXH4x9OvwTYE4YY759jMps4+oupKSbhdARQTfa2ynzBAFhoDOqZFBZ/U4RO4/FwOnKsifkxUeTiE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785833917; c=relaxed/simple; bh=8mhW0YcuSDgN98TXAQOOJ7CdM5VJUx3gNB8aMzXeKEg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Qh3OPp+VFbwhySbFJMcS3lC0OA9iQ5JnYBkSndJo6PFdw3N2l2q8ivrGFsDe7kYclbDPn68PJQENnzBCWFcjwQltbeSIq3Y2OMNU8zSP+ZEChxAB01m8KZP26k25pH0CUJ7dngOp0JrrolVNN3aJNR6twxG26UHpfZY6n8+A0cM= 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=E6j2i/wm; arc=none smtp.client-ip=209.85.221.44 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="E6j2i/wm" Received: by mail-wr1-f44.google.com with SMTP id ffacd0b85a97d-472326ca506so3001618f8f.2 for ; Tue, 04 Aug 2026 01:58:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre.com; s=google; t=1785833915; x=1786438715; 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=i99GOuT3VUOcATvwRkqhpDeUhedKTS+/sSk4a6fCl7A=; b=E6j2i/wmJRtjpNWQ2+VTfOceIPs7sC3rdf/8HhmmhF4V6K3F/gbdVl24cq+e6ZBIo6 WLo4iM9RfuyGIRcna7FyHp57g0aVMqwXN3GjeppihsLu7jWhVeK+gAOvTotd+y3dUblu ab23eyQ68LB0t4WWTxM6O6WbvBb6j77Jj45TQTAqiWzwHpuno8/twhIUvgy29ZIBpz2E UxA9RIUvViheKoBj4BJxm/v0AR/PnkvcK9mQZW4UHHp7WkiAI6DN3ol7wUVqi9pVFddX l5IV2ePJipl7jGA0Kq8kyLPCB/sFakP9RntxBdY8A9kRycPRmFaE0KG3ldAEKddwolwU VCew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785833915; x=1786438715; 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=i99GOuT3VUOcATvwRkqhpDeUhedKTS+/sSk4a6fCl7A=; b=gIx8U2ci1eNbAmp/kUWuZwiaGZP3phOKXIskeHGuMGdtEUPV2DqQFt82O+toeoBj/m esu/s9ehV9FAbkVFTfbgdgOFGTxxleAieQEQZ/LysJjshLM9GLNLIYezGRBcCzRVamqP exBLeAmTe/TpHjqTR07wfL0fGxF5ibq/vd5+hyqZyWhdaphTBSPJCao9OVmtOzSRaRkN GJ5p5MScLNiCHeOC6lHM2Fv1aOWK/bvg8/kJRG6FHtU0vyGGB/UDbcJdfWWIXlJCMjUf SWPrGsuIa107pmWY19SJXq71pD5TJ6dULo2itZohS/ftLwDexcc3oswNuhxr6icjy01y Ip+w== X-Forwarded-Encrypted: i=1; AHgh+RrcisGTjabmRs41h3yJjAzjC3xeNql46ur1zSKls7DTKcKcP7WIdpm09Dtu+cjxuI2xGqBCgUudOc0C8qQ=@vger.kernel.org X-Gm-Message-State: AOJu0YyaZslsxdbkNL7LtAFm3Vx1uhzMULFRdmvYtPRQ0ZVKLmvqCkTF a+fyjKl0IHYvL4NsNmoaKgMendhQotpwlOBoHkUVypjvcTp/8SacJwwf54WjxE5lUTU= X-Gm-Gg: AR+sD13+WQXYOR1GM5l+Conve+M4+pIKsNEaTcshGM+BeeDtyx8FiZzd3eOsEopeitD ECJ1m6lhZ0oXeFPdzo0jPqi7R7vNgkpX57cHyFQ3AXaP10sBshrNr+q1SlGZHYHvJNgIPEI2M78 mquPCzD/D+X2fBk/zPKQKm7WTSordo0S0iFBHovoVT6Prv0QU9sV24Zq17nAxVpvFo/5S62BFeB +xUjcbYR9SUvxn3UTfQxbpr/XaxtGtRbZSriCKBqdIDCopzs3Vjebb9gvIt3roDOMukxP9L51nx ZMPm9V2ZV3OOX3Wqre9wTGaFGju8Zf/r+NwHjSWN+a37qX+/LTgdsVfoVwGAe82ZfcWb6LUYPA6 zyXsdIl0O2aRiumATzzgxSItrkktLguDDNpOowrumNObk0fr6p9iE7HvIRiLDo1OF1NfPw0kdxU qTO2o9DFW91fmdEIHJ8s/y6NEfdtw16QAHSNpt/X7aAZLrzbuDE+5z1fd+2LP4PsxqRYqSJ/2Fc 3HScV+ed7FgWSf7nnkffgsefuwJDnTCLh+8JlaDUL3fp/2vrDEd X-Received: by 2002:a05:600c:811b:b0:495:6934:414c with SMTP id 5b1f17b1804b1-4980c696c7emr306414905e9.19.1785833914710; Tue, 04 Aug 2026 01:58:34 -0700 (PDT) Received: from localhost (p200300f65f01710496a76592f11363a3.dip0.t-ipconnect.de. [2003:f6:5f01:7104:96a7:6592:f113:63a3]) by smtp.gmail.com with UTF8SMTPSA id 5b1f17b1804b1-4994a0f7b73sm86648485e9.9.2026.08.04.01.58.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Aug 2026 01:58:34 -0700 (PDT) From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig=20=28The=20Capable=20Hub=29?= To: Greg Kroah-Hartman , Jiri Slaby Cc: =?utf-8?q?Ilpo_J=C3=A4rvinen?= , Andy Shevchenko , Hugo Villeneuve , Abinash Singh , Rahul Bukte , Kees Cook , Russell King , linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org Subject: [PATCH v2 7/8] serial: 8250: hub6: Add cleanup code Date: Tue, 4 Aug 2026 10:57:59 +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=2497; i=u.kleine-koenig@baylibre.com; h=from:subject:message-id; bh=8mhW0YcuSDgN98TXAQOOJ7CdM5VJUx3gNB8aMzXeKEg=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBqcamjFQnO38kwJYDr2BFeuP0TfMdDevYiODds6 G0InzKXtHiJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCanGpowAKCRCPgPtYfRL+ TkukB/9Flk1eE3MdKfCb3RTRxgLgJELn4juYnEYEvZYZ06CZe9jYtwJAr76igdRJKIs72WPBbcV aUTJK+E06vqrKsrjkd93y53DJTa0VrE6zigjjoeH60IXqNhb/30FaqxhkX5OkrEVTtoowOQm55H pV1frMCVx+J1P6xZnPkHyHFAP9FoHjHlD6ybXVo2A3qgzhW8ZqCHuyvY5n2kziEjRhYNlKD3uGB ywYnEf+8mhELZ2LET4AGSsqn7k92xU7/A9diBuyXPC1rPTXfH55CSm3ym6E/9lk1T3GB3GQbuLC l1xWJH335+w9KUvDfns2zJWcrxMzDXNJinoSkwUFxFfxwmqw 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") Signed-off-by: Uwe Kleine-K=C3=B6nig (The Capable Hub) Acked-by: Andy Shevchenko --- 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 39d72f1480c0..01fed8d44b7b 100644 --- a/drivers/tty/serial/8250/8250.h +++ b/drivers/tty/serial/8250/8250.h @@ -317,8 +317,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..55320b794165 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); } + +int __init_or_module serial8250_hub6_exit(void) +{ + return 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 Fri Oct 2 06:57:57 2026 Received: from mail-wr1-f51.google.com (mail-wr1-f51.google.com [209.85.221.51]) (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 C631D4562BE for ; Tue, 4 Aug 2026 08:58:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785833919; cv=none; b=HBP5GJ9ko4ZciDtW3CcLIJYO2eMHCQH0GTFHdhGm1cunMUVuft/Wqb9ilM3pGlNF3ig5KVlbYQiyqWIIVsX8sK3zhe+m01pOfSffyQ4LiNsPvffMYx5NIxm4TO26L3ef7XcT7z9n2TgUNZhuq4AblyYtABoqLZgckT8K+O0z5Kc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785833919; c=relaxed/simple; bh=9b5hv7NuP99bZVltiQNQtGI97d1HD/5btdiVcCguw9s=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=NcN6dQRR/uZ08IpyGuNCb313gu2sLXuKopE+loJAhUd9EsmjBRpPVE1L86EpOXjKQmL+91u9aQNy285PQ5eNpUrvzynSCBF1EpsggdlWIWwQ4HyZJL2O0es0PGS6Xxzv6CqJ1Q2ELOpUfU80Pqr6xLtug9Db1WgSKYqqlXEGA6s= 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=QGWkeRKy; arc=none smtp.client-ip=209.85.221.51 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="QGWkeRKy" Received: by mail-wr1-f51.google.com with SMTP id ffacd0b85a97d-4720f3bf164so449205f8f.1 for ; Tue, 04 Aug 2026 01:58:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre.com; s=google; t=1785833916; x=1786438716; 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=E/NNfpHYJNt2yLJFPy+XHHqBnXci9iT/8pZeLdqQo8E=; b=QGWkeRKyOn52TmXveo0fZkN0UVEhX8jouO50FS9G16mANBy2GZAOIgUFl1Ie9PgQIK s8WECXi2eDfilCTO9orEGiyl5PSJJiEKDh+OKkuV81le3tHImifP5Zajd52crdqY6riK zAgUHdm5Xi/0YNyTj7FKfWBsf73mXKMroA8bsFequ/pLQKhWz5M8gw04il+JAJYlyUbN I065UYFRyaMhxUFHtGzNcHvNSksVP738dU3rn9TRxbeGuI93hchIxfcjQ0R05ezy1ZY4 CaA+75iWXiwLycZwn+nGCCcAN765yRxiRRKlcoJitu9IPHCPedB7SMdeoRyxTXfd9Iz7 cA6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785833916; x=1786438716; 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=E/NNfpHYJNt2yLJFPy+XHHqBnXci9iT/8pZeLdqQo8E=; b=bhQr5FyJJd+vEx28Upcm7rExVRBggFvUNZduraMzFe0r1VTHWQrdRDa4nXhkt3of1X QQDAyFmeBPhQJZNuPxqvje4Ztstq+TUBDE0aV6WW82Ecg7X2WWxP4GpPtHdJE+3GpneG eWAF+1cEb3KZX1PewuY/LhEUbj2ofjHdN17MX6waftJMuH/nkK1FxTbHPG4szYqxJ2gw giD+dxW5xxO0OrGnAMxSoENNcQe/1kAe0PjzAbNFGrjIukueVDxISITfKTeQwFA8vluN 1xwZDa5keTOjgS3e+A6rubO36pubhki7PoD8dWe23phalwORW5EmXwjsN3pQBNcncGvz prpw== X-Forwarded-Encrypted: i=1; AHgh+RqNbI6eW1k9Kmgu+lcgiDERpIM7lvVI4z/l9H0kY5J7oS9r3qqO8DyycXJgdXfVLgSlldpc64Q3jB4CRnc=@vger.kernel.org X-Gm-Message-State: AOJu0Yz/ktrHNudwCMPSxQVIxl4OiS2AHKKfdsXgdDlltywLMyxKFxOe qR41Aa3RUSqOpaffDT95UF43egah0rKt7modLBGHQUn3ahCFmy9084KiNx3d8Z+dxf7oi8G9tt9 HQEto X-Gm-Gg: AR+sD13mpFvQD/H/8b5zEp6zdjrvdMzkVZzg5ltMLJgDUf3kQGEbt7VpNc1fJ4vqzpB ofaILYgiBBFxonNbteXZMXphPYd5pw3eLotRf+sKZkX3PLgAhzAoUgYytdxfokjfrrPZ+/x+Zjo E/n9gatOmPVOWH9Rp+0nna0cQvvh+R/b217og1XSO8h02HFCxCeGf6mydMQoaUIXJtkazHjBOl2 AjDIYp6LGsb3pdabbJMI8ZdBWn4i5eSytZwJpSrgrOjUPTjjskfi8H4rLQ97sLSn0AXqrl7ATiP 43hxHAlg1IozTyB6/5lCCR1cfmGjSno2a5HZH7G2m3sk27hp1HAK/MXq+KzjR9Drq2ZfwaJNLjS LN0KHpX8T+bIspVLMuat3LymfIKWBi1KRw+Ex2v64SqwziDq/A1DFF+bYZW0mUj+AY1E3au28Cb /+RV9suGiG+5vDhX5Uyg/n8sgQIA80w+4qJ0cetpF4weyc/qg4ozEF68GbxDfSoc4dmgIj1/Cky hooEe6DGagq2jhM+c65fWIj6LK6IXx2yF+Z5JjxIDe2X70XtvEAr4JN73Ntir0= X-Received: by 2002:a05:6000:240a:b0:47d:f508:3364 with SMTP id ffacd0b85a97d-47fe81d732emr5887066f8f.15.1785833915981; Tue, 04 Aug 2026 01:58:35 -0700 (PDT) Received: from localhost (p200300f65f01710496a76592f11363a3.dip0.t-ipconnect.de. [2003:f6:5f01:7104:96a7:6592:f113:63a3]) by smtp.gmail.com with UTF8SMTPSA id ffacd0b85a97d-47fe9a3f516sm2984118f8f.17.2026.08.04.01.58.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Aug 2026 01:58:35 -0700 (PDT) From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig=20=28The=20Capable=20Hub=29?= To: Greg Kroah-Hartman , Jiri Slaby Cc: Rahul Bukte , linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org Subject: [PATCH v2 8/8] serial: 8250: pnp: Annotate init and exit functions for conditional discarding Date: Tue, 4 Aug 2026 10:58:00 +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=1067; i=u.kleine-koenig@baylibre.com; h=from:subject:message-id; bh=9b5hv7NuP99bZVltiQNQtGI97d1HD/5btdiVcCguw9s=; b=owEBbQGS/pANAwAKAY+A+1h9Ev5OAcsmYgBqcamlu5p3PXOIMm7ZGkDo+M8cuQ1Oq+++/vUWW DOgHUM0vvKJATMEAAEKAB0WIQQ/gaxpOnoeWYmt/tOPgPtYfRL+TgUCanGppQAKCRCPgPtYfRL+ TuPHB/4u/hPqhhxuhOxZ18/l8nozrCvf0HZOeFE79bSNKEV2sJNIb7lBbB9SJ+uH1R2r3InZSVF HxcZdVlc/VkzRj3hAhegGeysrH5sdk/F6wVrgYeGDBM19Y1CMaQyrPzhlueaEKoKKbZI0bIpc+o 3g8oAtWZDLsaLY+ehbAwEWHm1C7hT/MN8ZpQmshcQohrtOWQwVwdIdN8a6RLffy9mt6mm1vnwEe BNm1awiZUVAR8tgM4erkb+Q35J8fVwl0vAlKwCr8WF5RPw9Sn9NZPBZnVyPAh7DH4BHwQPiBJ0f hf6OY6tW7IFrmTRhxtn6PjXYGLXFrHwhTG46iVZK7/ySHWwh 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. Signed-off-by: Uwe Kleine-K=C3=B6nig (The Capable Hub) Acked-by: Andy Shevchenko --- 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