aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulia Lawall <Julia.Lawall@lip6.fr>2015-12-12 11:36:39 -0500
committerGuenter Roeck <linux@roeck-us.net>2015-12-18 11:20:59 -0500
commitc60fdf8587aef7d8907472242227735f1d5117b8 (patch)
treed637b98cbcc50d02b93a25281360de4bc3ae1c42
parent96818b5842fe8fc38aec74abcb3f8eb4da439bc7 (diff)
hwmon: (nct6683,nct6775) constify sensor_template_group structures
The sensor_template_group structures are never modified, so declare them as const. Done with the help of Coccinelle. Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
-rw-r--r--drivers/hwmon/nct6683.c11
-rw-r--r--drivers/hwmon/nct6775.c11
2 files changed, 12 insertions, 10 deletions
diff --git a/drivers/hwmon/nct6683.c b/drivers/hwmon/nct6683.c
index 37f01702d081..6cf392c22803 100644
--- a/drivers/hwmon/nct6683.c
+++ b/drivers/hwmon/nct6683.c
@@ -394,7 +394,8 @@ struct sensor_template_group {
394}; 394};
395 395
396static struct attribute_group * 396static struct attribute_group *
397nct6683_create_attr_group(struct device *dev, struct sensor_template_group *tg, 397nct6683_create_attr_group(struct device *dev,
398 const struct sensor_template_group *tg,
398 int repeat) 399 int repeat)
399{ 400{
400 struct sensor_device_attribute_2 *a2; 401 struct sensor_device_attribute_2 *a2;
@@ -703,7 +704,7 @@ static struct sensor_device_template *nct6683_attributes_in_template[] = {
703 NULL 704 NULL
704}; 705};
705 706
706static struct sensor_template_group nct6683_in_template_group = { 707static const struct sensor_template_group nct6683_in_template_group = {
707 .templates = nct6683_attributes_in_template, 708 .templates = nct6683_attributes_in_template,
708 .is_visible = nct6683_in_is_visible, 709 .is_visible = nct6683_in_is_visible,
709}; 710};
@@ -774,7 +775,7 @@ static struct sensor_device_template *nct6683_attributes_fan_template[] = {
774 NULL 775 NULL
775}; 776};
776 777
777static struct sensor_template_group nct6683_fan_template_group = { 778static const struct sensor_template_group nct6683_fan_template_group = {
778 .templates = nct6683_attributes_fan_template, 779 .templates = nct6683_attributes_fan_template,
779 .is_visible = nct6683_fan_is_visible, 780 .is_visible = nct6683_fan_is_visible,
780 .base = 1, 781 .base = 1,
@@ -902,7 +903,7 @@ static struct sensor_device_template *nct6683_attributes_temp_template[] = {
902 NULL 903 NULL
903}; 904};
904 905
905static struct sensor_template_group nct6683_temp_template_group = { 906static const struct sensor_template_group nct6683_temp_template_group = {
906 .templates = nct6683_attributes_temp_template, 907 .templates = nct6683_attributes_temp_template,
907 .is_visible = nct6683_temp_is_visible, 908 .is_visible = nct6683_temp_is_visible,
908 .base = 1, 909 .base = 1,
@@ -938,7 +939,7 @@ static struct sensor_device_template *nct6683_attributes_pwm_template[] = {
938 NULL 939 NULL
939}; 940};
940 941
941static struct sensor_template_group nct6683_pwm_template_group = { 942static const struct sensor_template_group nct6683_pwm_template_group = {
942 .templates = nct6683_attributes_pwm_template, 943 .templates = nct6683_attributes_pwm_template,
943 .is_visible = nct6683_pwm_is_visible, 944 .is_visible = nct6683_pwm_is_visible,
944 .base = 1, 945 .base = 1,
diff --git a/drivers/hwmon/nct6775.c b/drivers/hwmon/nct6775.c
index d7ebdf8651f5..d087a8e00cf5 100644
--- a/drivers/hwmon/nct6775.c
+++ b/drivers/hwmon/nct6775.c
@@ -1045,7 +1045,8 @@ struct sensor_template_group {
1045}; 1045};
1046 1046
1047static struct attribute_group * 1047static struct attribute_group *
1048nct6775_create_attr_group(struct device *dev, struct sensor_template_group *tg, 1048nct6775_create_attr_group(struct device *dev,
1049 const struct sensor_template_group *tg,
1049 int repeat) 1050 int repeat)
1050{ 1051{
1051 struct attribute_group *group; 1052 struct attribute_group *group;
@@ -1827,7 +1828,7 @@ static struct sensor_device_template *nct6775_attributes_in_template[] = {
1827 NULL 1828 NULL
1828}; 1829};
1829 1830
1830static struct sensor_template_group nct6775_in_template_group = { 1831static const struct sensor_template_group nct6775_in_template_group = {
1831 .templates = nct6775_attributes_in_template, 1832 .templates = nct6775_attributes_in_template,
1832 .is_visible = nct6775_in_is_visible, 1833 .is_visible = nct6775_in_is_visible,
1833}; 1834};
@@ -2046,7 +2047,7 @@ static struct sensor_device_template *nct6775_attributes_fan_template[] = {
2046 NULL 2047 NULL
2047}; 2048};
2048 2049
2049static struct sensor_template_group nct6775_fan_template_group = { 2050static const struct sensor_template_group nct6775_fan_template_group = {
2050 .templates = nct6775_attributes_fan_template, 2051 .templates = nct6775_attributes_fan_template,
2051 .is_visible = nct6775_fan_is_visible, 2052 .is_visible = nct6775_fan_is_visible,
2052 .base = 1, 2053 .base = 1,
@@ -2255,7 +2256,7 @@ static struct sensor_device_template *nct6775_attributes_temp_template[] = {
2255 NULL 2256 NULL
2256}; 2257};
2257 2258
2258static struct sensor_template_group nct6775_temp_template_group = { 2259static const struct sensor_template_group nct6775_temp_template_group = {
2259 .templates = nct6775_attributes_temp_template, 2260 .templates = nct6775_attributes_temp_template,
2260 .is_visible = nct6775_temp_is_visible, 2261 .is_visible = nct6775_temp_is_visible,
2261 .base = 1, 2262 .base = 1,
@@ -3117,7 +3118,7 @@ static struct sensor_device_template *nct6775_attributes_pwm_template[] = {
3117 NULL 3118 NULL
3118}; 3119};
3119 3120
3120static struct sensor_template_group nct6775_pwm_template_group = { 3121static const struct sensor_template_group nct6775_pwm_template_group = {
3121 .templates = nct6775_attributes_pwm_template, 3122 .templates = nct6775_attributes_pwm_template,
3122 .is_visible = nct6775_pwm_is_visible, 3123 .is_visible = nct6775_pwm_is_visible,
3123 .base = 1, 3124 .base = 1,