aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>2010-06-15 04:47:55 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2010-08-05 16:53:34 -0400
commit3e61dfd8509a52d165726831c57b4c8a015d626c (patch)
tree28ed342eaf40273024bfdf673247127ea5e96456 /drivers
parentf8a4bd3456b988fc73b2c291b9e01b434c8fa940 (diff)
Driver core: use kmemdup in platform_device_add_resources
This makes platform_device_add_resources look like platform_device_add_data. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/base/platform.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/base/platform.c b/drivers/base/platform.c
index 4d99c8bdfedc..26eb69d88eb6 100644
--- a/drivers/base/platform.c
+++ b/drivers/base/platform.c
@@ -191,13 +191,13 @@ int platform_device_add_resources(struct platform_device *pdev,
191{ 191{
192 struct resource *r; 192 struct resource *r;
193 193
194 r = kmalloc(sizeof(struct resource) * num, GFP_KERNEL); 194 r = kmemdup(res, sizeof(struct resource) * num, GFP_KERNEL);
195 if (r) { 195 if (r) {
196 memcpy(r, res, sizeof(struct resource) * num);
197 pdev->resource = r; 196 pdev->resource = r;
198 pdev->num_resources = num; 197 pdev->num_resources = num;
198 return 0;
199 } 199 }
200 return r ? 0 : -ENOMEM; 200 return -ENOMEM;
201} 201}
202EXPORT_SYMBOL_GPL(platform_device_add_resources); 202EXPORT_SYMBOL_GPL(platform_device_add_resources);
203 203