#include <common.h>
#include <dm.h>
-#include <dm/root.h>
DECLARE_GLOBAL_DATA_PTR;
* Before relocation, only bind devices marked for pre-relocation
* use.
*/
- return dm_scan_fdt_node(bus, gd->fdt_blob, bus->of_offset,
- gd->flags & GD_FLG_RELOC ? false : true);
+ return dm_scan_fdt_dev(bus);
}
UCLASS_DRIVER(lpc) = {
#include <asm/state.h>
#endif
#include <asm/unaligned.h>
-#include <dm/root.h>
DECLARE_GLOBAL_DATA_PTR;
static int usb_hub_post_bind(struct udevice *dev)
{
/* Scan the bus for devices */
- return dm_scan_fdt_node(dev, gd->fdt_blob, dev->of_offset, false);
+ return dm_scan_fdt_dev(dev);
}
static int usb_hub_post_probe(struct udevice *dev)
#include <common.h>
#include <dm.h>
-#include <dm/root.h>
DECLARE_GLOBAL_DATA_PTR;
plat->size = cell[2];
}
- return dm_scan_fdt_node(dev, gd->fdt_blob, dev->of_offset, false);
+ return dm_scan_fdt_dev(dev);
}
UCLASS_DRIVER(simple_bus) = {
#include <malloc.h>
#include <dm/device-internal.h>
#include <dm/lists.h>
-#include <dm/root.h>
DECLARE_GLOBAL_DATA_PTR;
{
#if CONFIG_IS_ENABLED(OF_CONTROL)
/* Scan the bus for devices */
- return dm_scan_fdt_node(dev, gd->fdt_blob, dev->of_offset, false);
+ return dm_scan_fdt_dev(dev);
#else
return 0;
#endif
#include <asm/test.h>
#include <dm/lists.h>
#include <dm/device-internal.h>
-#include <dm/root.h>
DECLARE_GLOBAL_DATA_PTR;
*opsp = NULL;
plat = dev_get_parent_platdata(dev);
if (!plat->emul) {
- ret = dm_scan_fdt_node(dev, gd->fdt_blob, dev->of_offset,
- false);
+ ret = dm_scan_fdt_dev(dev);
if (ret)
return ret;
#include <asm/io.h>
#include <asm-generic/gpio.h>
#include <dm/device-internal.h>
-#include <dm/root.h>
#include <dm/uclass-internal.h>
#ifdef DEBUG_TRACE
int cros_ec_post_bind(struct udevice *dev)
{
/* Scan for available EC devices (e.g. I2C tunnel) */
- return dm_scan_fdt_node(dev, gd->fdt_blob, dev->of_offset, false);
+ return dm_scan_fdt_dev(dev);
}
U_BOOT_CMD(
#include <common.h>
#include <dm.h>
#include <pch.h>
-#include <dm/root.h>
DECLARE_GLOBAL_DATA_PTR;
* Before relocation, only bind devices marked for pre-relocation
* use.
*/
- return dm_scan_fdt_node(bus, gd->fdt_blob, bus->of_offset,
- gd->flags & GD_FLG_RELOC ? false : true);
+ return dm_scan_fdt_dev(bus);
}
UCLASS_DRIVER(pch) = {
#include <pci.h>
#include <asm/io.h>
#include <dm/lists.h>
-#include <dm/root.h>
#include <dm/device-internal.h>
#if defined(CONFIG_X86) && defined(CONFIG_HAVE_FSP)
#include <asm/fsp/fsp_support.h>
static int pci_uclass_post_bind(struct udevice *bus)
{
- /*
- * If there is no pci device listed in the device tree,
- * don't bother scanning the device tree.
- */
- if (bus->of_offset == -1)
- return 0;
-
/*
* Scan the device tree for devices. This does not probe the PCI bus,
* as this is not permitted while binding. It just finds devices
* Before relocation, only bind devices marked for pre-relocation
* use.
*/
- return dm_scan_fdt_node(bus, gd->fdt_blob, bus->of_offset,
- gd->flags & GD_FLG_RELOC ? false : true);
+ return dm_scan_fdt_dev(bus);
}
static int decode_regions(struct pci_controller *hose, const void *blob,
#include <fdtdec.h>
#include <inttypes.h>
#include <pci.h>
-#include <dm/root.h>
DECLARE_GLOBAL_DATA_PTR;
static int sandbox_pci_child_post_bind(struct udevice *dev)
{
/* Attach an emulator if we can */
- return dm_scan_fdt_node(dev, gd->fdt_blob, dev->of_offset, false);
+ return dm_scan_fdt_dev(dev);
}
static const struct dm_pci_ops sandbox_pci_ops = {
#include <errno.h>
#include <asm/io.h>
#include <dm/pinctrl.h>
-#include <dm/root.h>
#include <mach/pic32.h>
DECLARE_GLOBAL_DATA_PTR;
static int pic32_pinctrl_bind(struct udevice *dev)
{
/* scan child GPIO banks */
- return dm_scan_fdt_node(dev, gd->fdt_blob, dev->of_offset, false);
+ return dm_scan_fdt_dev(dev);
}
static const struct udevice_id pic32_pinctrl_ids[] = {
#include <asm/arch/hardware.h>
#include <asm/arch/periph.h>
#include <dm/pinctrl.h>
-#include <dm/root.h>
DECLARE_GLOBAL_DATA_PTR;
static int rk3036_pinctrl_bind(struct udevice *dev)
{
/* scan child GPIO banks */
- return dm_scan_fdt_node(dev, gd->fdt_blob, dev->of_offset, false);
+ return dm_scan_fdt_dev(dev);
}
static int rk3036_pinctrl_probe(struct udevice *dev)
#include <asm/arch/periph.h>
#include <asm/arch/pmu_rk3288.h>
#include <dm/pinctrl.h>
-#include <dm/root.h>
DECLARE_GLOBAL_DATA_PTR;
#if CONFIG_IS_ENABLED(OF_PLATDATA)
return 0;
#else
- /* scan child GPIO banks */
- return dm_scan_fdt_node(dev, gd->fdt_blob, dev->of_offset, false);
+ return dm_scan_fdt_dev(dev);
#endif
}
*/
#include <common.h>
#include <dm.h>
-#include <dm/root.h>
#include <power/pmic.h>
#include <spmi/spmi.h>
static int pm8916_bind(struct udevice *dev)
{
- return dm_scan_fdt_node(dev, gd->fdt_blob, dev->of_offset, false);
+ return dm_scan_fdt_dev(dev);
}
U_BOOT_DRIVER(pmic_pm8916) = {
- 'drivers/power/pmic/regulator-uclass.c'
It's important to call the device_bind() with the proper node offset,
when binding the regulator devices. The pmic_bind_childs() can be used
- for this purpose if PMIC I/O driver is implemented or dm_scan_fdt_node()
+ for this purpose if PMIC I/O driver is implemented or dm_scan_fdt_dev()
otherwise. Detailed information can be found in the header file.
config SPL_DM_REGULATOR
#include <spi.h>
#include <dm/device-internal.h>
#include <dm/uclass-internal.h>
-#include <dm/root.h>
#include <dm/lists.h>
#include <dm/util.h>
static int spi_post_bind(struct udevice *dev)
{
/* Scan the bus for devices */
- return dm_scan_fdt_node(dev, gd->fdt_blob, dev->of_offset, false);
+ return dm_scan_fdt_dev(dev);
}
static int spi_child_post_bind(struct udevice *dev)
#include <common.h>
#include <dm.h>
#include <errno.h>
-#include <dm/root.h>
#include <spmi/spmi.h>
#include <linux/ctype.h>
static int spmi_post_bind(struct udevice *dev)
{
- return dm_scan_fdt_node(dev, gd->fdt_blob, dev->of_offset, false);
+ return dm_scan_fdt_dev(dev);
}
UCLASS_DRIVER(spmi) = {
#include <common.h>
#include <dm.h>
#include <usb.h>
-#include <dm/root.h>
#include <dm/device-internal.h>
DECLARE_GLOBAL_DATA_PTR;
int usb_emul_post_bind(struct udevice *dev)
{
/* Scan the bus for devices */
- return dm_scan_fdt_node(dev, gd->fdt_blob, dev->of_offset, false);
+ return dm_scan_fdt_dev(dev);
}
void usb_emul_reset(struct udevice *dev)
#include <usb.h>
#include <dm/device-internal.h>
#include <dm/lists.h>
-#include <dm/root.h>
#include <dm/uclass-internal.h>
DECLARE_GLOBAL_DATA_PTR;
int usb_post_bind(struct udevice *dev)
{
- /* Scan the bus for devices */
- return dm_scan_fdt_node(dev, gd->fdt_blob, dev->of_offset, false);
+ return dm_scan_fdt_dev(dev);
}
int usb_setup_ehci_gadget(struct ehci_ctrl **ctlrp)
* which does the scan on the device node, for the 'regulator-name' constraint.
* If the parent is not a PMIC device, and the child is not bind by function:
* 'pmic_bind_childs()', then it's recommended to bind the device by call to
- * dm_scan_fdt_node() - this is usually done automatically for bus devices,
+ * dm_scan_fdt_dev() - this is usually done automatically for bus devices,
* as a post bind method.
*
* Regulator get:
#include <common.h>
#include <dm.h>
#include <dm/device-internal.h>
-#include <dm/root.h>
#include <dm/test.h>
#include <dm/uclass-internal.h>
#include <dm/util.h>
static int testbus_drv_probe(struct udevice *dev)
{
- return dm_scan_fdt_node(dev, gd->fdt_blob, dev->of_offset, false);
+ return dm_scan_fdt_dev(dev);
}
static int testbus_child_post_bind(struct udevice *dev)