dm: cros_ec: Convert cros_ec LPC driver to driver model
This is the last driver to be converted. It requires an LPC bus and a
special check_version() method.
Signed-off-by: Simon Glass <sjg@chromium.org>
diff --git a/drivers/misc/cros_ec.c b/drivers/misc/cros_ec.c
index 1c29ba8..efcad89 100644
--- a/drivers/misc/cros_ec.c
+++ b/drivers/misc/cros_ec.c
@@ -681,11 +681,23 @@
struct ec_params_hello req;
struct ec_response_hello *resp;
+#ifdef CONFIG_DM_CROS_EC
+ struct dm_cros_ec_ops *ops;
+ int ret;
+
+ ops = dm_cros_ec_get_ops(dev->dev);
+ if (ops->check_version) {
+ ret = ops->check_version(dev->dev);
+ if (ret)
+ return ret;
+ }
+#else
#ifdef CONFIG_CROS_EC_LPC
/* LPC has its own way of doing this */
if (dev->interface == CROS_EC_IF_LPC)
return cros_ec_lpc_check_version(dev);
#endif
+#endif
/*
* TODO(sjg@chromium.org).