aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/f71805f.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/hwmon/f71805f.c')
-rw-r--r--drivers/hwmon/f71805f.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/hwmon/f71805f.c b/drivers/hwmon/f71805f.c
index cdbe309b8fc4..e8b15047a6d3 100644
--- a/drivers/hwmon/f71805f.c
+++ b/drivers/hwmon/f71805f.c
@@ -1290,15 +1290,12 @@ static int __init f71805f_device_add(unsigned short address,
1290 goto exit_device_put; 1290 goto exit_device_put;
1291 } 1291 }
1292 1292
1293 pdev->dev.platform_data = kmalloc(sizeof(struct f71805f_sio_data), 1293 err = platform_device_add_data(pdev, sio_data,
1294 GFP_KERNEL); 1294 sizeof(struct f71805f_sio_data));
1295 if (!pdev->dev.platform_data) { 1295 if (err) {
1296 err = -ENOMEM;
1297 printk(KERN_ERR DRVNAME ": Platform data allocation failed\n"); 1296 printk(KERN_ERR DRVNAME ": Platform data allocation failed\n");
1298 goto exit_device_put; 1297 goto exit_device_put;
1299 } 1298 }
1300 memcpy(pdev->dev.platform_data, sio_data,
1301 sizeof(struct f71805f_sio_data));
1302 1299
1303 err = platform_device_add(pdev); 1300 err = platform_device_add(pdev);
1304 if (err) { 1301 if (err) {