diff options
Diffstat (limited to 'drivers/hwmon/smsc47m1.c')
-rw-r--r-- | drivers/hwmon/smsc47m1.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/hwmon/smsc47m1.c b/drivers/hwmon/smsc47m1.c index 1e21c8cc948f..9bac3c2d84f9 100644 --- a/drivers/hwmon/smsc47m1.c +++ b/drivers/hwmon/smsc47m1.c | |||
@@ -693,15 +693,12 @@ static int __init smsc47m1_device_add(unsigned short address, | |||
693 | goto exit_device_put; | 693 | goto exit_device_put; |
694 | } | 694 | } |
695 | 695 | ||
696 | pdev->dev.platform_data = kmalloc(sizeof(struct smsc47m1_sio_data), | 696 | err = platform_device_add_data(pdev, sio_data, |
697 | GFP_KERNEL); | 697 | sizeof(struct smsc47m1_sio_data)); |
698 | if (!pdev->dev.platform_data) { | 698 | if (err) { |
699 | err = -ENOMEM; | ||
700 | printk(KERN_ERR DRVNAME ": Platform data allocation failed\n"); | 699 | printk(KERN_ERR DRVNAME ": Platform data allocation failed\n"); |
701 | goto exit_device_put; | 700 | goto exit_device_put; |
702 | } | 701 | } |
703 | memcpy(pdev->dev.platform_data, sio_data, | ||
704 | sizeof(struct smsc47m1_sio_data)); | ||
705 | 702 | ||
706 | err = platform_device_add(pdev); | 703 | err = platform_device_add(pdev); |
707 | if (err) { | 704 | if (err) { |