sparc32: Fix section mismatch in leon_pci_grpci
authorSam Ravnborg <sam@ravnborg.org>
Sat, 24 Feb 2024 17:42:28 +0000 (18:42 +0100)
committerAndreas Larsson <andreas@gaisler.com>
Fri, 8 Mar 2024 20:21:00 +0000 (21:21 +0100)
Passing a datastructre marked _initconst to platform_driver_register()
is wrong. Drop the __initconst notation.

This fixes the following warnings:

WARNING: modpost: vmlinux: section mismatch in reference: grpci1_of_driver+0x30 (section: .data) -> grpci1_of_match (section: .init.rodata)
WARNING: modpost: vmlinux: section mismatch in reference: grpci2_of_driver+0x30 (section: .data) -> grpci2_of_match (section: .init.rodata)

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Andreas Larsson <andreas@gaisler.com>
Fixes: 4154bb821f0b ("sparc: leon: grpci1: constify of_device_id")
Fixes: 03949b1cb9f1 ("sparc: leon: grpci2: constify of_device_id")
Tested-by: Randy Dunlap <rdunlap@infradead.org> # build-tested
Reviewed-by: Andreas Larsson <andreas@gaisler.com>
Tested-by: Andreas Larsson <andreas@gaisler.com>
Signed-off-by: Andreas Larsson <andreas@gaisler.com>
Link: https://lore.kernel.org/r/20240224-sam-fix-sparc32-all-builds-v2-7-1f186603c5c4@ravnborg.org
arch/sparc/kernel/leon_pci_grpci1.c
arch/sparc/kernel/leon_pci_grpci2.c

index 8700a0e3b0df7d9c8ba29f763fe76bd3fbbc3f62..b2b639bee068485dba8ef2ac5daee9ad086f3385 100644 (file)
@@ -697,7 +697,7 @@ err1:
        return err;
 }
 
-static const struct of_device_id grpci1_of_match[] __initconst = {
+static const struct of_device_id grpci1_of_match[] = {
        {
         .name = "GAISLER_PCIFBRG",
         },
index 282b49d496ea389c6c6733cc953d61ed70fbc7ec..9f662340b5b2115ad047321a0c115b5e0c4852a7 100644 (file)
@@ -889,7 +889,7 @@ err1:
        return err;
 }
 
-static const struct of_device_id grpci2_of_match[] __initconst = {
+static const struct of_device_id grpci2_of_match[] = {
        {
         .name = "GAISLER_GRPCI2",
         },