]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
treewide: remove usage of of_device.h 23071/head
authorRosen Penev <rosenp@gmail.com>
Thu, 23 Apr 2026 22:12:31 +0000 (15:12 -0700)
committerJonas Jelonek <jelonek.jonas@gmail.com>
Wed, 10 Jun 2026 07:03:11 +0000 (09:03 +0200)
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 <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/23071
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
package/kernel/lantiq/ltq-ptm/patches/103-add-missing-header-mod_devicetable.h.patch [deleted file]
package/kernel/lantiq/ltq-ptm/patches/104-add-missing-header-mod_devicetable.h.patch [deleted file]
package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_adsl.c
package/kernel/lantiq/ltq-ptm/src/ifxmips_ptm_vdsl.c
package/kernel/leds-gca230718/src/leds-gca230718.c
package/kernel/leds-ws2812b/src/leds-ws2812b.c
target/linux/ath79/files/drivers/gpio/gpio-rb4xx.c
target/linux/ath79/files/drivers/mtd/nand/raw/ar934x_nand.c
target/linux/ath79/files/drivers/mtd/nand/raw/nand_rb4xx.c
target/linux/ramips/patches-6.18/835-asoc-add-mt7620-support.patch

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 (file)
index 811ecf9..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-From: Shiji Yang <yangshiji66@outlook.com>
-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 <yangshiji66@outlook.com>
----
- 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 <linux/interrupt.h>
- #include <linux/netdevice.h>
- #include <linux/platform_device.h>
-+#include <linux/mod_devicetable.h>
- #include <linux/of_device.h>
- #include <linux/of_net.h>
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 (file)
index 7e6d845..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-From: Shiji Yang <yangshiji66@outlook.com>
-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 <yangshiji66@outlook.com>
----
- 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 <linux/ioctl.h>
- #include <linux/etherdevice.h>
- #include <linux/interrupt.h>
-+#include <linux/mod_devicetable.h>
- #include <linux/netdevice.h>
- #include <linux/platform_device.h>
- #include <linux/of_device.h>
index e92a59001d92f9ba070efa95571727308525ee1f..ea0f4048cce2dcc1e3f0843e7f4ac46571a80f8d 100644 (file)
@@ -43,8 +43,8 @@
 #include <linux/etherdevice.h>
 #include <linux/interrupt.h>
 #include <linux/netdevice.h>
+#include <linux/mod_devicetable.h>
 #include <linux/platform_device.h>
-#include <linux/of_device.h>
 #include <linux/of_net.h>
 #include <linux/uaccess.h>
 #include <linux/capability.h>
index 77876dce1cbf1025764bd0a6045270a26125ed65..889e1c09a2ff8e5a1eafa1b546c8087c04386992 100644 (file)
@@ -32,8 +32,8 @@
 #include <linux/etherdevice.h>
 #include <linux/interrupt.h>
 #include <linux/netdevice.h>
+#include <linux/mod_devicetable.h>
 #include <linux/platform_device.h>
-#include <linux/of_device.h>
 #include <linux/of_net.h>
 
 #include "ifxmips_ptm_vdsl.h"
index 3451be16c2e2cfbabde107f63fb85ed4dd9a3e99..352de61c2d469dc39cb3582b54e7a7710ae23991 100644 (file)
@@ -11,7 +11,6 @@
 #include <linux/led-class-multicolor.h>
 #include <linux/leds.h>
 #include <linux/module.h>
-#include <linux/of_device.h>
 #include <linux/property.h>
 #include <linux/i2c.h>
 #include <linux/mutex.h>
index b0680f0429a270b82f3e857c6941f62e618e9f99..adb0899f1f449fee2fcc27b4473b7f50b50d0879 100644 (file)
@@ -13,7 +13,6 @@
 #include <linux/led-class-multicolor.h>
 #include <linux/leds.h>
 #include <linux/module.h>
-#include <linux/of_device.h>
 #include <linux/property.h>
 #include <linux/spi/spi.h>
 #include <linux/mutex.h>
index ccb46f512f387e7b6e446f5b7c2a20c4bff5e484..1eb25d006cc4e88eb012ec315af2f4d9f1f75de0 100644 (file)
@@ -17,7 +17,6 @@
 #include <linux/platform_device.h>
 #include <linux/gpio/driver.h>
 #include <linux/module.h>
-#include <linux/of_device.h>
 #include <linux/version.h>
 
 #include <mfd/rb4xx-cpld.h>
index 4fe9457b291f5d9f76e843b6a6d2fba13d77cd33..6127d746e16e60554fca43c6367fb76c2269f295 100644 (file)
@@ -21,7 +21,6 @@
 #include <linux/delay.h>
 #include <linux/slab.h>
 #include <linux/of.h>
-#include <linux/of_device.h>
 #include <linux/reset.h>
 
 #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);
index 4749e9f050548aaa6e4e85c104b6a89ea789180f..163306edd930ddeb29c0767211495937e805c8cd 100644 (file)
@@ -18,7 +18,6 @@
 #include <linux/mtd/rawnand.h>
 #include <linux/gpio/consumer.h>
 #include <linux/module.h>
-#include <linux/of_device.h>
 #include <linux/version.h>
 
 #include <mfd/rb4xx-cpld.h>
index d366c8302a819b7acd36a707835b0a4838a75689..f08c763bd0c5d0de839e97f2e1ed1380a5df347b 100644 (file)
@@ -59,7 +59,7 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
 +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 <lars@metafoo.de>
 + *  Copyright (C) 2016 Michael Lee <igvtee@gmail.com>
@@ -81,7 +81,6 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
 +#include <linux/regmap.h>
 +#include <linux/reset.h>
 +#include <linux/debugfs.h>
-+#include <linux/of_device.h>
 +#include <sound/pcm_params.h>
 +#include <sound/dmaengine_pcm.h>
 +
@@ -848,14 +847,13 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
 +
 +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 <blogic@openwrt.org>
 +
 +      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)