From c275dfefebb95c1ffdca630a65055a850b83adc7 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Sat, 19 Dec 2015 19:38:55 -0700 Subject: dm: core: Provide uclass_find_device_by_phandle() only when needed This function cannot be used unless support is enabled for device tree control. Adjust the code to reflect that. Signed-off-by: Simon Glass --- drivers/core/uclass.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'drivers/core/uclass.c') diff --git a/drivers/core/uclass.c b/drivers/core/uclass.c index 1af09472a2..36bcf197aa 100644 --- a/drivers/core/uclass.c +++ b/drivers/core/uclass.c @@ -278,6 +278,7 @@ static int uclass_find_device_by_of_offset(enum uclass_id id, int node, return -ENODEV; } +#if CONFIG_IS_ENABLED(OF_CONTROL) static int uclass_find_device_by_phandle(enum uclass_id id, struct udevice *parent, const char *name, @@ -308,6 +309,7 @@ static int uclass_find_device_by_phandle(enum uclass_id id, return -ENODEV; } +#endif int uclass_get_device_tail(struct udevice *dev, int ret, struct udevice **devp) @@ -374,6 +376,7 @@ int uclass_get_device_by_of_offset(enum uclass_id id, int node, return uclass_get_device_tail(dev, ret, devp); } +#if CONFIG_IS_ENABLED(OF_CONTROL) int uclass_get_device_by_phandle(enum uclass_id id, struct udevice *parent, const char *name, struct udevice **devp) { @@ -384,6 +387,7 @@ int uclass_get_device_by_phandle(enum uclass_id id, struct udevice *parent, ret = uclass_find_device_by_phandle(id, parent, name, &dev); return uclass_get_device_tail(dev, ret, devp); } +#endif int uclass_first_device(enum uclass_id id, struct udevice **devp) { -- cgit From 20af3c0a0034b885cd269cb7abdc2d933d82a723 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Tue, 5 Jan 2016 09:30:59 -0700 Subject: dm: core: Call uclass post_bind() after the driver's bind() method At present the uclass's post_bind() method is called before the driver's bind() method. This means that the uclass cannot use any of the information set up by the driver. Move it later in the sequence to permit this. This is an ordering change which is always fairly major in nature. The main impact is that devices which have children will not see them appear in their bind() method. From what I can see, existing drivers do not look at their children in the bind() method, so this should be safe. Conceptually this change seems to result in a 'more correct' ordering, since the uclass (which is broader than the device) gets the last word. Signed-off-by: Simon Glass Reviewed-by: Tom Rini --- drivers/core/uclass.c | 5 ----- 1 file changed, 5 deletions(-) (limited to 'drivers/core/uclass.c') diff --git a/drivers/core/uclass.c b/drivers/core/uclass.c index 36bcf197aa..e1acefe727 100644 --- a/drivers/core/uclass.c +++ b/drivers/core/uclass.c @@ -430,11 +430,6 @@ int uclass_bind_device(struct udevice *dev) goto err; } } - if (uc->uc_drv->post_bind) { - ret = uc->uc_drv->post_bind(dev); - if (ret) - goto err; - } return 0; err: -- cgit