Skip to contentSkip to conversation

pinctrl: sirf: mark of_device_id match table as __devinitconst

PATCH New Barry Song 3 participants 4 messages May 21, 2012 – Jun 10, 2012 Pin control

lore
Share & tools
lore

Barry Song

author
#0 lore raw

PATCH 1/1 pinctrl: sirf: mark of_device_id match table as __devinitconst

From: Barry Song <[email protected]>

---
 drivers/pinctrl/pinctrl-sirf.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/pinctrl/pinctrl-sirf.c +1 -1
index 6b3534c..5816cc3 100644
@@ -1192,7 +1192,7 @@ out_no_gpio_remap:
 	return ret;
 }
 
-static const struct of_device_id pinmux_ids[]  = {
+static const struct of_device_id pinmux_ids[] __devinitconst = {
 	{ .compatible = "sirf,prima2-gpio-pinmux" },
 	{}
 };
Signature · 6 lines
1.7.1



Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom
More information can be found at www.csr.com. Follow CSR on Twitter at http://twitter.com/CSR_PLC and read our blog at www.csr.com/blog
#1 lore raw

PATCH 1/1 pinctrl: sirf: mark of_device_id match table as __devinitconst

Quoted 6 lines · Barry Song

From: Barry Song <[email protected]>

---
?drivers/pinctrl/pinctrl-sirf.c | ? ?2 +-
?1 files changed, 1 insertions(+), 1 deletions(-)

Applied, thanks. I will be sending the first batch of fixes including this after v3.5-rc1 is out.

Yours,
Linus Walleij

#2 lore raw

PATCH 1/1 pinctrl: sirf: mark of_device_id match table as __devinitconst

In reply to Barry Song
Quoted 12 lines · Barry Song

From: Barry Song <[email protected]>

---
?drivers/pinctrl/pinctrl-sirf.c | ? ?2 +-
?1 files changed, 1 insertions(+), 1 deletions(-)

drivers/pinctrl/pinctrl-sirf.c +0 -0
index 6b3534c..5816cc3 100644

drivers/pinctrl/pinctrl-sirf.c out_no_gpio_remap: · line 1198

Quoted 8 lines
drivers/pinctrl/pinctrl-sirf.c +1 -1
@@ -1192,7 +1192,7 @@ out_no_gpio_remap:
 ? ? ? ?return ret;
 ?}
 
-static const struct of_device_id pinmux_ids[] ?= {
+static const struct of_device_id pinmux_ids[] __devinitconst = {
 ? ? ? ?{ .compatible = "sirf,prima2-gpio-pinmux" },
 ? ? ? ?{}
 ?};

Hm Uwe poked me about this change, Barry are you sure the DT ID table can be __devinitconst? I would think so, but better check again.

Yours,
Linus Walleij

#3 lore raw

PATCH 1/1 pinctrl: sirf: mark of_device_id match table as __devinitconst

Hi Linus,

2012/6/7 Linus Walleij <[email protected]>:

Quoted 17 lines · Barry Song
Quoted 16 lines

From: Barry Song <[email protected]>

---
?drivers/pinctrl/pinctrl-sirf.c | ? ?2 +-
?1 files changed, 1 insertions(+), 1 deletions(-)

drivers/pinctrl/pinctrl-sirf.c +0 -0
index 6b3534c..5816cc3 100644
@@ -1192,7 +1192,7 @@ out_no_gpio_remap:
 ? ? ? ?return ret;
 ?}
 
Quoted 9 lines

drivers/pinctrl/pinctrl-sirf.c out_no_gpio_remap: · line 1198

Quoted 5 lines
drivers/pinctrl/pinctrl-sirf.c +1 -1
-static const struct of_device_id pinmux_ids[] ?= {
+static const struct of_device_id pinmux_ids[] __devinitconst = {
 ? ? ? ?{ .compatible = "sirf,prima2-gpio-pinmux" },
 ? ? ? ?{}
 ?};

Hm Uwe poked me about this change, Barry are you sure the DT ID table can be __devinitconst? I would think so, but better check again.

__devinitconst is defined as __section(.devinit.rodata). at the same time, .devinit sections are used for hotplug and __devinit is often added as the head of probe() functions.

the devinit/devinitdata will be released after system initilizes when the system dose not support HOTPLUG, without HOTPLUG, devinit = init. If the system enables CONFIG_HOTPLUG, devinitdata, typical including device table, should be useful all the time along. then it seems devinitconst is better for usb_device_id, pci_device_id, sdio_device_id.

of_device_id is not too much related with HOTPLUG, so I am not 100% sure it is the good place to use devinitconst for of match table, but if we grep, lots of drivers have used it:

drivers/amba/tegra-ahb.c
272 static const struct of_device_id tegra_ahb_of_match[] __devinitconst = { drivers/block/xsysace.c
1193 static const struct of_device_id ace_of_match[] __devinitconst = { drivers/char/xilinx_hwicap/xilinx_hwicap.c
788 static const struct of_device_id __devinitconst hwicap_of_match[]; 832 static const struct of_device_id __devinitconst hwicap_of_match[] = { drivers/clocksource/em_sti.c
387 static const struct of_device_id em_sti_dt_ids[] __devinitconst = { drivers/i2c/busses/i2c-sh_mobile.c
717 static const struct of_device_id sh_mobile_i2c_dt_ids[] __devinitconst = { drivers/i2c/busses/i2c-sirf.c
436 static const struct of_device_id sirfsoc_i2c_of_match[] __devinitconst = { drivers/i2c/busses/i2c-tegra.c
755 static const struct of_device_id tegra_i2c_of_match[] __devinitconst = { drivers/i2c/busses/i2c-xiic.c
803 static const struct of_device_id xiic_of_match[] __devinitconst = { drivers/i2c/muxes/i2c-mux-pinctrl.c
258 static const struct of_device_id i2c_mux_pinctrl_of_match[] __devinitconst = {

74 static const struct mpr121_init_register init_reg_table[] __devinitconst = { drivers/input/serio/xilinx_ps2.c
358 static const struct of_device_id xps2_of_match[] __devinitconst = { drivers/input/touchscreen/st1232.c
258 static const struct of_device_id st1232_ts_dt_ids[] __devinitconst = { drivers/memory/tegra20-mc.c
184 static const struct of_device_id tegra20_mc_of_match[] __devinitconst = { drivers/memory/tegra30-mc.c
306 static const struct of_device_id tegra30_mc_of_match[] __devinitconst = { drivers/power/olpc_battery.c
616 static const struct of_device_id olpc_battery_ids[] __devinitconst = { drivers/regulator/fixed.c
294 static const struct of_device_id fixed_of_match[] __devinitconst = { drivers/regulator/twl-regulator.c
1115 static const struct of_device_id twl_of_match[] __devinitconst = { drivers/spi/spi-mpc52xx.c
549 static const struct of_device_id mpc52xx_spi_match[] __devinitconst = { drivers/staging/nvec/nvec.c
914 static const struct of_device_id nvidia_nvec_of_match[] __devinitconst = {
...

sound/soc/tegra/tegra30_i2s.c
510 static const struct of_device_id tegra30_i2s_of_match[] __devinitconst = { 515 static const struct dev_pm_ops tegra30_i2s_pm_ops __devinitconst = { sound/soc/tegra/tegra_alc5632.c
250 static const struct of_device_id tegra_alc5632_of_match[] __devinitconst = { sound/soc/tegra/tegra_wm8753.c
203 static const struct of_device_id tegra_wm8753_of_match[] __devinitconst = { sound/soc/tegra/tegra_wm8903.c
491 static const struct of_device_id tegra_wm8903_of_match[] __devinitconst = { sound/soc/tegra/trimslice.c
214 static const struct of_device_id trimslice_of_match[] __devinitconst = {

Quoted 3 lines

Yours,
Linus Walleij

Thanks
barry