hwmon: (w83627ehf) mark const init data with __initconst instead of __initdata
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Fri, 30 Mar 2012 20:04:55 +0000 (16:04 -0400)
committerGuenter Roeck <guenter.roeck@ericsson.com>
Sun, 1 Apr 2012 17:24:36 +0000 (10:24 -0700)
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: Jean Delvare <khali@linux-fr.org>
Cc: Guenter Roeck <guenter.roeck@ericsson.com>
Cc: lm-sensors@lm-sensors.org
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
drivers/hwmon/w83627ehf.c

index a25350cf9554d35cdfaa6131a0c0b2b02b3c9c44..54922ed129787df0e6a6c4fe92f0115d88d303b5 100644 (file)
@@ -2619,15 +2619,15 @@ static struct platform_driver w83627ehf_driver = {
 static int __init w83627ehf_find(int sioaddr, unsigned short *addr,
                                 struct w83627ehf_sio_data *sio_data)
 {
-       static const char __initdata sio_name_W83627EHF[] = "W83627EHF";
-       static const char __initdata sio_name_W83627EHG[] = "W83627EHG";
-       static const char __initdata sio_name_W83627DHG[] = "W83627DHG";
-       static const char __initdata sio_name_W83627DHG_P[] = "W83627DHG-P";
-       static const char __initdata sio_name_W83627UHG[] = "W83627UHG";
-       static const char __initdata sio_name_W83667HG[] = "W83667HG";
-       static const char __initdata sio_name_W83667HG_B[] = "W83667HG-B";
-       static const char __initdata sio_name_NCT6775[] = "NCT6775F";
-       static const char __initdata sio_name_NCT6776[] = "NCT6776F";
+       static const char sio_name_W83627EHF[] __initconst = "W83627EHF";
+       static const char sio_name_W83627EHG[] __initconst = "W83627EHG";
+       static const char sio_name_W83627DHG[] __initconst = "W83627DHG";
+       static const char sio_name_W83627DHG_P[] __initconst = "W83627DHG-P";
+       static const char sio_name_W83627UHG[] __initconst = "W83627UHG";
+       static const char sio_name_W83667HG[] __initconst = "W83667HG";
+       static const char sio_name_W83667HG_B[] __initconst = "W83667HG-B";
+       static const char sio_name_NCT6775[] __initconst = "NCT6775F";
+       static const char sio_name_NCT6776[] __initconst = "NCT6776F";
 
        u16 val;
        const char *sio_name;