diff options
author | Simon Glass <sjg@chromium.org> | 2015-08-30 16:55:16 -0600 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2015-09-02 21:28:23 -0600 |
commit | 3346c87625b8a736af5636a0bd1be89f781eb5f2 (patch) | |
tree | 7fcd658cc520499f136add1e46643152618e9bf6 /drivers/core/device.c | |
parent | e3563f2ec768fb989149362ca0c6ca4a27513924 (diff) | |
download | u-boot-3346c87625b8a736af5636a0bd1be89f781eb5f2.zip u-boot-3346c87625b8a736af5636a0bd1be89f781eb5f2.tar.gz u-boot-3346c87625b8a736af5636a0bd1be89f781eb5f2.tar.bz2 |
dm: Improve handling of a missing uclass
When a uclass definition is missing, no drivers in that uclass can operate.
This can happen if a board has a strange collection of options (e.g. the
driver is enabled but the uclass is not).
Unfortunately this is very confusing at present. Starting up driver model
results in a -ENOENT error, which is pretty generic. Quite a big of digging
is needed to get to the root cause.
To help with this, change the error to a very strange one with no other
users in U-Boot. Also add a debug message.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers/core/device.c')
-rw-r--r-- | drivers/core/device.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/core/device.c b/drivers/core/device.c index a6cd936..0ccd443 100644 --- a/drivers/core/device.c +++ b/drivers/core/device.c @@ -39,8 +39,10 @@ int device_bind(struct udevice *parent, const struct driver *drv, return -EINVAL; ret = uclass_get(drv->id, &uc); - if (ret) + if (ret) { + debug("Missing uclass for driver %s\n", drv->name); return ret; + } dev = calloc(1, sizeof(struct udevice)); if (!dev) |