gpio: xgs-iproc: Fix crash when driver is built as a module
Subsystems (3)
Jon Hunter
maintainerPATCH 1/1 gpio: xgs-iproc: Fix crash when driver is built as a module
Commit 6a41b6c5fc20 ("gpio: Add xgs-iproc driver") introduced a new GPIO driver for the Broadcom GPIO controller. When this driver is built as a module the following warning is observed because the bcm_iproc_gpio_of_match structure is defined with the __initconst attribute ...
MODPOST vmlinux.o
WARNING: vmlinux.o(.data+0x834d0): Section mismatch in reference from the variable bcm_iproc_gpio_driver to the variable .init.rodata:bcm_iproc_gpio_of_match
The variable bcm_iproc_gpio_driver references
the variable __initconst bcm_iproc_gpio_of_match
This then causes a translation fault on boot which and results in a system crash. Fix this by dropping the __initconst attribute from the bcm_iproc_gpio_of_match structure.
--- drivers/gpio/gpio-xgs-iproc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpio/gpio-xgs-iproc.c +1 -1
@@ -299,7 +299,7 @@ static int __exit iproc_gpio_remove(struct platform_device *pdev)return 0 ; } -static const struct of_device_id bcm_iproc_gpio_of_match[]__initconst = { +static const struct of_device_id bcm_iproc_gpio_of_match[] = { { .compatible ="brcm,iproc-gpio-cca" }, {} };
Signature · 1 line
2.17.1
Quoted 13 lines · Jon Hunter
Commit
6a41b6c5fc20("gpio: Add xgs-iproc driver") introduced a new GPIO driver for the Broadcom GPIO controller. When this driver is built as a module the following warning is observed because thebcm_iproc_gpio_of_matchstructure is defined with the__initconstattribute ...MODPOST vmlinux.o
WARNING:vmlinux.o(.data+0x834d0): Section mismatch in reference from the variablebcm_iproc_gpio_driverto the variable .init.rodata:bcm_iproc_gpio_of_match
The variablebcm_iproc_gpio_driverreferences
the variable__initconstbcm_iproc_gpio_of_match
Quoted 5 lines
This then causes a translation fault on boot which and results in a system crash. Fix this by dropping the
__initconstattribute from thebcm_iproc_gpio_of_matchstructure.Signed-off-by Jon Hunter <[email protected]>
Incidentally Mark Brown already sent an identical patch.
Thanks anyway!
Yours,
Linus Walleij