mirror of
https://github.com/brain-hackers/u-boot-brain
synced 2024-06-09 23:36:03 +09:00
dm: core: Split out scanning code to dm_scan()
Move the code related to scanning for devices to bind, into a new function. This will make it easier to skip this step with the new of-platdata improvements. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
84a42ae366
commit
49bbe6eab5
|
@ -296,6 +296,41 @@ __weak int dm_scan_other(bool pre_reloc_only)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* dm_scan() - Scan tables to bind devices
|
||||||
|
*
|
||||||
|
* Runs through the driver_info tables and binds the devices it finds. Then runs
|
||||||
|
* through the devicetree nodes. Finally calls dm_scan_other() to add any
|
||||||
|
* special devices
|
||||||
|
*
|
||||||
|
* @pre_reloc_only: If true, bind only nodes with special devicetree properties,
|
||||||
|
* or drivers with the DM_FLAG_PRE_RELOC flag. If false bind all drivers.
|
||||||
|
*/
|
||||||
|
static int dm_scan(bool pre_reloc_only)
|
||||||
|
{
|
||||||
|
int ret;
|
||||||
|
|
||||||
|
ret = dm_scan_plat(pre_reloc_only);
|
||||||
|
if (ret) {
|
||||||
|
debug("dm_scan_plat() failed: %d\n", ret);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)) {
|
||||||
|
ret = dm_extended_scan(pre_reloc_only);
|
||||||
|
if (ret) {
|
||||||
|
debug("dm_extended_scan() failed: %d\n", ret);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ret = dm_scan_other(pre_reloc_only);
|
||||||
|
if (ret)
|
||||||
|
return ret;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
int dm_init_and_scan(bool pre_reloc_only)
|
int dm_init_and_scan(bool pre_reloc_only)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
@ -308,27 +343,13 @@ int dm_init_and_scan(bool pre_reloc_only)
|
||||||
debug("dm_init() failed: %d\n", ret);
|
debug("dm_init() failed: %d\n", ret);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
ret = dm_scan_plat(pre_reloc_only);
|
ret = dm_scan(pre_reloc_only);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
debug("dm_scan_plat() failed: %d\n", ret);
|
log_debug("dm_scan() failed: %d\n", ret);
|
||||||
goto fail;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)) {
|
|
||||||
ret = dm_extended_scan(pre_reloc_only);
|
|
||||||
if (ret) {
|
|
||||||
debug("dm_extended_scan() failed: %d\n", ret);
|
|
||||||
goto fail;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ret = dm_scan_other(pre_reloc_only);
|
|
||||||
if (ret)
|
|
||||||
goto fail;
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
fail:
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_ACPIGEN
|
#ifdef CONFIG_ACPIGEN
|
||||||
|
|
Loading…
Reference in New Issue
Block a user