pinctrl: mark const init data with __initconst instead of __initdata
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Fri, 30 Mar 2012 20:04:51 +0000 (22:04 +0200)
committerLinus Walleij <linus.walleij@linaro.org>
Wed, 18 Apr 2012 11:53:10 +0000 (13:53 +0200)
As long as there is no other non-const variable marked __initdata in the
same compilation unit it doesn't hurt. If there were one however
compilation would fail with

error: $variablename causes a section type conflict

because a section containing const variables is marked read only and so
cannot contain non-const variables.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Documentation/pinctrl.txt
drivers/pinctrl/pinctrl-coh901.c

index f2e27ef8e1b3b05f86576005352886a4bc74ad4f..2d88b3c7b61cd671154016c2a2649c4a29277dd7 100644 (file)
@@ -786,7 +786,7 @@ and spi on the second function mapping:
 
 #include <linux/pinctrl/machine.h>
 
-static const struct pinctrl_map __initdata mapping[] = {
+static const struct pinctrl_map mapping[] __initconst = {
        {
                .dev_name = "foo-spi.0",
                .name = PINCTRL_STATE_DEFAULT,
index 0797eba3e33a9041bbcd0d78f6d607dd4854ba3e..55697a5d74824acfb7e48e21a27de87512ae4735 100644 (file)
@@ -174,7 +174,7 @@ struct u300_gpio_confdata {
 
 
 /* Initial configuration */
-static const struct __initdata u300_gpio_confdata
+static const struct __initconst u300_gpio_confdata
 bs335_gpio_config[BS335_GPIO_NUM_PORTS][U300_GPIO_PINS_PER_PORT] = {
        /* Port 0, pins 0-7 */
        {
@@ -255,7 +255,7 @@ bs335_gpio_config[BS335_GPIO_NUM_PORTS][U300_GPIO_PINS_PER_PORT] = {
        }
 };
 
-static const struct __initdata u300_gpio_confdata
+static const struct __initconst u300_gpio_confdata
 bs365_gpio_config[BS365_GPIO_NUM_PORTS][U300_GPIO_PINS_PER_PORT] = {
        /* Port 0, pins 0-7 */
        {
This page took 0.030739 seconds and 5 git commands to generate.