参照元

説明

引数

返り値

参考

実装

/**
 * 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;
        }
        kfree(pdev->dev.platform_data);
        pdev->dev.platform_data = d;
        return 0;
}
EXPORT_SYMBOL_GPL(platform_device_add_data);

コメント


トップ   編集 凍結 差分 履歴 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS
Last-modified: 2016-02-17 (水) 10:29:15