参照元

説明

引数

返り値

参考

実装

/**
 * platform_device_add_resources - add resources to a platform device
 * @pdev: platform device allocated by platform_device_alloc to add resources to
 * @res: set of resources that needs to be allocated for the device
 * @num: number of resources
 *
 * Add a copy of the resources to the platform device.  The memory
 * associated with the resources will be freed when the platform device is
 * released.
 */
int platform_device_add_resources(struct platform_device *pdev,
                                  const struct resource *res, unsigned int num)
{
        struct resource *r = NULL;

        if (res) {
                r = kmemdup(res, sizeof(struct resource) * num, GFP_KERNEL);
                if (!r)
                        return -ENOMEM;
        }
        kfree(pdev->resource);
        pdev->resource = r;
        pdev->num_resources = num;
        return 0;
}
EXPORT_SYMBOL_GPL(platform_device_add_resources);

コメント


トップ   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS