summaryrefslogtreecommitdiff
path: root/drivers/misc/cros_ec.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2015-03-05 12:25:20 -0700
committerSimon Glass <sjg@chromium.org>2015-04-16 19:27:42 -0600
commite564f054af002d9e6a1080ed9d4bc2c6052a4435 (patch)
tree7b945d568d32c7febf5a8b70c6bce26b5157663c /drivers/misc/cros_ec.c
parent106cce9604306743c86addd4d27426cce498c9d1 (diff)
dm: core: Add dev_get_uclass_priv() to access uclass private data
Add a convenience function to access the private data that a uclass stores for each of its devices. Convert over most existing uses for consistency and to provide an example for others. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers/misc/cros_ec.c')
-rw-r--r--drivers/misc/cros_ec.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/misc/cros_ec.c b/drivers/misc/cros_ec.c
index 5846e76c49..1c29ba83de 100644
--- a/drivers/misc/cros_ec.c
+++ b/drivers/misc/cros_ec.c
@@ -1087,7 +1087,7 @@ static int cros_ec_decode_fdt(const void *blob, int node,
#ifdef CONFIG_DM_CROS_EC
int cros_ec_register(struct udevice *dev)
{
- struct cros_ec_dev *cdev = dev->uclass_priv;
+ struct cros_ec_dev *cdev = dev_get_uclass_priv(dev);
const void *blob = gd->fdt_blob;
int node = dev->of_offset;
char id[MSG_BYTES];
@@ -1128,7 +1128,7 @@ int cros_ec_init(const void *blob, struct cros_ec_dev **cros_ecp)
ret = uclass_get_device(UCLASS_CROS_EC, 0, &udev);
if (ret)
return ret;
- dev = udev->uclass_priv;
+ dev = dev_get_uclass_priv(udev);
return 0;
#else
int node = 0;
@@ -1610,7 +1610,7 @@ static int do_cros_ec(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
printf("Cannot get cros-ec device (err=%d)\n", ret);
return 1;
}
- dev = udev->uclass_priv;
+ dev = dev_get_uclass_priv(udev);
#else
/* Just use the last allocated device; there should be only one */
if (!last_dev) {