From 911954859d6dece49c3e4835faea004cfe392506 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Tue, 5 Jul 2016 17:10:10 -0600 Subject: dm: Use dm_scan_fdt_dev() directly where possible Quite a few places have a bind() method which just calls dm_scan_fdt_dev(). We may as well call dm_scan_fdt_dev() directly. Update the code to do this. Signed-off-by: Simon Glass --- drivers/i2c/i2c-uclass.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) (limited to 'drivers/i2c') diff --git a/drivers/i2c/i2c-uclass.c b/drivers/i2c/i2c-uclass.c index 16447b8..dbd3789 100644 --- a/drivers/i2c/i2c-uclass.c +++ b/drivers/i2c/i2c-uclass.c @@ -498,16 +498,6 @@ static int i2c_post_probe(struct udevice *dev) #endif } -static int i2c_post_bind(struct udevice *dev) -{ -#if CONFIG_IS_ENABLED(OF_CONTROL) - /* Scan the bus for devices */ - return dm_scan_fdt_dev(dev); -#else - return 0; -#endif -} - static int i2c_child_post_bind(struct udevice *dev) { #if CONFIG_IS_ENABLED(OF_CONTROL) @@ -526,7 +516,9 @@ UCLASS_DRIVER(i2c) = { .id = UCLASS_I2C, .name = "i2c", .flags = DM_UC_FLAG_SEQ_ALIAS, - .post_bind = i2c_post_bind, +#if CONFIG_IS_ENABLED(OF_CONTROL) + .post_bind = dm_scan_fdt_dev, +#endif .post_probe = i2c_post_probe, .per_device_auto_alloc_size = sizeof(struct dm_i2c_bus), .per_child_platdata_auto_alloc_size = sizeof(struct dm_i2c_chip), -- cgit v1.1