pinctrl: mscc: fix multiple definitions
PATCH 1/1 pinctrl: mscc: fix multiple definitions
gcc-11 complains about multiple definitions:
/opt/gcc-11.0.20210426-nolibc/mips-linux/bin/mips-linux-ld.bfd: drivers/pinctrl/mscc/pinctrl-ocelot.o:drivers/pinctrl/mscc/mscc-common.h:64: multiple definition of `mscc_pinctrl_ops'; drivers/pinctrl/mscc/mscc-common.o:drivers/pinctrl/mscc/mscc-common.h:64: first defined here /opt/gcc-11.0.20210426-nolibc/mips-linux/bin/mips-linux-ld.bfd: drivers/pinctrl/mscc/pinctrl-ocelot.o:drivers/pinctrl/mscc/mscc-common.h:66: multiple definition of `mscc_gpio_ops'; drivers/pinctrl/mscc/mscc-common.o:drivers/pinctrl/mscc/mscc-common.h:66: first defined here
mscc_pinctrl_ops and mscc_gpio_ops are instantiated in mscc-common.c and just referenced by SoC specific pinctrl drivers. Annotate the exports in mscc-common.h with extern to avoid creating new instances when including mscc-common.h.
---
drivers/pinctrl/mscc/mscc-common.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/pinctrl/mscc/mscc-common.h +2 -2
@@ -61,6 +61,6 @@ int mscc_pinctrl_probe(struct udevice *dev, int num_func, const struct mscc_pin_data *mscc_pins, int num_pins, char * const *function_names, const unsigned long *mscc_gpios); -const struct pinctrl_ops mscc_pinctrl_ops; -const struct dm_gpio_ops mscc_gpio_ops; +extern const struct pinctrl_ops mscc_pinctrl_ops; +extern const struct dm_gpio_ops mscc_gpio_ops;
Signature · 1 line
2.31.1
PATCH 1/1 pinctrl: mscc: fix multiple definitions
Quoted 11 lines · Daniel Schwierzeck
gcc-11 complains about multiple definitions:
/opt/gcc-11.0.20210426-nolibc/mips-linux/bin/mips-linux-ld.bfd: drivers/pinctrl/mscc/pinctrl-ocelot.o:drivers/pinctrl/mscc/mscc-common.h:64: multiple definition of `mscc_pinctrl_ops'; drivers/pinctrl/mscc/mscc-common.o:drivers/pinctrl/mscc/mscc-common.h:64: first defined here/opt/gcc-11.0.20210426-nolibc/mips-linux/bin/mips-linux-ld.bfd: drivers/pinctrl/mscc/pinctrl-ocelot.o:drivers/pinctrl/mscc/mscc-common.h:66: multiple definition of `mscc_gpio_ops'; drivers/pinctrl/mscc/mscc-common.o:drivers/pinctrl/mscc/mscc-common.h:66: first defined here
mscc_pinctrl_opsandmscc_gpio_opsare instantiated inmscc-common.cand just referenced by SoC specific pinctrl drivers. Annotate the exports inmscc-common.hwithexternto avoid creating new instances when includingmscc-common.h.Signed-off-by Daniel Schwierzeck <[email protected]>
I posted this yesterday as part of:
https://patchwork.ozlabs.org/project/uboot/list/?series=241916&state=*
BTW.
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 659 bytes Desc: not available URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210504/c06bb22d/attachment.sig>
PATCH 1/1 pinctrl: mscc: fix multiple definitions
Am Dienstag, den 04.05.2021, 14:45 -0400 schrieb Tom Rini:
Quoted 22 lines · Daniel Schwierzeck
Quoted 21 lines
gcc-11 complains about multiple definitions:
/opt/gcc-11.0.20210426-nolibc/mips-linux/bin/mips-linux-ld.bfd:
drivers/pinctrl/mscc/pinctrl-ocelot.o:drivers/pinctrl/mscc/mscc- common.h:64: multiple definition of `mscc_pinctrl_ops'; drivers/pinctrl/mscc/mscc-common.o:drivers/pinctrl/mscc/mscc- common.h:64: first defined here/opt/gcc-11.0.20210426-nolibc/mips-linux/bin/mips-linux-ld.bfd:
drivers/pinctrl/mscc/pinctrl-ocelot.o:drivers/pinctrl/mscc/mscc- common.h:66: multiple definition of `mscc_gpio_ops'; drivers/pinctrl/mscc/mscc-common.o:drivers/pinctrl/mscc/mscc- common.h:66: first defined here
mscc_pinctrl_opsandmscc_gpio_opsare instantiated in mscc-common.cand
just referenced by SoC specific pinctrl drivers. Annotate the exports
inmscc-common.hwithexternto avoid creating new instances when includingmscc-common.h.
Quoted 5 lines
Quoted 1 line
Signed-off-by Daniel Schwierzeck <[email protected]>I posted this yesterday as part of:
https://patchwork.ozlabs.org/project/uboot/list/?series=241916&state=*
BTW.
okay, I only saw your patch 7/7 in my inbox ;)
Signature · 1 line
- Daniel