aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/smsc47m1.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-19 17:24:57 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-19 17:24:57 -0400
commit40b42f1ebf653cd72c32eb1a1a0b9fea2dfbfd7d (patch)
tree6a2adfcd8412189932a372ce25def8611e287b5c /drivers/hwmon/smsc47m1.c
parent5a021e9ffd56c22700133ebc37d607f95be8f7bd (diff)
parente24b8cb4fa2bb779bdf48656152366b6f52f748f (diff)
Merge branch 'release' of git://lm-sensors.org/kernel/mhoffman/hwmon-2.6
* 'release' of git://lm-sensors.org/kernel/mhoffman/hwmon-2.6: (44 commits) i2c: Delete the i2c-isa pseudo bus driver hwmon: refuse to load abituguru driver on non-Abit boards hwmon: fix Abit Uguru3 driver detection on some motherboards hwmon/w83627ehf: Be quiet when no chip is found hwmon/w83627ehf: No need to initialize fan_min hwmon/w83627ehf: Export the thermal sensor types hwmon/w83627ehf: Enable VBAT monitoring hwmon/w83627ehf: Add support for the VID inputs hwmon/w83627ehf: Fix timing issues hwmon/w83627ehf: Add error messages for two error cases hwmon/w83627ehf: Convert to a platform driver hwmon/w83627ehf: Update the Kconfig entry make coretemp_device_remove() static hwmon: Add LM93 support hwmon: Improve the pwmN_enable documentation hwmon/smsc47b397: Don't report missing fans as spinning at 82 RPM hwmon: Add support for newer uGuru's hwmon/f71805f: Add temperature-tracking fan control mode hwmon/w83627ehf: Preserve speed reading when changing fan min hwmon: fix detection of abituguru volt inputs ... Manual fixup of trivial conflict in MAINTAINERS file
Diffstat (limited to 'drivers/hwmon/smsc47m1.c')
-rw-r--r--drivers/hwmon/smsc47m1.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/drivers/hwmon/smsc47m1.c b/drivers/hwmon/smsc47m1.c
index 1e21c8cc948f..1de2f2be8708 100644
--- a/drivers/hwmon/smsc47m1.c
+++ b/drivers/hwmon/smsc47m1.c
@@ -597,6 +597,7 @@ static int __devinit smsc47m1_probe(struct platform_device *pdev)
597error_remove_files: 597error_remove_files:
598 sysfs_remove_group(&dev->kobj, &smsc47m1_group); 598 sysfs_remove_group(&dev->kobj, &smsc47m1_group);
599error_free: 599error_free:
600 platform_set_drvdata(pdev, NULL);
600 kfree(data); 601 kfree(data);
601error_release: 602error_release:
602 release_region(res->start, SMSC_EXTENT); 603 release_region(res->start, SMSC_EXTENT);
@@ -608,12 +609,12 @@ static int __devexit smsc47m1_remove(struct platform_device *pdev)
608 struct smsc47m1_data *data = platform_get_drvdata(pdev); 609 struct smsc47m1_data *data = platform_get_drvdata(pdev);
609 struct resource *res; 610 struct resource *res;
610 611
611 platform_set_drvdata(pdev, NULL);
612 hwmon_device_unregister(data->class_dev); 612 hwmon_device_unregister(data->class_dev);
613 sysfs_remove_group(&pdev->dev.kobj, &smsc47m1_group); 613 sysfs_remove_group(&pdev->dev.kobj, &smsc47m1_group);
614 614
615 res = platform_get_resource(pdev, IORESOURCE_IO, 0); 615 res = platform_get_resource(pdev, IORESOURCE_IO, 0);
616 release_region(res->start, SMSC_EXTENT); 616 release_region(res->start, SMSC_EXTENT);
617 platform_set_drvdata(pdev, NULL);
617 kfree(data); 618 kfree(data);
618 619
619 return 0; 620 return 0;
@@ -693,15 +694,12 @@ static int __init smsc47m1_device_add(unsigned short address,
693 goto exit_device_put; 694 goto exit_device_put;
694 } 695 }
695 696
696 pdev->dev.platform_data = kmalloc(sizeof(struct smsc47m1_sio_data), 697 err = platform_device_add_data(pdev, sio_data,
697 GFP_KERNEL); 698 sizeof(struct smsc47m1_sio_data));
698 if (!pdev->dev.platform_data) { 699 if (err) {
699 err = -ENOMEM;
700 printk(KERN_ERR DRVNAME ": Platform data allocation failed\n"); 700 printk(KERN_ERR DRVNAME ": Platform data allocation failed\n");
701 goto exit_device_put; 701 goto exit_device_put;
702 } 702 }
703 memcpy(pdev->dev.platform_data, sio_data,
704 sizeof(struct smsc47m1_sio_data));
705 703
706 err = platform_device_add(pdev); 704 err = platform_device_add(pdev);
707 if (err) { 705 if (err) {