* [PATCH v1 0/2] serial: sc16is7xx: Two simplifications
@ 2026-11-25 10:08 Uwe Kleine-König
2026-11-25 10:08 ` [PATCH v1 1/2] serial: sc16is7xx: Drop usage of <linux/mod_devicetable.h> Uwe Kleine-König
2026-11-25 10:08 ` [PATCH v1 2/2] serial: sc16is7xx: Drop unneeded __maybe_unused Uwe Kleine-König
0 siblings, 2 replies; 4+ messages in thread
From: Uwe Kleine-König @ 2026-11-25 10:08 UTC (permalink / raw)
To: Greg Kroah-Hartman, Jiri Slaby
Cc: Hugo Villeneuve, Paul Mbewe, Joachim Knorr, Martin Fuzzey,
Luca Fresi, linux-kernel, linux-serial
Hello,
the objective of the first patch is to prepare for the removal of
<linux/mod_devicetable.h>. The 2nd patch is just a patch opportunity I
noticed while working on the first patch.
The patches can be applied independantly if needed.
Best regards
Uwe
Uwe Kleine-König (2):
serial: sc16is7xx: Drop usage of <linux/mod_devicetable.h>
serial: sc16is7xx: Drop unneeded __maybe_unused
drivers/tty/serial/sc16is7xx.c | 2 +-
drivers/tty/serial/sc16is7xx.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
base-commit: 3dd8c790a7b7027abdd568e36db5e82ffaea7c77
--
2.47.3
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH v1 1/2] serial: sc16is7xx: Drop usage of <linux/mod_devicetable.h>
2026-11-25 10:08 [PATCH v1 0/2] serial: sc16is7xx: Two simplifications Uwe Kleine-König
@ 2026-11-25 10:08 ` Uwe Kleine-König
2026-11-25 10:08 ` [PATCH v1 2/2] serial: sc16is7xx: Drop unneeded __maybe_unused Uwe Kleine-König
1 sibling, 0 replies; 4+ messages in thread
From: Uwe Kleine-König @ 2026-11-25 10:08 UTC (permalink / raw)
To: Greg Kroah-Hartman, Jiri Slaby
Cc: Hugo Villeneuve, Paul Mbewe, Joachim Knorr, Martin Fuzzey,
Luca Fresi, linux-kernel, linux-serial
drivers/tty/serial/sc16is7xx.h only used of_device_id from the various
structures provided transitively by <linux/mod_devicetable.h>.
The consumers of drivers/tty/serial/sc16is7xx.h (i.e.
drivers/tty/serial/sc16is7xx{,_i2c,_spi}.c) only use of_device_id,
i2c_device_id and spi_device_id. The latter two are already provided by
<linux/i2c.h> and <linux/spi/spi.h> respectively. So it's enough to
replace the broad #include by <linux/device-id/of.h> in the header.
This reduces the amount of transitively included headers (and thus
useless build dependencies) a lot. (Supporting statistics on top of
next-20261124 for an x86_64 allmodconfig build:
before:
$ wc -l drivers/tty/serial/sc16is7xx.i drivers/tty/serial/.sc16is7xx.o.cmd
71313 drivers/tty/serial/sc16is7xx.i
1387 drivers/tty/serial/.sc16is7xx.o.cmd
after:
$ wc -l drivers/tty/serial/sc16is7xx.i drivers/tty/serial/.sc16is7xx.o.cmd
70392 drivers/tty/serial/sc16is7xx.i
1330 drivers/tty/serial/.sc16is7xx.o.cmd
)
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
---
drivers/tty/serial/sc16is7xx.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/tty/serial/sc16is7xx.h b/drivers/tty/serial/sc16is7xx.h
index 9c584d6d3593..fb3b23ae2aff 100644
--- a/drivers/tty/serial/sc16is7xx.h
+++ b/drivers/tty/serial/sc16is7xx.h
@@ -4,7 +4,7 @@
#ifndef _SC16IS7XX_H_
#define _SC16IS7XX_H_
-#include <linux/mod_devicetable.h>
+#include <linux/device-id/of.h>
#include <linux/regmap.h>
#include <linux/types.h>
--
2.47.3
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH v1 2/2] serial: sc16is7xx: Drop unneeded __maybe_unused
2026-11-25 10:08 [PATCH v1 0/2] serial: sc16is7xx: Two simplifications Uwe Kleine-König
2026-11-25 10:08 ` [PATCH v1 1/2] serial: sc16is7xx: Drop usage of <linux/mod_devicetable.h> Uwe Kleine-König
@ 2026-11-25 10:08 ` Uwe Kleine-König
2026-12-02 15:01 ` Hugo Villeneuve
1 sibling, 1 reply; 4+ messages in thread
From: Uwe Kleine-König @ 2026-11-25 10:08 UTC (permalink / raw)
To: Greg Kroah-Hartman, Jiri Slaby
Cc: Hugo Villeneuve, Paul Mbewe, Joachim Knorr, Martin Fuzzey,
Luca Fresi, linux-kernel, linux-serial
With `MODULE_DEVICE_TABLE(of, sc16is7xx_dt_ids);` the array is used
unconditionally since commit commit 5ab23c7923a1 ("modpost: Create
modalias for builtin modules"). So the __maybe_unused marker has no
relevant effect here and can be dropped.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
---
drivers/tty/serial/sc16is7xx.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/tty/serial/sc16is7xx.c b/drivers/tty/serial/sc16is7xx.c
index dbf38825a78c..afedb89018af 100644
--- a/drivers/tty/serial/sc16is7xx.c
+++ b/drivers/tty/serial/sc16is7xx.c
@@ -1745,7 +1745,7 @@ void sc16is7xx_remove(struct device *dev)
}
EXPORT_SYMBOL_GPL(sc16is7xx_remove);
-const struct of_device_id __maybe_unused sc16is7xx_dt_ids[] = {
+const struct of_device_id sc16is7xx_dt_ids[] = {
{ .compatible = "nxp,sc16is740", .data = &sc16is74x_devtype, },
{ .compatible = "nxp,sc16is741", .data = &sc16is74x_devtype, },
{ .compatible = "nxp,sc16is750", .data = &sc16is750_devtype, },
--
2.47.3
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v1 2/2] serial: sc16is7xx: Drop unneeded __maybe_unused
2026-11-25 10:08 ` [PATCH v1 2/2] serial: sc16is7xx: Drop unneeded __maybe_unused Uwe Kleine-König
@ 2026-12-02 15:01 ` Hugo Villeneuve
0 siblings, 0 replies; 4+ messages in thread
From: Hugo Villeneuve @ 2026-12-02 15:01 UTC (permalink / raw)
To: Uwe Kleine-König
Cc: Greg Kroah-Hartman, Jiri Slaby, Hugo Villeneuve, Paul Mbewe,
Joachim Knorr, Martin Fuzzey, Luca Fresi, linux-kernel,
linux-serial
Hi Uwe,
On Wed, 25 Nov 2026 11:08:39 +0100
Uwe Kleine-König <u.kleine-koenig@baylibre.com> wrote:
> With `MODULE_DEVICE_TABLE(of, sc16is7xx_dt_ids);` the array is used
> unconditionally since commit commit 5ab23c7923a1 ("modpost: Create
Only if you need to send a V2, you can drop the second "commit".
> modalias for builtin modules"). So the __maybe_unused marker has no
> relevant effect here and can be dropped.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
Reviewed-by: Hugo Villeneuve <hugo@hugovil.com>
As a side note, unrelated to this patch acceptance, I notice that
these drivers also still have __maybe_unused and could potentially also
be fixed?
clps711x.c
max310x.c
sh-sci.c
> ---
> drivers/tty/serial/sc16is7xx.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/tty/serial/sc16is7xx.c b/drivers/tty/serial/sc16is7xx.c
> index dbf38825a78c..afedb89018af 100644
> --- a/drivers/tty/serial/sc16is7xx.c
> +++ b/drivers/tty/serial/sc16is7xx.c
> @@ -1745,7 +1745,7 @@ void sc16is7xx_remove(struct device *dev)
> }
> EXPORT_SYMBOL_GPL(sc16is7xx_remove);
>
> -const struct of_device_id __maybe_unused sc16is7xx_dt_ids[] = {
> +const struct of_device_id sc16is7xx_dt_ids[] = {
> { .compatible = "nxp,sc16is740", .data = &sc16is74x_devtype, },
> { .compatible = "nxp,sc16is741", .data = &sc16is74x_devtype, },
> { .compatible = "nxp,sc16is750", .data = &sc16is750_devtype, },
> --
> 2.47.3
>
--
Hugo Villeneuve
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-12-02 15:01 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-25 10:08 [PATCH v1 0/2] serial: sc16is7xx: Two simplifications Uwe Kleine-König
2026-11-25 10:08 ` [PATCH v1 1/2] serial: sc16is7xx: Drop usage of <linux/mod_devicetable.h> Uwe Kleine-König
2026-11-25 10:08 ` [PATCH v1 2/2] serial: sc16is7xx: Drop unneeded __maybe_unused Uwe Kleine-König
2026-12-02 15:01 ` Hugo Villeneuve
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®