aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/sis5595.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/hwmon/sis5595.c')
-rw-r--r--drivers/hwmon/sis5595.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/drivers/hwmon/sis5595.c b/drivers/hwmon/sis5595.c
index 92956eb3f3c1..860b71ccbb86 100644
--- a/drivers/hwmon/sis5595.c
+++ b/drivers/hwmon/sis5595.c
@@ -163,7 +163,7 @@ static inline u8 DIV_TO_REG(int val)
163struct sis5595_data { 163struct sis5595_data {
164 unsigned short addr; 164 unsigned short addr;
165 const char *name; 165 const char *name;
166 struct class_device *class_dev; 166 struct device *hwmon_dev;
167 struct mutex lock; 167 struct mutex lock;
168 168
169 struct mutex update_lock; 169 struct mutex update_lock;
@@ -517,7 +517,7 @@ static int __devinit sis5595_probe(struct platform_device *pdev)
517 platform_set_drvdata(pdev, data); 517 platform_set_drvdata(pdev, data);
518 518
519 /* Check revision and pin registers to determine whether 4 or 5 voltages */ 519 /* Check revision and pin registers to determine whether 4 or 5 voltages */
520 pci_read_config_byte(s_bridge, PCI_REVISION_ID, &data->revision); 520 data->revision = s_bridge->revision;
521 /* 4 voltages, 1 temp */ 521 /* 4 voltages, 1 temp */
522 data->maxins = 3; 522 data->maxins = 3;
523 if (data->revision >= REV2MIN) { 523 if (data->revision >= REV2MIN) {
@@ -557,9 +557,9 @@ static int __devinit sis5595_probe(struct platform_device *pdev)
557 goto exit_remove_files; 557 goto exit_remove_files;
558 } 558 }
559 559
560 data->class_dev = hwmon_device_register(&pdev->dev); 560 data->hwmon_dev = hwmon_device_register(&pdev->dev);
561 if (IS_ERR(data->class_dev)) { 561 if (IS_ERR(data->hwmon_dev)) {
562 err = PTR_ERR(data->class_dev); 562 err = PTR_ERR(data->hwmon_dev);
563 goto exit_remove_files; 563 goto exit_remove_files;
564 } 564 }
565 565
@@ -580,7 +580,7 @@ static int __devexit sis5595_remove(struct platform_device *pdev)
580{ 580{
581 struct sis5595_data *data = platform_get_drvdata(pdev); 581 struct sis5595_data *data = platform_get_drvdata(pdev);
582 582
583 hwmon_device_unregister(data->class_dev); 583 hwmon_device_unregister(data->hwmon_dev);
584 sysfs_remove_group(&pdev->dev.kobj, &sis5595_group); 584 sysfs_remove_group(&pdev->dev.kobj, &sis5595_group);
585 sysfs_remove_group(&pdev->dev.kobj, &sis5595_group_opt); 585 sysfs_remove_group(&pdev->dev.kobj, &sis5595_group_opt);
586 586
@@ -739,11 +739,10 @@ static int __devinit sis5595_pci_probe(struct pci_dev *dev,
739 int *i; 739 int *i;
740 740
741 for (i = blacklist; *i != 0; i++) { 741 for (i = blacklist; *i != 0; i++) {
742 struct pci_dev *dev; 742 struct pci_dev *d;
743 dev = pci_get_device(PCI_VENDOR_ID_SI, *i, NULL); 743 if ((d = pci_get_device(PCI_VENDOR_ID_SI, *i, NULL))) {
744 if (dev) { 744 dev_err(&d->dev, "Looked for SIS5595 but found unsupported device %.4x\n", *i);
745 dev_err(&dev->dev, "Looked for SIS5595 but found unsupported device %.4x\n", *i); 745 pci_dev_put(d);
746 pci_dev_put(dev);
747 return -ENODEV; 746 return -ENODEV;
748 } 747 }
749 } 748 }