cros: Adjust board_get_cros_ec_dev() to return a udevice

Rather than returning what is effectively an internal data structure,
return the cros EC device itself.

Signed-off-by: Simon Glass <sjg@chromium.org>
lime2-spi
Simon Glass 6 years ago
parent 6322a7b63f
commit 42116f644b
  1. 4
      common/cros_ec.c
  2. 4
      include/cros_ec.h

@ -13,7 +13,7 @@
#include <dm.h>
#include <errno.h>
struct cros_ec_dev *board_get_cros_ec_dev(void)
struct udevice *board_get_cros_ec_dev(void)
{
struct udevice *dev;
int ret;
@ -23,7 +23,7 @@ struct cros_ec_dev *board_get_cros_ec_dev(void)
debug("%s: Error %d\n", __func__, ret);
return NULL;
}
return dev_get_uclass_priv(dev);
return dev;
}
int cros_ec_get_error(void)

@ -208,11 +208,9 @@ int cros_ec_flash_update_rw(struct udevice *dev, const uint8_t *image,
/**
* Return a pointer to the board's CROS-EC device
*
* This should be implemented by board files.
*
* @return pointer to CROS-EC device, or NULL if none is available
*/
struct cros_ec_dev *board_get_cros_ec_dev(void);
struct udevice *board_get_cros_ec_dev(void);
struct dm_cros_ec_ops {
int (*check_version)(struct udevice *dev);

Loading…
Cancel
Save