diff options
author | Axel Lin <axel.lin@ingics.com> | 2014-07-23 20:59:34 -0400 |
---|---|---|
committer | Guenter Roeck <linux@roeck-us.net> | 2014-08-04 10:01:40 -0400 |
commit | 55bdee69cda055a5df2e0499a7c8fa1915eaf8d5 (patch) | |
tree | e3e953c07abbd6d66f383b71d8a534482e5e2a8f | |
parent | 78313b9542b28474bd2a8e059c4fb6b690df8db2 (diff) |
hwmon: (nct6775) Remove num_attr_groups from struct nct6775_data
num_attr_groups is only used in nct6775_probe(), make it to be local variable.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
-rw-r--r-- | drivers/hwmon/nct6775.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/hwmon/nct6775.c b/drivers/hwmon/nct6775.c index 1c9865593177..504cbddbdd90 100644 --- a/drivers/hwmon/nct6775.c +++ b/drivers/hwmon/nct6775.c | |||
@@ -735,7 +735,6 @@ struct nct6775_data { | |||
735 | enum kinds kind; | 735 | enum kinds kind; |
736 | const char *name; | 736 | const char *name; |
737 | 737 | ||
738 | int num_attr_groups; | ||
739 | const struct attribute_group *groups[6]; | 738 | const struct attribute_group *groups[6]; |
740 | 739 | ||
741 | u16 reg_temp[5][NUM_TEMP]; /* 0=temp, 1=temp_over, 2=temp_hyst, | 740 | u16 reg_temp[5][NUM_TEMP]; /* 0=temp, 1=temp_over, 2=temp_hyst, |
@@ -3276,6 +3275,7 @@ static int nct6775_probe(struct platform_device *pdev) | |||
3276 | u8 cr2a; | 3275 | u8 cr2a; |
3277 | struct attribute_group *group; | 3276 | struct attribute_group *group; |
3278 | struct device *hwmon_dev; | 3277 | struct device *hwmon_dev; |
3278 | int num_attr_groups = 0; | ||
3279 | 3279 | ||
3280 | res = platform_get_resource(pdev, IORESOURCE_IO, 0); | 3280 | res = platform_get_resource(pdev, IORESOURCE_IO, 0); |
3281 | if (!devm_request_region(&pdev->dev, res->start, IOREGION_LENGTH, | 3281 | if (!devm_request_region(&pdev->dev, res->start, IOREGION_LENGTH, |
@@ -3907,29 +3907,29 @@ static int nct6775_probe(struct platform_device *pdev) | |||
3907 | if (IS_ERR(group)) | 3907 | if (IS_ERR(group)) |
3908 | return PTR_ERR(group); | 3908 | return PTR_ERR(group); |
3909 | 3909 | ||
3910 | data->groups[data->num_attr_groups++] = group; | 3910 | data->groups[num_attr_groups++] = group; |
3911 | 3911 | ||
3912 | group = nct6775_create_attr_group(dev, &nct6775_in_template_group, | 3912 | group = nct6775_create_attr_group(dev, &nct6775_in_template_group, |
3913 | fls(data->have_in)); | 3913 | fls(data->have_in)); |
3914 | if (IS_ERR(group)) | 3914 | if (IS_ERR(group)) |
3915 | return PTR_ERR(group); | 3915 | return PTR_ERR(group); |
3916 | 3916 | ||
3917 | data->groups[data->num_attr_groups++] = group; | 3917 | data->groups[num_attr_groups++] = group; |
3918 | 3918 | ||
3919 | group = nct6775_create_attr_group(dev, &nct6775_fan_template_group, | 3919 | group = nct6775_create_attr_group(dev, &nct6775_fan_template_group, |
3920 | fls(data->has_fan)); | 3920 | fls(data->has_fan)); |
3921 | if (IS_ERR(group)) | 3921 | if (IS_ERR(group)) |
3922 | return PTR_ERR(group); | 3922 | return PTR_ERR(group); |
3923 | 3923 | ||
3924 | data->groups[data->num_attr_groups++] = group; | 3924 | data->groups[num_attr_groups++] = group; |
3925 | 3925 | ||
3926 | group = nct6775_create_attr_group(dev, &nct6775_temp_template_group, | 3926 | group = nct6775_create_attr_group(dev, &nct6775_temp_template_group, |
3927 | fls(data->have_temp)); | 3927 | fls(data->have_temp)); |
3928 | if (IS_ERR(group)) | 3928 | if (IS_ERR(group)) |
3929 | return PTR_ERR(group); | 3929 | return PTR_ERR(group); |
3930 | 3930 | ||
3931 | data->groups[data->num_attr_groups++] = group; | 3931 | data->groups[num_attr_groups++] = group; |
3932 | data->groups[data->num_attr_groups++] = &nct6775_group_other; | 3932 | data->groups[num_attr_groups++] = &nct6775_group_other; |
3933 | 3933 | ||
3934 | hwmon_dev = devm_hwmon_device_register_with_groups(dev, data->name, | 3934 | hwmon_dev = devm_hwmon_device_register_with_groups(dev, data->name, |
3935 | data, data->groups); | 3935 | data, data->groups); |