mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-04 09:59:32 +00:00
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>
This commit is contained in:
parent
f8a4bd3456
commit
3e61dfd850
1 changed files with 3 additions and 3 deletions
|
@ -191,13 +191,13 @@ int platform_device_add_resources(struct platform_device *pdev,
|
||||||
{
|
{
|
||||||
struct resource *r;
|
struct resource *r;
|
||||||
|
|
||||||
r = kmalloc(sizeof(struct resource) * num, GFP_KERNEL);
|
r = kmemdup(res, sizeof(struct resource) * num, GFP_KERNEL);
|
||||||
if (r) {
|
if (r) {
|
||||||
memcpy(r, res, sizeof(struct resource) * num);
|
|
||||||
pdev->resource = r;
|
pdev->resource = r;
|
||||||
pdev->num_resources = num;
|
pdev->num_resources = num;
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
return r ? 0 : -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(platform_device_add_resources);
|
EXPORT_SYMBOL_GPL(platform_device_add_resources);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue