diff options
author | NeilBrown <neilb@suse.de> | 2012-08-01 20:40:02 +1000 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2012-08-01 20:40:02 +1000 |
commit | bb181e2e48f8c85db08c9cb015cbba9618dbf05c (patch) | |
tree | 191bc24dd97bcb174535cc217af082f16da3b43d /drivers/hwmon/k8temp.c | |
parent | d57368afe63b3b7b45ce6c2b8c5276417935be2f (diff) | |
parent | c039c332f23e794deb6d6f37b9f07ff3b27fb2cf (diff) | |
download | talos-op-linux-bb181e2e48f8c85db08c9cb015cbba9618dbf05c.tar.gz talos-op-linux-bb181e2e48f8c85db08c9cb015cbba9618dbf05c.zip |
Merge commit 'c039c332f23e794deb6d6f37b9f07ff3b27fb2cf' into md
Pull in pre-requisites for adding raid10 support to dm-raid.
Diffstat (limited to 'drivers/hwmon/k8temp.c')
-rw-r--r-- | drivers/hwmon/k8temp.c | 25 |
1 files changed, 7 insertions, 18 deletions
diff --git a/drivers/hwmon/k8temp.c b/drivers/hwmon/k8temp.c index 35aac82ee8eb..49a69c5b3b8d 100644 --- a/drivers/hwmon/k8temp.c +++ b/drivers/hwmon/k8temp.c @@ -183,21 +183,17 @@ static int __devinit k8temp_probe(struct pci_dev *pdev, u8 model, stepping; struct k8temp_data *data; - data = kzalloc(sizeof(struct k8temp_data), GFP_KERNEL); - if (!data) { - err = -ENOMEM; - goto exit; - } + data = devm_kzalloc(&pdev->dev, sizeof(struct k8temp_data), GFP_KERNEL); + if (!data) + return -ENOMEM; model = boot_cpu_data.x86_model; stepping = boot_cpu_data.x86_mask; /* feature available since SH-C0, exclude older revisions */ - if (((model == 4) && (stepping == 0)) || - ((model == 5) && (stepping <= 1))) { - err = -ENODEV; - goto exit_free; - } + if ((model == 4 && stepping == 0) || + (model == 5 && stepping <= 1)) + return -ENODEV; /* * AMD NPT family 0fh, i.e. RevF and RevG: @@ -224,8 +220,7 @@ static int __devinit k8temp_probe(struct pci_dev *pdev, if (scfg & (SEL_PLACE | SEL_CORE)) { dev_err(&pdev->dev, "Configuration bit(s) stuck at 1!\n"); - err = -ENODEV; - goto exit_free; + return -ENODEV; } scfg |= (SEL_PLACE | SEL_CORE); @@ -307,10 +302,6 @@ exit_remove: device_remove_file(&pdev->dev, &sensor_dev_attr_temp4_input.dev_attr); device_remove_file(&pdev->dev, &dev_attr_name); -exit_free: - pci_set_drvdata(pdev, NULL); - kfree(data); -exit: return err; } @@ -328,8 +319,6 @@ static void __devexit k8temp_remove(struct pci_dev *pdev) device_remove_file(&pdev->dev, &sensor_dev_attr_temp4_input.dev_attr); device_remove_file(&pdev->dev, &dev_attr_name); - pci_set_drvdata(pdev, NULL); - kfree(data); } static struct pci_driver k8temp_driver = { |