aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2011-11-29 06:52:39 -0500
committerLinus Walleij <linus.walleij@linaro.org>2012-01-03 03:10:02 -0500
commit97607d157c133ab18dfcd77fa836e37fa950a44a (patch)
treef9ac62a9534295f24ab40a2890bfd285bc157a03 /Documentation
parent542e704f3ffee1dc4539c9e8191e4dc215220f5e (diff)
pinctrl: make a copy of pinmux map
This makes a deep copy of the pinmux function map instead of keeping the copy supplied from the platform around. This makes it possible to tag the platforms map with __initdata as is also done as part of this patch. Rationale: a certain target platform (PXA) has numerous pinmux maps, many of which will be lying around unused after boot in a multi-platform binary. Instead, deep-copy the one we're going to use and tag them all __initdata so they go away after boot. ChangeLog v1->v2: - Fixup the deep copy, missed a few items on the struct, plus mark bool member non-const since we're making runtime copies if this stuff now. ChangeLog v2->v3: - Make a shallow copy (just copy the array of map structs) as Arnd noticed, string constants never get discarded by the kernel anyway, so these pointers may be safely copied over. Reviewed-by: Arnd Bergmann <arnd.bergmann@linaro.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/pinctrl.txt4
1 files changed, 2 insertions, 2 deletions
diff --git a/Documentation/pinctrl.txt b/Documentation/pinctrl.txt
index 3846264c5973..c8fd136eac83 100644
--- a/Documentation/pinctrl.txt
+++ b/Documentation/pinctrl.txt
@@ -697,7 +697,7 @@ spi on the second function mapping:
697 697
698#include <linux/pinctrl/machine.h> 698#include <linux/pinctrl/machine.h>
699 699
700static const struct pinmux_map pmx_mapping[] = { 700static const struct pinmux_map __initdata pmx_mapping[] = {
701 { 701 {
702 .ctrl_dev_name = "pinctrl.0", 702 .ctrl_dev_name = "pinctrl.0",
703 .function = "spi0", 703 .function = "spi0",
@@ -734,7 +734,7 @@ Since the above construct is pretty common there is a helper macro to make
734it even more compact which assumes you want to use pinctrl.0 and position 734it even more compact which assumes you want to use pinctrl.0 and position
7350 for mapping, for example: 7350 for mapping, for example:
736 736
737static struct pinmux_map pmx_mapping[] = { 737static struct pinmux_map __initdata pmx_mapping[] = {
738 PINMUX_MAP_PRIMARY("I2CMAP", "i2c0", "foo-i2c.0"), 738 PINMUX_MAP_PRIMARY("I2CMAP", "i2c0", "foo-i2c.0"),
739}; 739};
740 740