diff options
Diffstat (limited to 'drivers/hwmon/w83627hf.c')
-rw-r--r-- | drivers/hwmon/w83627hf.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/hwmon/w83627hf.c b/drivers/hwmon/w83627hf.c index 12cb40a975de..72aee3c0e8de 100644 --- a/drivers/hwmon/w83627hf.c +++ b/drivers/hwmon/w83627hf.c | |||
@@ -1548,15 +1548,12 @@ static int __init w83627hf_device_add(unsigned short address, | |||
1548 | goto exit_device_put; | 1548 | goto exit_device_put; |
1549 | } | 1549 | } |
1550 | 1550 | ||
1551 | pdev->dev.platform_data = kmalloc(sizeof(struct w83627hf_sio_data), | 1551 | err = platform_device_add_data(pdev, sio_data, |
1552 | GFP_KERNEL); | 1552 | sizeof(struct w83627hf_sio_data)); |
1553 | if (!pdev->dev.platform_data) { | 1553 | if (err) { |
1554 | err = -ENOMEM; | ||
1555 | printk(KERN_ERR DRVNAME ": Platform data allocation failed\n"); | 1554 | printk(KERN_ERR DRVNAME ": Platform data allocation failed\n"); |
1556 | goto exit_device_put; | 1555 | goto exit_device_put; |
1557 | } | 1556 | } |
1558 | memcpy(pdev->dev.platform_data, sio_data, | ||
1559 | sizeof(struct w83627hf_sio_data)); | ||
1560 | 1557 | ||
1561 | err = platform_device_add(pdev); | 1558 | err = platform_device_add(pdev); |
1562 | if (err) { | 1559 | if (err) { |