From 031a650e1309a086f6794cde35b1b1b851a9e926 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Sun, 18 Nov 2018 08:14:34 -0700 Subject: dm: sandbox: i2c: Use new emulator parent uclass Update the device tree, sandbox i2c driver and tests to use the new emulation parent to hold emulators. Signed-off-by: Simon Glass --- drivers/i2c/sandbox_i2c.c | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) (limited to 'drivers/i2c') diff --git a/drivers/i2c/sandbox_i2c.c b/drivers/i2c/sandbox_i2c.c index 66578510..0dbbaa0 100644 --- a/drivers/i2c/sandbox_i2c.c +++ b/drivers/i2c/sandbox_i2c.c @@ -21,33 +21,15 @@ static int get_emul(struct udevice *dev, struct udevice **devp, struct dm_i2c_ops **opsp) { struct dm_i2c_chip *plat; - struct udevice *child; int ret; *devp = NULL; *opsp = NULL; plat = dev_get_parent_platdata(dev); if (!plat->emul) { - ret = dm_scan_fdt_dev(dev); + ret = i2c_emul_find(dev, &plat->emul); if (ret) return ret; - - for (device_find_first_child(dev, &child); child; - device_find_next_child(&child)) { - if (device_get_uclass_id(child) != UCLASS_I2C_EMUL) - continue; - - ret = device_probe(child); - if (ret) - return ret; - - break; - } - - if (child) - plat->emul = child; - else - return -ENODEV; } *devp = plat->emul; *opsp = i2c_get_ops(plat->emul); -- cgit v1.1