diff options
author | Jean Delvare <khali@linux-fr.org> | 2011-05-25 14:43:31 -0400 |
---|---|---|
committer | Jean Delvare <khali@endymion.delvare> | 2011-05-25 14:43:31 -0400 |
commit | 95de3b257516d21af6e0313c7bab119e4f80d6f4 (patch) | |
tree | 818026064f6a1602e08521f5adaed3aed6313013 /drivers/hwmon/k8temp.c | |
parent | bc1f419c76a2d6450413ce4349f4e4a07be011d5 (diff) |
hwmon: Use helper functions to set and get driver data
Use helper functions to set and get driver data. This is more elegant.
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Andreas Herrmann <andreas.herrmann3@amd.com>
Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
Diffstat (limited to 'drivers/hwmon/k8temp.c')
-rw-r--r-- | drivers/hwmon/k8temp.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/hwmon/k8temp.c b/drivers/hwmon/k8temp.c index 418496f13020..b923bc2307ad 100644 --- a/drivers/hwmon/k8temp.c +++ b/drivers/hwmon/k8temp.c | |||
@@ -252,7 +252,7 @@ static int __devinit k8temp_probe(struct pci_dev *pdev, | |||
252 | 252 | ||
253 | data->name = "k8temp"; | 253 | data->name = "k8temp"; |
254 | mutex_init(&data->update_lock); | 254 | mutex_init(&data->update_lock); |
255 | dev_set_drvdata(&pdev->dev, data); | 255 | pci_set_drvdata(pdev, data); |
256 | 256 | ||
257 | /* Register sysfs hooks */ | 257 | /* Register sysfs hooks */ |
258 | err = device_create_file(&pdev->dev, | 258 | err = device_create_file(&pdev->dev, |
@@ -307,7 +307,7 @@ exit_remove: | |||
307 | &sensor_dev_attr_temp4_input.dev_attr); | 307 | &sensor_dev_attr_temp4_input.dev_attr); |
308 | device_remove_file(&pdev->dev, &dev_attr_name); | 308 | device_remove_file(&pdev->dev, &dev_attr_name); |
309 | exit_free: | 309 | exit_free: |
310 | dev_set_drvdata(&pdev->dev, NULL); | 310 | pci_set_drvdata(pdev, NULL); |
311 | kfree(data); | 311 | kfree(data); |
312 | exit: | 312 | exit: |
313 | return err; | 313 | return err; |
@@ -315,7 +315,7 @@ exit: | |||
315 | 315 | ||
316 | static void __devexit k8temp_remove(struct pci_dev *pdev) | 316 | static void __devexit k8temp_remove(struct pci_dev *pdev) |
317 | { | 317 | { |
318 | struct k8temp_data *data = dev_get_drvdata(&pdev->dev); | 318 | struct k8temp_data *data = pci_get_drvdata(pdev); |
319 | 319 | ||
320 | hwmon_device_unregister(data->hwmon_dev); | 320 | hwmon_device_unregister(data->hwmon_dev); |
321 | device_remove_file(&pdev->dev, | 321 | device_remove_file(&pdev->dev, |
@@ -327,7 +327,7 @@ static void __devexit k8temp_remove(struct pci_dev *pdev) | |||
327 | device_remove_file(&pdev->dev, | 327 | device_remove_file(&pdev->dev, |
328 | &sensor_dev_attr_temp4_input.dev_attr); | 328 | &sensor_dev_attr_temp4_input.dev_attr); |
329 | device_remove_file(&pdev->dev, &dev_attr_name); | 329 | device_remove_file(&pdev->dev, &dev_attr_name); |
330 | dev_set_drvdata(&pdev->dev, NULL); | 330 | pci_set_drvdata(pdev, NULL); |
331 | kfree(data); | 331 | kfree(data); |
332 | } | 332 | } |
333 | 333 | ||