[openwrt/openwrt] treewide: add const to struct of_device_id

LEDE Commits lede-commits at lists.infradead.org
Sun Aug 31 10:22:10 PDT 2025


hauke pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/e1564c4fab103bb322cf8f73310e518bd81cf3fe

commit e1564c4fab103bb322cf8f73310e518bd81cf3fe
Author: Rosen Penev <rosenp at gmail.com>
AuthorDate: Wed Aug 27 17:34:01 2025 -0700

    treewide: add const to struct of_device_id
    
    Most drivers have this as const. Especially upstream in the kernel.
    
    Signed-off-by: Rosen Penev <rosenp at gmail.com>
    Link: https://github.com/openwrt/openwrt/pull/19911
    Signed-off-by: Hauke Mehrtens <hauke at hauke-m.de>
---
 package/kernel/gpio-button-hotplug/src/gpio-button-hotplug.c          | 4 ++--
 target/linux/generic/hack-6.12/800-GPIO-add-named-gpio-exports.patch  | 2 +-
 target/linux/generic/hack-6.6/800-GPIO-add-named-gpio-exports.patch   | 2 +-
 .../035-owrt-lantiq-wifi-and-ethernet-eeprom-handling.patch           | 2 +-
 .../linux/qualcommax/patches-6.12/0900-power-Add-Qualcomm-APM.patch   | 2 +-
 .../patches-6.12/0901-regulator-add-Qualcomm-CPR-regulators.patch     | 4 ++--
 6 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/package/kernel/gpio-button-hotplug/src/gpio-button-hotplug.c b/package/kernel/gpio-button-hotplug/src/gpio-button-hotplug.c
index ad2e0ca863..75f358a208 100644
--- a/package/kernel/gpio-button-hotplug/src/gpio-button-hotplug.c
+++ b/package/kernel/gpio-button-hotplug/src/gpio-button-hotplug.c
@@ -416,13 +416,13 @@ gpio_keys_get_devtree_pdata(struct device *dev)
 	return pdata;
 }
 
-static struct of_device_id gpio_keys_of_match[] = {
+static const struct of_device_id gpio_keys_of_match[] = {
 	{ .compatible = "gpio-keys", },
 	{ },
 };
 MODULE_DEVICE_TABLE(of, gpio_keys_of_match);
 
-static struct of_device_id gpio_keys_polled_of_match[] = {
+static const struct of_device_id gpio_keys_polled_of_match[] = {
 	{ .compatible = "gpio-keys-polled", },
 	{ },
 };
diff --git a/target/linux/generic/hack-6.12/800-GPIO-add-named-gpio-exports.patch b/target/linux/generic/hack-6.12/800-GPIO-add-named-gpio-exports.patch
index bf75cedafd..f9b540f0d6 100644
--- a/target/linux/generic/hack-6.12/800-GPIO-add-named-gpio-exports.patch
+++ b/target/linux/generic/hack-6.12/800-GPIO-add-named-gpio-exports.patch
@@ -22,7 +22,7 @@ Signed-off-by: John Crispin <blogic at openwrt.org>
 +
 +#ifdef CONFIG_GPIO_SYSFS
 +
-+static struct of_device_id gpio_export_ids[] = {
++static const struct of_device_id gpio_export_ids[] = {
 +	{ .compatible = "gpio-export" },
 +	{ /* sentinel */ }
 +};
diff --git a/target/linux/generic/hack-6.6/800-GPIO-add-named-gpio-exports.patch b/target/linux/generic/hack-6.6/800-GPIO-add-named-gpio-exports.patch
index 9c3696e76a..25fee9e060 100644
--- a/target/linux/generic/hack-6.6/800-GPIO-add-named-gpio-exports.patch
+++ b/target/linux/generic/hack-6.6/800-GPIO-add-named-gpio-exports.patch
@@ -22,7 +22,7 @@ Signed-off-by: John Crispin <blogic at openwrt.org>
 +
 +#ifdef CONFIG_GPIO_SYSFS
 +
-+static struct of_device_id gpio_export_ids[] = {
++static const struct of_device_id gpio_export_ids[] = {
 +	{ .compatible = "gpio-export" },
 +	{ /* sentinel */ }
 +};
diff --git a/target/linux/lantiq/patches-6.12/035-owrt-lantiq-wifi-and-ethernet-eeprom-handling.patch b/target/linux/lantiq/patches-6.12/035-owrt-lantiq-wifi-and-ethernet-eeprom-handling.patch
index 1044b6da28..5edb1d01dd 100644
--- a/target/linux/lantiq/patches-6.12/035-owrt-lantiq-wifi-and-ethernet-eeprom-handling.patch
+++ b/target/linux/lantiq/patches-6.12/035-owrt-lantiq-wifi-and-ethernet-eeprom-handling.patch
@@ -141,7 +141,7 @@ Signed-off-by: John Crispin <blogic at openwrt.org>
 +	return 0;
 +}
 +
-+static struct of_device_id ath5k_eeprom_ids[] = {
++static const struct of_device_id ath5k_eeprom_ids[] = {
 +	{ .compatible = "ath5k,eeprom" },
 +	{ }
 +};
diff --git a/target/linux/qualcommax/patches-6.12/0900-power-Add-Qualcomm-APM.patch b/target/linux/qualcommax/patches-6.12/0900-power-Add-Qualcomm-APM.patch
index a83408ba43..31443c566e 100644
--- a/target/linux/qualcommax/patches-6.12/0900-power-Add-Qualcomm-APM.patch
+++ b/target/linux/qualcommax/patches-6.12/0900-power-Add-Qualcomm-APM.patch
@@ -873,7 +873,7 @@ Signed-off-by: Robert Marko <robimarko at gmail.com>
 +
 +#endif
 +
-+static struct of_device_id msm_apm_match_table[] = {
++static const struct of_device_id msm_apm_match_table[] = {
 +	{
 +		.compatible = "qcom,msm-apm",
 +		.data = (void *)(uintptr_t)MSM8996_ID,
diff --git a/target/linux/qualcommax/patches-6.12/0901-regulator-add-Qualcomm-CPR-regulators.patch b/target/linux/qualcommax/patches-6.12/0901-regulator-add-Qualcomm-CPR-regulators.patch
index 8da64d2a89..64a4e9df0e 100644
--- a/target/linux/qualcommax/patches-6.12/0901-regulator-add-Qualcomm-CPR-regulators.patch
+++ b/target/linux/qualcommax/patches-6.12/0901-regulator-add-Qualcomm-CPR-regulators.patch
@@ -631,7 +631,7 @@ Signed-off-by: Robert Marko <robimarko at gmail.com>
 +	.cpr_clk_rate = IPQ9574_NPU_CPR_CLOCK_RATE,
 +};
 +
-+static struct of_device_id cpr3_regulator_match_table[] = {
++static const struct of_device_id cpr3_regulator_match_table[] = {
 +	{
 +		.compatible = "qcom,cpr3-ipq807x-npu-regulator",
 +		.data = &ipq807x_cpr_npu
@@ -11538,7 +11538,7 @@ Signed-off-by: Robert Marko <robimarko at gmail.com>
 +	.mem_acc_funcs = NULL,
 +};
 +
-+static struct of_device_id cpr4_regulator_match_table[] = {
++static const struct of_device_id cpr4_regulator_match_table[] = {
 +	{
 +		.compatible = "qcom,cpr4-ipq807x-apss-regulator",
 +		.data = &ipq807x_cpr_apss




More information about the lede-commits mailing list