pinctrl: make of_device_ids const
Subsystems (11)
PATCH v2 1/1 pinctrl: make of_device_ids const
of_device_ids (i.e. compatible strings and the respective data) are not supposed to change at runtime. All functions working with of_device_ids provided by <linux/of.h> work with const of_device_ids. This allows to mark all struct of_device_id below drivers/pinctrl const, too.
---
Hello,
I already sent a similar patch earlier (Message-Id:
1410380437-17960-1-git-send-email-u.kleine-koenig at pengutronix.de) but it conflicted with another similar patch.
This is rebased and adds several more (new) instances to fix.
Best regards
Uwe
drivers/pinctrl/freescale/pinctrl-vf610.c | 2 +- drivers/pinctrl/mvebu/pinctrl-armada-370.c | 2 +- drivers/pinctrl/mvebu/pinctrl-armada-375.c | 2 +- drivers/pinctrl/mvebu/pinctrl-armada-38x.c | 2 +- drivers/pinctrl/mvebu/pinctrl-armada-xp.c | 2 +- drivers/pinctrl/mvebu/pinctrl-kirkwood.c | 2 +- drivers/pinctrl/mvebu/pinctrl-orion.c | 2 +- drivers/pinctrl/pinctrl-as3722.c | 2 +- drivers/pinctrl/pinctrl-at91.c | 4 ++-- drivers/pinctrl/pinctrl-bcm2835.c | 2 +- drivers/pinctrl/pinctrl-palmas.c | 2 +- drivers/pinctrl/pinctrl-single.c | 4 ++-- drivers/pinctrl/pinctrl-st.c | 2 +- drivers/pinctrl/pinctrl-tz1090-pdc.c | 2 +- drivers/pinctrl/pinctrl-tz1090.c | 2 +- drivers/pinctrl/sunxi/pinctrl-sun4i-a10.c | 2 +- drivers/pinctrl/sunxi/pinctrl-sun5i-a10s.c | 2 +- drivers/pinctrl/sunxi/pinctrl-sun5i-a13.c | 2 +- drivers/pinctrl/sunxi/pinctrl-sun6i-a31-r.c | 2 +- drivers/pinctrl/sunxi/pinctrl-sun6i-a31.c | 2 +- drivers/pinctrl/sunxi/pinctrl-sun6i-a31s.c | 2 +- drivers/pinctrl/sunxi/pinctrl-sun7i-a20.c | 2 +- drivers/pinctrl/sunxi/pinctrl-sun8i-a23-r.c | 2 +- drivers/pinctrl/sunxi/pinctrl-sun8i-a23.c | 2 +- drivers/pinctrl/sunxi/pinctrl-sun9i-a80.c | 2 +- drivers/pinctrl/vt8500/pinctrl-vt8500.c | 2 +- drivers/pinctrl/vt8500/pinctrl-wm8505.c | 2 +- drivers/pinctrl/vt8500/pinctrl-wm8650.c | 2 +- drivers/pinctrl/vt8500/pinctrl-wm8750.c | 2 +- drivers/pinctrl/vt8500/pinctrl-wm8850.c | 2 +- 30 files changed, 32 insertions(+), 32 deletions(-)
drivers/pinctrl/freescale/pinctrl-vf610.c +1 -1
@@ -302,7 +302,7 @@ static struct imx_pinctrl_soc_info vf610_pinctrl_info = { .flags = SHARE_MUX_CONF_REG, }; -static struct of_device_id vf610_pinctrl_of_match[] = { +static const struct of_device_id vf610_pinctrl_of_match[] = { { .compatible ="fsl,vf610-iomuxc" , }, {/* sentinel */ } };
drivers/pinctrl/mvebu/pinctrl-armada-370.c +1 -1
@@ -379,7 +379,7 @@ static struct mvebu_mpp_mode mv88f6710_mpp_modes[] = {static struct mvebu_pinctrl_soc_info armada_370_pinctrl_info; -static struct of_device_id armada_370_pinctrl_of_match[] = { +static const struct of_device_id armada_370_pinctrl_of_match[] = { { .compatible ="marvell,mv88f6710-pinctrl" }, { }, };
drivers/pinctrl/mvebu/pinctrl-armada-375.c +1 -1
@@ -399,7 +399,7 @@ static struct mvebu_mpp_mode mv88f6720_mpp_modes[] = {static struct mvebu_pinctrl_soc_info armada_375_pinctrl_info; -static struct of_device_id armada_375_pinctrl_of_match[] = { +static const struct of_device_id armada_375_pinctrl_of_match[] = { { .compatible ="marvell,mv88f6720-pinctrl" }, { }, };
drivers/pinctrl/mvebu/pinctrl-armada-38x.c +1 -1
@@ -389,7 +389,7 @@ static struct mvebu_mpp_mode armada_38x_mpp_modes[] = {static struct mvebu_pinctrl_soc_info armada_38x_pinctrl_info; -static struct of_device_id armada_38x_pinctrl_of_match[] = { +static const struct of_device_id armada_38x_pinctrl_of_match[] = { { .compatible ="marvell,mv88f6810-pinctrl" , .data = (void *)V_88F6810 ,
drivers/pinctrl/mvebu/pinctrl-armada-xp.c +1 -1
@@ -361,7 +361,7 @@ static struct mvebu_mpp_mode armada_xp_mpp_modes[] = {static struct mvebu_pinctrl_soc_info armada_xp_pinctrl_info; -static struct of_device_id armada_xp_pinctrl_of_match[] = { +static const struct of_device_id armada_xp_pinctrl_of_match[] = { { .compatible ="marvell,mv78230-pinctrl" , .data = (void *)V_MV78230 ,
drivers/pinctrl/mvebu/pinctrl-kirkwood.c +1 -1
@@ -456,7 +456,7 @@ static struct mvebu_pinctrl_soc_info mv98dx4122_info = { .ngpioranges = ARRAY_SIZE(mv88f628x_gpio_ranges), }; -static struct of_device_id kirkwood_pinctrl_of_match[] = { +static const struct of_device_id kirkwood_pinctrl_of_match[] = { { .compatible ="marvell,88f6180-pinctrl" , .data = &mv88f6180_info }, { .compatible ="marvell,88f6190-pinctrl" , .data = &mv88f6190_info }, { .compatible ="marvell,88f6192-pinctrl" , .data = &mv88f6192_info },
drivers/pinctrl/mvebu/pinctrl-orion.c +1 -1
@@ -211,7 +211,7 @@ static struct mvebu_pinctrl_soc_info mv88f5281_info = {* There are multiple variants of the Orion SoCs, but in terms of pin * muxing, they are identical. */ -static struct of_device_id orion_pinctrl_of_match[] = { +static const struct of_device_id orion_pinctrl_of_match[] = { { .compatible ="marvell,88f5181l-pinctrl" , .data = &mv88f5181l_info }, { .compatible ="marvell,88f5182-pinctrl" , .data = &mv88f5182_info }, { .compatible ="marvell,88f5281-pinctrl" , .data = &mv88f5281_info },
drivers/pinctrl/pinctrl-as3722.c +1 -1
@@ -625,7 +625,7 @@ static int as3722_pinctrl_remove(struct platform_device *pdev)return 0 ; } -static struct of_device_id as3722_pinctrl_of_match[] = { +static const struct of_device_id as3722_pinctrl_of_match[] = { { .compatible ="ams,as3722-pinctrl" , }, { }, };
drivers/pinctrl/pinctrl-at91.c +2 -2
@@ -1114,7 +1114,7 @@ static int at91_pinctrl_parse_functions(struct device_node *np,return 0 ; } -static struct of_device_id at91_pinctrl_of_match[] = { +static const struct of_device_id at91_pinctrl_of_match[] = { { .compatible ="atmel,sama5d3-pinctrl" , .data = &sama5d3_ops }, { .compatible ="atmel,at91sam9x5-pinctrl" , .data = &at91sam9x5_ops }, { .compatible ="atmel,at91rm9200-pinctrl" , .data = &at91rm9200_ops },
@@ -1694,7 +1694,7 @@ static struct gpio_chip at91_gpio_template = { .ngpio = MAX_NB_GPIO_PER_BANK, }; -static struct of_device_id at91_gpio_of_match[] = { +static const struct of_device_id at91_gpio_of_match[] = { { .compatible ="atmel,at91sam9x5-gpio" , .data = &at91sam9x5_ops, }, { .compatible ="atmel,at91rm9200-gpio" , .data = &at91rm9200_ops }, {/* sentinel */ }
drivers/pinctrl/pinctrl-bcm2835.c +1 -1
@@ -1051,7 +1051,7 @@ static int bcm2835_pinctrl_remove(struct platform_device *pdev)return 0 ; } -static struct of_device_id bcm2835_pinctrl_match[] = { +static const struct of_device_id bcm2835_pinctrl_match[] = { { .compatible ="brcm,bcm2835-gpio" }, {} };
drivers/pinctrl/pinctrl-palmas.c +1 -1
@@ -987,7 +987,7 @@ static struct palmas_pinctrl_data tps80036_pinctrl_data = { .num_pin_groups = ARRAY_SIZE(tps80036_pingroups), }; -static struct of_device_id palmas_pinctrl_of_match[] = { +static const struct of_device_id palmas_pinctrl_of_match[] = { { .compatible ="ti,palmas-pinctrl" , .data = &tps65913_pinctrl_data}, { .compatible ="ti,tps65913-pinctrl" , .data = &tps65913_pinctrl_data}, { .compatible ="ti,tps80036-pinctrl" , .data = &tps80036_pinctrl_data},
drivers/pinctrl/pinctrl-single.c +2 -2
@@ -1501,7 +1501,7 @@ static void pcs_free_resources(struct pcs_device *pcs) } \ }while (0 ); -static struct of_device_id pcs_of_match[]; +static const struct of_device_id pcs_of_match[];static int pcs_add_gpio_func (struct device_node *node,struct pcs_device *pcs) {
@@ -2000,7 +2000,7 @@ static const struct pcs_soc_data pinconf_single = { .flags = PCS_FEAT_PINCONF, }; -static struct of_device_id pcs_of_match[] = { +static const struct of_device_id pcs_of_match[] = { { .compatible ="ti,omap3-padconf" , .data = &pinctrl_single_omap_wkup }, { .compatible ="ti,omap4-padconf" , .data = &pinctrl_single_omap_wkup }, { .compatible ="ti,omap5-padconf" , .data = &pinctrl_single_omap_wkup },
drivers/pinctrl/pinctrl-st.c +1 -1
@@ -1531,7 +1531,7 @@ static int st_gpiolib_register_bank(struct st_pinctrl *info,return 0 ; } -static struct of_device_id st_pctl_of_match[] = { +static const struct of_device_id st_pctl_of_match[] = { { .compatible ="st,stih415-sbc-pinctrl" , .data = &stih415_sbc_data }, { .compatible ="st,stih415-rear-pinctrl" , .data = &stih415_rear_data }, { .compatible ="st,stih415-left-pinctrl" , .data = &stih415_left_data },
drivers/pinctrl/pinctrl-tz1090-pdc.c +1 -1
@@ -969,7 +969,7 @@ static int tz1090_pdc_pinctrl_remove(struct platform_device *pdev)return 0 ; } -static struct of_device_id tz1090_pdc_pinctrl_of_match[] = { +static const struct of_device_id tz1090_pdc_pinctrl_of_match[] = { { .compatible ="img,tz1090-pdc-pinctrl" , }, { }, };
drivers/pinctrl/pinctrl-tz1090.c +1 -1
@@ -1984,7 +1984,7 @@ static int tz1090_pinctrl_remove(struct platform_device *pdev)return 0 ; } -static struct of_device_id tz1090_pinctrl_of_match[] = { +static const struct of_device_id tz1090_pinctrl_of_match[] = { { .compatible ="img,tz1090-pinctrl" , }, { }, };
drivers/pinctrl/sunxi/pinctrl-sun4i-a10.c +1 -1
@@ -1020,7 +1020,7 @@ static int sun4i_a10_pinctrl_probe(struct platform_device *pdev) &sun4i_a10_pinctrl_data); } -static struct of_device_id sun4i_a10_pinctrl_match[] = { +static const struct of_device_id sun4i_a10_pinctrl_match[] = { { .compatible ="allwinner,sun4i-a10-pinctrl" , }, {} };
drivers/pinctrl/sunxi/pinctrl-sun5i-a10s.c +1 -1
@@ -670,7 +670,7 @@ static int sun5i_a10s_pinctrl_probe(struct platform_device *pdev) &sun5i_a10s_pinctrl_data); } -static struct of_device_id sun5i_a10s_pinctrl_match[] = { +static const struct of_device_id sun5i_a10s_pinctrl_match[] = { { .compatible ="allwinner,sun5i-a10s-pinctrl" , }, {} };
drivers/pinctrl/sunxi/pinctrl-sun5i-a13.c +1 -1
@@ -388,7 +388,7 @@ static int sun5i_a13_pinctrl_probe(struct platform_device *pdev) &sun5i_a13_pinctrl_data); } -static struct of_device_id sun5i_a13_pinctrl_match[] = { +static const struct of_device_id sun5i_a13_pinctrl_match[] = { { .compatible ="allwinner,sun5i-a13-pinctrl" , }, {} };
drivers/pinctrl/sunxi/pinctrl-sun6i-a31-r.c +1 -1
@@ -120,7 +120,7 @@ static int sun6i_a31_r_pinctrl_probe(struct platform_device *pdev)return ret; } -static struct of_device_id sun6i_a31_r_pinctrl_match[] = { +static const struct of_device_id sun6i_a31_r_pinctrl_match[] = { { .compatible ="allwinner,sun6i-a31-r-pinctrl" , }, {} };
drivers/pinctrl/sunxi/pinctrl-sun6i-a31.c +1 -1
@@ -922,7 +922,7 @@ static int sun6i_a31_pinctrl_probe(struct platform_device *pdev) &sun6i_a31_pinctrl_data); } -static struct of_device_id sun6i_a31_pinctrl_match[] = { +static const struct of_device_id sun6i_a31_pinctrl_match[] = { { .compatible ="allwinner,sun6i-a31-pinctrl" , }, {} };
drivers/pinctrl/sunxi/pinctrl-sun6i-a31s.c +1 -1
@@ -794,7 +794,7 @@ static int sun6i_a31s_pinctrl_probe(struct platform_device *pdev) &sun6i_a31s_pinctrl_data); } -static struct of_device_id sun6i_a31s_pinctrl_match[] = { +static const struct of_device_id sun6i_a31s_pinctrl_match[] = { { .compatible ="allwinner,sun6i-a31s-pinctrl" , }, {} };
drivers/pinctrl/sunxi/pinctrl-sun7i-a20.c +1 -1
@@ -1045,7 +1045,7 @@ static int sun7i_a20_pinctrl_probe(struct platform_device *pdev) &sun7i_a20_pinctrl_data); } -static struct of_device_id sun7i_a20_pinctrl_match[] = { +static const struct of_device_id sun7i_a20_pinctrl_match[] = { { .compatible ="allwinner,sun7i-a20-pinctrl" , }, {} };
drivers/pinctrl/sunxi/pinctrl-sun8i-a23-r.c +1 -1
@@ -119,7 +119,7 @@ static int sun8i_a23_r_pinctrl_probe(struct platform_device *pdev)return ret; } -static struct of_device_id sun8i_a23_r_pinctrl_match[] = { +static const struct of_device_id sun8i_a23_r_pinctrl_match[] = { { .compatible ="allwinner,sun8i-a23-r-pinctrl" , }, {} };
drivers/pinctrl/sunxi/pinctrl-sun8i-a23.c +1 -1
@@ -571,7 +571,7 @@ static int sun8i_a23_pinctrl_probe(struct platform_device *pdev) &sun8i_a23_pinctrl_data); } -static struct of_device_id sun8i_a23_pinctrl_match[] = { +static const struct of_device_id sun8i_a23_pinctrl_match[] = { { .compatible ="allwinner,sun8i-a23-pinctrl" , }, {} };
drivers/pinctrl/sunxi/pinctrl-sun9i-a80.c +1 -1
@@ -729,7 +729,7 @@ static int sun9i_a80_pinctrl_probe(struct platform_device *pdev) &sun9i_a80_pinctrl_data); } -static struct of_device_id sun9i_a80_pinctrl_match[] = { +static const struct of_device_id sun9i_a80_pinctrl_match[] = { { .compatible ="allwinner,sun9i-a80-pinctrl" , }, {} };
drivers/pinctrl/vt8500/pinctrl-vt8500.c +1 -1
@@ -478,7 +478,7 @@ static int vt8500_pinctrl_remove(struct platform_device *pdev)return wmt_pinctrl_remove (pdev); } -static struct of_device_id wmt_pinctrl_of_match[] = { +static const struct of_device_id wmt_pinctrl_of_match[] = { { .compatible ="via,vt8500-pinctrl" }, {/* sentinel */ }, };
drivers/pinctrl/vt8500/pinctrl-wm8505.c +1 -1
@@ -509,7 +509,7 @@ static int wm8505_pinctrl_remove(struct platform_device *pdev)return wmt_pinctrl_remove (pdev); } -static struct of_device_id wmt_pinctrl_of_match[] = { +static const struct of_device_id wmt_pinctrl_of_match[] = { { .compatible ="wm,wm8505-pinctrl" }, {/* sentinel */ }, };
drivers/pinctrl/vt8500/pinctrl-wm8650.c +1 -1
@@ -347,7 +347,7 @@ static int wm8650_pinctrl_remove(struct platform_device *pdev)return wmt_pinctrl_remove (pdev); } -static struct of_device_id wmt_pinctrl_of_match[] = { +static const struct of_device_id wmt_pinctrl_of_match[] = { { .compatible ="wm,wm8650-pinctrl" }, {/* sentinel */ }, };
drivers/pinctrl/vt8500/pinctrl-wm8750.c +1 -1
@@ -386,7 +386,7 @@ static int wm8750_pinctrl_remove(struct platform_device *pdev)return wmt_pinctrl_remove (pdev); } -static struct of_device_id wmt_pinctrl_of_match[] = { +static const struct of_device_id wmt_pinctrl_of_match[] = { { .compatible ="wm,wm8750-pinctrl" }, {/* sentinel */ }, };
drivers/pinctrl/vt8500/pinctrl-wm8850.c +1 -1
@@ -365,7 +365,7 @@ static int wm8850_pinctrl_remove(struct platform_device *pdev)return wmt_pinctrl_remove (pdev); } -static struct of_device_id wmt_pinctrl_of_match[] = { +static const struct of_device_id wmt_pinctrl_of_match[] = { { .compatible ="wm,wm8850-pinctrl" }, {/* sentinel */ }, };
Signature · 1 line
2.1.4
PATCH v2 1/1 pinctrl: make of_device_ids const
Quoted 6 lines · Uwe Kleine-K?nig
of_device_ids(i.e. compatible strings and the respective data) are not supposed to change at runtime. All functions working withof_device_idsprovided by <linux/of.h> work with constof_device_ids. This allows to mark all structof_device_idbelowdrivers/pinctrlconst, too.Signed-off-by Uwe Kleine-K?nig <[email protected]>
I already have a patch like this from Fabian Frederick in my devel branch.
If some instances were missed by that patch please correct these and send a patch on top of my devel branch.
Yours,
Linus Walleij
Uwe Kleine-König
AppliedPATCH v2 1/1 pinctrl: make of_device_ids const
Quoted 8 lines · Linus Walleij
Quoted 5 lines · Uwe Kleine-K?nig
of_device_ids(i.e. compatible strings and the respective data) are not supposed to change at runtime. All functions working withof_device_idsprovided by <linux/of.h> work with constof_device_ids. This allows to mark all structof_device_idbelowdrivers/pinctrlconst, too.
Quoted 4 lines
Quoted 1 line
Signed-off-by Uwe Kleine-K?nig <[email protected]>I already have a patch like this from Fabian Frederick in my devel branch.
I applied my patch to today's next. The diffstat looks similar to the original submission. Also
git log linus/master..next/master --author=Fabian drivers/pinctrl
is empty?!
Best regards
Uwe
Signature · 2 lines
Pengutronix e.K. | Uwe Kleine-K?nig | Industrial Linux Solutions | http://www.pengutronix.de/ |