linux-4.4.1/platform_device_register_full()
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
|
ログイン
]
開始行:
*参照元 [#je9c42e0]
#backlinks
*説明 [#s707c013]
-パス: [[linux-4.4.1/drivers/base/platform.c]]
-FIXME: これは何?
--説明
**引数 [#zb97b834]
-const struct platform_device_info *pdevinfo
--
--[[linux-4.4.1/platform_device_info]]
**返り値 [#md2d177b]
-struct platform_device *
--
--[[linux-4.4.1/platform_device]]
**参考 [#e66fd459]
*実装 [#w2bbacc9]
/**
* platform_device_register_full - add a platform-level ...
* resources and platform-specific data
*
* @pdevinfo: data used to create device
*
* Returns &struct platform_device pointer on success, o...
*/
struct platform_device *platform_device_register_full(
const struct platform_device_info *pdevi...
{
int ret = -ENOMEM;
struct platform_device *pdev;
pdev = platform_device_alloc(pdevinfo->name, pde...
if (!pdev)
goto err_alloc;
-
--[[linux-4.4.1/platform_device_alloc()]]
pdev->dev.parent = pdevinfo->parent;
pdev->dev.fwnode = pdevinfo->fwnode;
if (pdevinfo->dma_mask) {
/*
* This memory isn't freed when the devi...
* I don't have a nice idea for that tho...
* dma_mask in struct device should not ...
* See http://thread.gmane.org/gmane.lin...
*/
pdev->dev.dma_mask =
kmalloc(sizeof(*pdev->dev.dma_ma...
if (!pdev->dev.dma_mask)
goto err;
-
--[[linux-4.4.1/kmalloc()]]
*pdev->dev.dma_mask = pdevinfo->dma_mask;
pdev->dev.coherent_dma_mask = pdevinfo->...
}
ret = platform_device_add_resources(pdev,
pdevinfo->res, pdevinfo->num_res);
if (ret)
goto err;
-
--[[linux-4.4.1/platform_device_add_resources()]]
ret = platform_device_add_data(pdev,
pdevinfo->data, pdevinfo->size_d...
if (ret)
goto err;
-
--[[linux-4.4.1/platform_device_add_data()]]
ret = platform_device_add(pdev);
-
--[[linux-4.4.1/platform_device_add()]]
if (ret) {
err:
ACPI_COMPANION_SET(&pdev->dev, NULL);
kfree(pdev->dev.dma_mask);
-
--[[linux-4.4.1/ACPI_COMPANION_SET()]]
--[[linux-4.4.1/kfree()]]
err_alloc:
platform_device_put(pdev);
return ERR_PTR(ret);
-
--[[linux-4.4.1/platform_device_put()]]
--[[linux-4.4.1/ERR_PTR()]]
}
return pdev;
}
EXPORT_SYMBOL_GPL(platform_device_register_full);
-
--[[linux-4.4.1/EXPORT_SYMBOL_GPL()]]
*コメント [#d355a291]
終了行:
*参照元 [#je9c42e0]
#backlinks
*説明 [#s707c013]
-パス: [[linux-4.4.1/drivers/base/platform.c]]
-FIXME: これは何?
--説明
**引数 [#zb97b834]
-const struct platform_device_info *pdevinfo
--
--[[linux-4.4.1/platform_device_info]]
**返り値 [#md2d177b]
-struct platform_device *
--
--[[linux-4.4.1/platform_device]]
**参考 [#e66fd459]
*実装 [#w2bbacc9]
/**
* platform_device_register_full - add a platform-level ...
* resources and platform-specific data
*
* @pdevinfo: data used to create device
*
* Returns &struct platform_device pointer on success, o...
*/
struct platform_device *platform_device_register_full(
const struct platform_device_info *pdevi...
{
int ret = -ENOMEM;
struct platform_device *pdev;
pdev = platform_device_alloc(pdevinfo->name, pde...
if (!pdev)
goto err_alloc;
-
--[[linux-4.4.1/platform_device_alloc()]]
pdev->dev.parent = pdevinfo->parent;
pdev->dev.fwnode = pdevinfo->fwnode;
if (pdevinfo->dma_mask) {
/*
* This memory isn't freed when the devi...
* I don't have a nice idea for that tho...
* dma_mask in struct device should not ...
* See http://thread.gmane.org/gmane.lin...
*/
pdev->dev.dma_mask =
kmalloc(sizeof(*pdev->dev.dma_ma...
if (!pdev->dev.dma_mask)
goto err;
-
--[[linux-4.4.1/kmalloc()]]
*pdev->dev.dma_mask = pdevinfo->dma_mask;
pdev->dev.coherent_dma_mask = pdevinfo->...
}
ret = platform_device_add_resources(pdev,
pdevinfo->res, pdevinfo->num_res);
if (ret)
goto err;
-
--[[linux-4.4.1/platform_device_add_resources()]]
ret = platform_device_add_data(pdev,
pdevinfo->data, pdevinfo->size_d...
if (ret)
goto err;
-
--[[linux-4.4.1/platform_device_add_data()]]
ret = platform_device_add(pdev);
-
--[[linux-4.4.1/platform_device_add()]]
if (ret) {
err:
ACPI_COMPANION_SET(&pdev->dev, NULL);
kfree(pdev->dev.dma_mask);
-
--[[linux-4.4.1/ACPI_COMPANION_SET()]]
--[[linux-4.4.1/kfree()]]
err_alloc:
platform_device_put(pdev);
return ERR_PTR(ret);
-
--[[linux-4.4.1/platform_device_put()]]
--[[linux-4.4.1/ERR_PTR()]]
}
return pdev;
}
EXPORT_SYMBOL_GPL(platform_device_register_full);
-
--[[linux-4.4.1/EXPORT_SYMBOL_GPL()]]
*コメント [#d355a291]
ページ名: