diff options
Diffstat (limited to 'drivers/hwmon')
-rw-r--r-- | drivers/hwmon/ds1621.c | 1 | ||||
-rw-r--r-- | drivers/hwmon/fam15h_power.c | 20 | ||||
-rw-r--r-- | drivers/hwmon/tmp103.c | 2 |
3 files changed, 21 insertions, 2 deletions
diff --git a/drivers/hwmon/ds1621.c b/drivers/hwmon/ds1621.c index fc6f5d54e7f7..8890870309e4 100644 --- a/drivers/hwmon/ds1621.c +++ b/drivers/hwmon/ds1621.c | |||
@@ -309,6 +309,7 @@ static ssize_t set_convrate(struct device *dev, struct device_attribute *da, | |||
309 | data->conf |= (resol << DS1621_REG_CONFIG_RESOL_SHIFT); | 309 | data->conf |= (resol << DS1621_REG_CONFIG_RESOL_SHIFT); |
310 | i2c_smbus_write_byte_data(client, DS1621_REG_CONF, data->conf); | 310 | i2c_smbus_write_byte_data(client, DS1621_REG_CONF, data->conf); |
311 | data->update_interval = ds1721_convrates[resol]; | 311 | data->update_interval = ds1721_convrates[resol]; |
312 | data->zbits = 7 - resol; | ||
312 | mutex_unlock(&data->update_lock); | 313 | mutex_unlock(&data->update_lock); |
313 | 314 | ||
314 | return count; | 315 | return count; |
diff --git a/drivers/hwmon/fam15h_power.c b/drivers/hwmon/fam15h_power.c index 4a7cbfad1d74..fcdbde4ec692 100644 --- a/drivers/hwmon/fam15h_power.c +++ b/drivers/hwmon/fam15h_power.c | |||
@@ -93,13 +93,29 @@ static ssize_t show_power_crit(struct device *dev, | |||
93 | } | 93 | } |
94 | static DEVICE_ATTR(power1_crit, S_IRUGO, show_power_crit, NULL); | 94 | static DEVICE_ATTR(power1_crit, S_IRUGO, show_power_crit, NULL); |
95 | 95 | ||
96 | static umode_t fam15h_power_is_visible(struct kobject *kobj, | ||
97 | struct attribute *attr, | ||
98 | int index) | ||
99 | { | ||
100 | /* power1_input is only reported for Fam15h, Models 00h-0fh */ | ||
101 | if (attr == &dev_attr_power1_input.attr && | ||
102 | (boot_cpu_data.x86 != 0x15 || boot_cpu_data.x86_model > 0xf)) | ||
103 | return 0; | ||
104 | |||
105 | return attr->mode; | ||
106 | } | ||
107 | |||
96 | static struct attribute *fam15h_power_attrs[] = { | 108 | static struct attribute *fam15h_power_attrs[] = { |
97 | &dev_attr_power1_input.attr, | 109 | &dev_attr_power1_input.attr, |
98 | &dev_attr_power1_crit.attr, | 110 | &dev_attr_power1_crit.attr, |
99 | NULL | 111 | NULL |
100 | }; | 112 | }; |
101 | 113 | ||
102 | ATTRIBUTE_GROUPS(fam15h_power); | 114 | static const struct attribute_group fam15h_power_group = { |
115 | .attrs = fam15h_power_attrs, | ||
116 | .is_visible = fam15h_power_is_visible, | ||
117 | }; | ||
118 | __ATTRIBUTE_GROUPS(fam15h_power); | ||
103 | 119 | ||
104 | static bool fam15h_power_is_internal_node0(struct pci_dev *f4) | 120 | static bool fam15h_power_is_internal_node0(struct pci_dev *f4) |
105 | { | 121 | { |
@@ -216,7 +232,9 @@ static int fam15h_power_probe(struct pci_dev *pdev, | |||
216 | 232 | ||
217 | static const struct pci_device_id fam15h_power_id_table[] = { | 233 | static const struct pci_device_id fam15h_power_id_table[] = { |
218 | { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_15H_NB_F4) }, | 234 | { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_15H_NB_F4) }, |
235 | { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_15H_M30H_NB_F4) }, | ||
219 | { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_16H_NB_F4) }, | 236 | { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_16H_NB_F4) }, |
237 | { PCI_VDEVICE(AMD, PCI_DEVICE_ID_AMD_16H_M30H_NB_F3) }, | ||
220 | {} | 238 | {} |
221 | }; | 239 | }; |
222 | MODULE_DEVICE_TABLE(pci, fam15h_power_id_table); | 240 | MODULE_DEVICE_TABLE(pci, fam15h_power_id_table); |
diff --git a/drivers/hwmon/tmp103.c b/drivers/hwmon/tmp103.c index e42964f07f67..ad571ec795a3 100644 --- a/drivers/hwmon/tmp103.c +++ b/drivers/hwmon/tmp103.c | |||
@@ -145,7 +145,7 @@ static int tmp103_probe(struct i2c_client *client, | |||
145 | } | 145 | } |
146 | 146 | ||
147 | i2c_set_clientdata(client, regmap); | 147 | i2c_set_clientdata(client, regmap); |
148 | hwmon_dev = hwmon_device_register_with_groups(dev, client->name, | 148 | hwmon_dev = devm_hwmon_device_register_with_groups(dev, client->name, |
149 | regmap, tmp103_groups); | 149 | regmap, tmp103_groups); |
150 | return PTR_ERR_OR_ZERO(hwmon_dev); | 150 | return PTR_ERR_OR_ZERO(hwmon_dev); |
151 | } | 151 | } |