- 追加された行はこの色です。
- 削除された行はこの色です。
*参照元 [#k1c7ae89]
#backlinks
*説明 [#teb78578]
-パス: [[linux-4.4.1/drivers/base/platform.c]]
-FIXME: これは何?
--説明
**引数 [#yd1f60dd]
-struct platform_device *pdev
--
--[[linux-4.4.1/platform_device]]
-const void *data
--
-size_t size
--
**返り値 [#hd3384d0]
-int
--
**参考 [#eb2406db]
*実装 [#b5406c73]
/**
* platform_device_add_data - add platform-specific data to a platform device
* @pdev: platform device allocated by platform_device_alloc to add resources to
* @data: platform specific data for this platform device
* @size: size of platform specific data
*
* Add a copy of platform specific data to the platform device's
* platform_data pointer. The memory associated with the platform data
* will be freed when the platform device is released.
*/
int platform_device_add_data(struct platform_device *pdev, const void *data,
size_t size)
{
void *d = NULL;
if (data) {
d = kmemdup(data, size, GFP_KERNEL);
if (!d)
return -ENOMEM;
}
-
--[[linux-4.4.1/kmemdup()]]
kfree(pdev->dev.platform_data);
-
--[[linux-4.4.1/kfree()]]
pdev->dev.platform_data = d;
return 0;
}
EXPORT_SYMBOL_GPL(platform_device_add_data);
-
--[[linux-4.4.1/EXPORT_SYMBOL_GPL()]]
*コメント [#u551d49e]