From: Rosen Penev Date: Thu, 23 Apr 2026 22:12:31 +0000 (-0700) Subject: treewide: remove usage of of_device.h X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=076eefdc2cb314ac9eeaf0efdc99037bdd028494;p=thirdparty%2Fopenwrt.git treewide: remove usage of of_device.h of_device.h was used only for of_match_device. That is no longer used in most places so we can drop the extra header. Signed-off-by: Rosen Penev Link: https://github.com/openwrt/openwrt/pull/23071 Signed-off-by: Jonas Jelonek --- diff --git a/package/kernel/lantiq/ltq-ptm/patches/103-add-missing-header-mod_devicetable.h.patch b/package/kernel/lantiq/ltq-ptm/patches/103-add-missing-header-mod_devicetable.h.patch deleted file mode 100644 index 811ecf920a8..00000000000 --- a/package/kernel/lantiq/ltq-ptm/patches/103-add-missing-header-mod_devicetable.h.patch +++ /dev/null @@ -1,26 +0,0 @@ -From: Shiji Yang -Date: Fri, 9 May 2025 02:36:31 +0800 -Subject: [PATCH] add missing header mod_devicetable.h - -Fix compilation error: - -/home/db/owrt/build_dir/target-mips_24kc_musl/linux-lantiq_xrx200/ltq-ptm-vr9/ltq-ptm/ifxmips_ptm_vdsl.c:969:34: error: array type has incomplete element type 'struct of_device_id' - 969 | static const struct of_device_id ltq_ptm_match[] = { - | ^~~~~~~~~~~~~ -/home/db/owrt/build_dir/target-mips_24kc_musl/linux-lantiq_xrx200/ltq-ptm-vr9/ltq-ptm/ifxmips_ptm_vdsl.c:969:34: error: 'ltq_ptm_match' defined but not used [-Werror=unused-variable] - -Signed-off-by: Shiji Yang ---- - ifxmips_ptm_vdsl.c | 1 + - 1 file changed, 1 insertion(+) - ---- a/ifxmips_ptm_vdsl.c -+++ b/ifxmips_ptm_vdsl.c -@@ -34,6 +34,7 @@ - #include - #include - #include -+#include - #include - #include - diff --git a/package/kernel/lantiq/ltq-ptm/patches/104-add-missing-header-mod_devicetable.h.patch b/package/kernel/lantiq/ltq-ptm/patches/104-add-missing-header-mod_devicetable.h.patch deleted file mode 100644 index 7e6d845def4..00000000000 --- a/package/kernel/lantiq/ltq-ptm/patches/104-add-missing-header-mod_devicetable.h.patch +++ /dev/null @@ -1,25 +0,0 @@ -From: Shiji Yang -Date: Fri, 9 May 2025 21:16:08 +0800 -Subject: [PATCH] add missing header "mod_devicetable.h" - -Fix compilation error: - -/home/db/owrt/build_dir/target-mips_24kc_musl/linux-lantiq_xway/ltq-ptm-danube/ltq-ptm/ifxmips_ptm_adsl.c:1433:34: error: array type has incomplete element type 'struct of_device_id' - 1433 | static const struct of_device_id ltq_ptm_match[] = { - | ^~~~~~~~~~~~~ - -Signed-off-by: Shiji Yang ---- - ifxmips_ptm_adsl.c | 1 + - 1 file changed, 1 insertion(+) - ---- a/ifxmips_ptm_adsl.c -+++ b/ifxmips_ptm_adsl.c -@@ -43,6 +43,7 @@ - #include - #include - #include -+#include - #include - #include - #include diff --git a/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_adsl.c b/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_adsl.c index e92a59001d9..ea0f4048cce 100644 --- a/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_adsl.c +++ b/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_adsl.c @@ -43,8 +43,8 @@ #include #include #include +#include #include -#include #include #include #include diff --git a/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_vdsl.c b/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_vdsl.c index 77876dce1cb..889e1c09a2f 100644 --- a/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_vdsl.c +++ b/package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_vdsl.c @@ -32,8 +32,8 @@ #include #include #include +#include #include -#include #include #include "ifxmips_ptm_vdsl.h" diff --git a/package/kernel/leds-gca230718/src/leds-gca230718.c b/package/kernel/leds-gca230718/src/leds-gca230718.c index 3451be16c2e..352de61c2d4 100644 --- a/package/kernel/leds-gca230718/src/leds-gca230718.c +++ b/package/kernel/leds-gca230718/src/leds-gca230718.c @@ -11,7 +11,6 @@ #include #include #include -#include #include #include #include diff --git a/package/kernel/leds-ws2812b/src/leds-ws2812b.c b/package/kernel/leds-ws2812b/src/leds-ws2812b.c index b0680f0429a..adb0899f1f4 100644 --- a/package/kernel/leds-ws2812b/src/leds-ws2812b.c +++ b/package/kernel/leds-ws2812b/src/leds-ws2812b.c @@ -13,7 +13,6 @@ #include #include #include -#include #include #include #include diff --git a/target/linux/ath79/files/drivers/gpio/gpio-rb4xx.c b/target/linux/ath79/files/drivers/gpio/gpio-rb4xx.c index ccb46f512f3..1eb25d006cc 100644 --- a/target/linux/ath79/files/drivers/gpio/gpio-rb4xx.c +++ b/target/linux/ath79/files/drivers/gpio/gpio-rb4xx.c @@ -17,7 +17,6 @@ #include #include #include -#include #include #include diff --git a/target/linux/ath79/files/drivers/mtd/nand/raw/ar934x_nand.c b/target/linux/ath79/files/drivers/mtd/nand/raw/ar934x_nand.c index 4fe9457b291..6127d746e16 100644 --- a/target/linux/ath79/files/drivers/mtd/nand/raw/ar934x_nand.c +++ b/target/linux/ath79/files/drivers/mtd/nand/raw/ar934x_nand.c @@ -21,7 +21,6 @@ #include #include #include -#include #include #define AR934X_NFC_DRIVER_NAME "ar934x-nand" @@ -1397,8 +1396,7 @@ static int ar934x_nfc_probe(struct platform_device *pdev) } nfc->parent = &pdev->dev; - nfc->swap_dma = of_property_read_bool(pdev->dev.of_node, - "qca,nand-swap-dma"); + nfc->swap_dma = device_property_present(&pdev->dev, "qca,nand-swap-dma"); nand = &nfc->nand_chip; mtd = nand_to_mtd(nand); diff --git a/target/linux/ath79/files/drivers/mtd/nand/raw/nand_rb4xx.c b/target/linux/ath79/files/drivers/mtd/nand/raw/nand_rb4xx.c index 4749e9f0505..163306edd93 100644 --- a/target/linux/ath79/files/drivers/mtd/nand/raw/nand_rb4xx.c +++ b/target/linux/ath79/files/drivers/mtd/nand/raw/nand_rb4xx.c @@ -18,7 +18,6 @@ #include #include #include -#include #include #include diff --git a/target/linux/ramips/patches-6.18/835-asoc-add-mt7620-support.patch b/target/linux/ramips/patches-6.18/835-asoc-add-mt7620-support.patch index d366c8302a8..f08c763bd0c 100644 --- a/target/linux/ramips/patches-6.18/835-asoc-add-mt7620-support.patch +++ b/target/linux/ramips/patches-6.18/835-asoc-add-mt7620-support.patch @@ -59,7 +59,7 @@ Signed-off-by: John Crispin +obj-$(CONFIG_SND_RALINK_SOC_I2S) += snd-soc-ralink-i2s.o --- /dev/null +++ b/sound/soc/ralink/ralink-i2s.c -@@ -0,0 +1,921 @@ +@@ -0,0 +1,916 @@ +/* + * Copyright (C) 2010, Lars-Peter Clausen + * Copyright (C) 2016 Michael Lee @@ -81,7 +81,6 @@ Signed-off-by: John Crispin +#include +#include +#include -+#include +#include +#include + @@ -848,14 +847,13 @@ Signed-off-by: John Crispin + +static int ralink_i2s_probe(struct platform_device *pdev) +{ -+ const struct of_device_id *match; + struct device_node *np = pdev->dev.of_node; + struct device *dev = &pdev->dev; + struct resource *res; + struct ralink_i2s *i2s; + int irq, ret; + u32 dma_req; -+ struct rt_i2s_data *data; ++ const struct rt_i2s_data *data; + + i2s = devm_kzalloc(dev, sizeof(*i2s), GFP_KERNEL); + if (!i2s) @@ -863,10 +861,7 @@ Signed-off-by: John Crispin + + i2s->dev = dev; + -+ match = of_match_device(ralink_i2s_match_table, dev); -+ if (!match) -+ return -EINVAL; -+ data = (struct rt_i2s_data *)match->data; ++ data = of_device_get_match_data(dev); + i2s->flags = data->flags; + /* setup out 12Mhz refclk to codec as mclk */ + if (data->refclk_setup)