diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/hwmon/w83627ehf.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/hwmon/w83627ehf.c b/drivers/hwmon/w83627ehf.c index dbcdef69f8f3..3e1fa52d57bf 100644 --- a/drivers/hwmon/w83627ehf.c +++ b/drivers/hwmon/w83627ehf.c | |||
@@ -2004,7 +2004,8 @@ static int __devinit w83627ehf_probe(struct platform_device *pdev) | |||
2004 | goto exit; | 2004 | goto exit; |
2005 | } | 2005 | } |
2006 | 2006 | ||
2007 | data = kzalloc(sizeof(struct w83627ehf_data), GFP_KERNEL); | 2007 | data = devm_kzalloc(&pdev->dev, sizeof(struct w83627ehf_data), |
2008 | GFP_KERNEL); | ||
2008 | if (!data) { | 2009 | if (!data) { |
2009 | err = -ENOMEM; | 2010 | err = -ENOMEM; |
2010 | goto exit_release; | 2011 | goto exit_release; |
@@ -2493,9 +2494,8 @@ static int __devinit w83627ehf_probe(struct platform_device *pdev) | |||
2493 | 2494 | ||
2494 | exit_remove: | 2495 | exit_remove: |
2495 | w83627ehf_device_remove_files(dev); | 2496 | w83627ehf_device_remove_files(dev); |
2496 | kfree(data); | ||
2497 | platform_set_drvdata(pdev, NULL); | ||
2498 | exit_release: | 2497 | exit_release: |
2498 | platform_set_drvdata(pdev, NULL); | ||
2499 | release_region(res->start, IOREGION_LENGTH); | 2499 | release_region(res->start, IOREGION_LENGTH); |
2500 | exit: | 2500 | exit: |
2501 | return err; | 2501 | return err; |
@@ -2509,7 +2509,6 @@ static int __devexit w83627ehf_remove(struct platform_device *pdev) | |||
2509 | w83627ehf_device_remove_files(&pdev->dev); | 2509 | w83627ehf_device_remove_files(&pdev->dev); |
2510 | release_region(data->addr, IOREGION_LENGTH); | 2510 | release_region(data->addr, IOREGION_LENGTH); |
2511 | platform_set_drvdata(pdev, NULL); | 2511 | platform_set_drvdata(pdev, NULL); |
2512 | kfree(data); | ||
2513 | 2512 | ||
2514 | return 0; | 2513 | return 0; |
2515 | } | 2514 | } |