diff options
author | Simon Glass <sjg@chromium.org> | 2014-10-13 23:42:14 -0600 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2014-10-22 10:36:53 -0600 |
commit | 84d6cbd3029e8b16e201f1129c300fae258c0f9c (patch) | |
tree | 173dac18c98c963f0c0993f33e1035284d0b20bf /drivers/misc/cros_ec_sandbox.c | |
parent | fda6fac39bb915fdb0ff31b998336d3a5f5c71a9 (diff) | |
download | u-boot-84d6cbd3029e8b16e201f1129c300fae258c0f9c.tar.gz |
dm: cros_ec: Add support for driver model
Add support for driver model if enabled. This involves minimal changes
to the code, mostly just plumbing around the edges.
Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Jagannadha Sutradharudu Teki <jagannadh.teki@gmail.com>
Diffstat (limited to 'drivers/misc/cros_ec_sandbox.c')
-rw-r--r-- | drivers/misc/cros_ec_sandbox.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/misc/cros_ec_sandbox.c b/drivers/misc/cros_ec_sandbox.c index 8a04af557d..431cf26e59 100644 --- a/drivers/misc/cros_ec_sandbox.c +++ b/drivers/misc/cros_ec_sandbox.c @@ -525,8 +525,13 @@ int cros_ec_sandbox_init(struct cros_ec_dev *dev, const void *blob) int node; int err; - state = &s_state; - err = cros_ec_decode_ec_flash(blob, &ec->ec_config); + node = fdtdec_next_compatible(blob, 0, COMPAT_GOOGLE_CROS_EC); + if (node < 0) { + debug("Failed to find chrome-ec node'\n"); + return -1; + } + + err = cros_ec_decode_ec_flash(blob, node, &ec->ec_config); if (err) return err; |