linux-4.4.1/of_platform_bus_create()
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
|
ログイン
]
開始行:
*参照元 [#x4be5a2e]
#backlinks
*説明 [#qfcb6b7a]
-パス: [[linux-4.4.1/drivers/of/platform.c]]
-FIXME: これは何?
--説明
**引数 [#aa80daaf]
-struct device_node *bus
--
--[[linux-4.4.1/device_node]]
-const struct of_device_id *matches
--
--[[linux-4.4.1/of_device_id]]
-const struct of_dev_auxdata *lookup
--
--[[linux-4.4.1/of_dev_auxdata]]
-struct device *parent
--
--[[linux-4.4.1/device]]
-bool strict
--
**返り値 [#a6c7e460]
-int
--
**参考 [#xd434490]
*実装 [#j3e052f0]
/**
* of_platform_bus_create() - Create a device for a node...
* @bus: device node of the bus to instantiate
* @matches: match table for bus nodes
* @lookup: auxdata table for matching id and platform_d...
* @parent: parent for new device, or NULL for top level.
* @strict: require compatible property
*
* Creates a platform_device for the provided device_nod...
* recursively create devices for all the child nodes.
*/
static int of_platform_bus_create(struct device_node *bus,
const struct of_device...
const struct of_dev_au...
struct device *parent,...
{
const struct of_dev_auxdata *auxdata;
struct device_node *child;
struct platform_device *dev;
const char *bus_id = NULL;
void *platform_data = NULL;
int rc = 0;
-
--[[linux-4.4.1/of_dev_auxdata]]
--[[linux-4.4.1/devie_node]]
--[[linux-4.4.1/platform_device]]
/* Make sure it has a compatible property */
if (strict && (!of_get_property(bus, "compatible...
pr_debug("%s() - skipping %s, no compati...
__func__, bus->full_name);
return 0;
}
-
--[[linux-4.4.1/of_get_property()]]
--[[linux-4.4.1/pr_debug()]]
auxdata = of_dev_lookup(lookup, bus);
if (auxdata) {
bus_id = auxdata->name;
platform_data = auxdata->platform_data;
}
-
--[[linux-4.4.1/of_dev_lookup()]]
if (of_device_is_compatible(bus, "arm,primecell"...
/*
* Don't return an error here to keep co...
* device tree files.
*/
of_amba_device_create(bus, bus_id, platf...
return 0;
}
-
--[[linux-4.4.1/of_device_is_compatible()]]
--[[linux-4.4.1/of_amba_device_create()]]
dev = of_platform_device_create_pdata(bus, bus_i...
if (!dev || !of_match_node(matches, bus))
return 0;
-
--[[linux-4.4.1/of_platform_device_create_pdata()]]
--[[linux-4.4.1/of_match_node()]]
for_each_child_of_node(bus, child) {
pr_debug(" create child: %s\n", child-...
rc = of_platform_bus_create(child, match...
if (rc) {
of_node_put(child);
break;
}
}
of_node_set_flag(bus, OF_POPULATED_BUS);
-
--[[linux-4.4.1/for_each_child_of_node()]]
--[[linux-4.4.1/of_platform_bus_create()]]
--[[linux-4.4.1/of_node_put()]]
--[[linux-4.4.1/of_node_set_flag()]]
return rc;
}
*コメント [#u688871d]
終了行:
*参照元 [#x4be5a2e]
#backlinks
*説明 [#qfcb6b7a]
-パス: [[linux-4.4.1/drivers/of/platform.c]]
-FIXME: これは何?
--説明
**引数 [#aa80daaf]
-struct device_node *bus
--
--[[linux-4.4.1/device_node]]
-const struct of_device_id *matches
--
--[[linux-4.4.1/of_device_id]]
-const struct of_dev_auxdata *lookup
--
--[[linux-4.4.1/of_dev_auxdata]]
-struct device *parent
--
--[[linux-4.4.1/device]]
-bool strict
--
**返り値 [#a6c7e460]
-int
--
**参考 [#xd434490]
*実装 [#j3e052f0]
/**
* of_platform_bus_create() - Create a device for a node...
* @bus: device node of the bus to instantiate
* @matches: match table for bus nodes
* @lookup: auxdata table for matching id and platform_d...
* @parent: parent for new device, or NULL for top level.
* @strict: require compatible property
*
* Creates a platform_device for the provided device_nod...
* recursively create devices for all the child nodes.
*/
static int of_platform_bus_create(struct device_node *bus,
const struct of_device...
const struct of_dev_au...
struct device *parent,...
{
const struct of_dev_auxdata *auxdata;
struct device_node *child;
struct platform_device *dev;
const char *bus_id = NULL;
void *platform_data = NULL;
int rc = 0;
-
--[[linux-4.4.1/of_dev_auxdata]]
--[[linux-4.4.1/devie_node]]
--[[linux-4.4.1/platform_device]]
/* Make sure it has a compatible property */
if (strict && (!of_get_property(bus, "compatible...
pr_debug("%s() - skipping %s, no compati...
__func__, bus->full_name);
return 0;
}
-
--[[linux-4.4.1/of_get_property()]]
--[[linux-4.4.1/pr_debug()]]
auxdata = of_dev_lookup(lookup, bus);
if (auxdata) {
bus_id = auxdata->name;
platform_data = auxdata->platform_data;
}
-
--[[linux-4.4.1/of_dev_lookup()]]
if (of_device_is_compatible(bus, "arm,primecell"...
/*
* Don't return an error here to keep co...
* device tree files.
*/
of_amba_device_create(bus, bus_id, platf...
return 0;
}
-
--[[linux-4.4.1/of_device_is_compatible()]]
--[[linux-4.4.1/of_amba_device_create()]]
dev = of_platform_device_create_pdata(bus, bus_i...
if (!dev || !of_match_node(matches, bus))
return 0;
-
--[[linux-4.4.1/of_platform_device_create_pdata()]]
--[[linux-4.4.1/of_match_node()]]
for_each_child_of_node(bus, child) {
pr_debug(" create child: %s\n", child-...
rc = of_platform_bus_create(child, match...
if (rc) {
of_node_put(child);
break;
}
}
of_node_set_flag(bus, OF_POPULATED_BUS);
-
--[[linux-4.4.1/for_each_child_of_node()]]
--[[linux-4.4.1/of_platform_bus_create()]]
--[[linux-4.4.1/of_node_put()]]
--[[linux-4.4.1/of_node_set_flag()]]
return rc;
}
*コメント [#u688871d]
ページ名: