diff options
author | Axel Lin <axel.lin@ingics.com> | 2014-07-24 02:59:34 +0200 |
---|---|---|
committer | Guenter Roeck <linux@roeck-us.net> | 2014-08-04 16:01:40 +0200 |
commit | 55bdee69cda055a5df2e0499a7c8fa1915eaf8d5 (patch) | |
tree | e3e953c07abbd6d66f383b71d8a534482e5e2a8f /drivers/hwmon/nct6775.c | |
parent | hwmon: (nct6775) Update module description and Kconfig for NCT6106D and NCT6791D (diff) | |
download | linux-55bdee69cda055a5df2e0499a7c8fa1915eaf8d5.tar.xz linux-55bdee69cda055a5df2e0499a7c8fa1915eaf8d5.zip |
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>
Diffstat (limited to 'drivers/hwmon/nct6775.c')
-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 { enum kinds kind; const char *name; - int num_attr_groups; const struct attribute_group *groups[6]; 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) u8 cr2a; struct attribute_group *group; struct device *hwmon_dev; + int num_attr_groups = 0; res = platform_get_resource(pdev, IORESOURCE_IO, 0); if (!devm_request_region(&pdev->dev, res->start, IOREGION_LENGTH, @@ -3907,29 +3907,29 @@ static int nct6775_probe(struct platform_device *pdev) if (IS_ERR(group)) return PTR_ERR(group); - data->groups[data->num_attr_groups++] = group; + data->groups[num_attr_groups++] = group; group = nct6775_create_attr_group(dev, &nct6775_in_template_group, fls(data->have_in)); if (IS_ERR(group)) return PTR_ERR(group); - data->groups[data->num_attr_groups++] = group; + data->groups[num_attr_groups++] = group; group = nct6775_create_attr_group(dev, &nct6775_fan_template_group, fls(data->has_fan)); if (IS_ERR(group)) return PTR_ERR(group); - data->groups[data->num_attr_groups++] = group; + data->groups[num_attr_groups++] = group; group = nct6775_create_attr_group(dev, &nct6775_temp_template_group, fls(data->have_temp)); if (IS_ERR(group)) return PTR_ERR(group); - data->groups[data->num_attr_groups++] = group; - data->groups[data->num_attr_groups++] = &nct6775_group_other; + data->groups[num_attr_groups++] = group; + data->groups[num_attr_groups++] = &nct6775_group_other; hwmon_dev = devm_hwmon_device_register_with_groups(dev, data->name, data, data->groups); |