From e564f054af002d9e6a1080ed9d4bc2c6052a4435 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Thu, 5 Mar 2015 12:25:20 -0700 Subject: 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 --- common/cmd_sf.c | 2 +- common/cros_ec.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'common') diff --git a/common/cmd_sf.c b/common/cmd_sf.c index 5c788e96bd..20f14d3fc4 100644 --- a/common/cmd_sf.c +++ b/common/cmd_sf.c @@ -130,7 +130,7 @@ static int do_spi_flash_probe(int argc, char * const argv[]) return 1; } - flash = new->uclass_priv; + flash = dev_get_uclass_priv(new); #else new = spi_flash_probe(bus, cs, speed, mode); if (!new) { diff --git a/common/cros_ec.c b/common/cros_ec.c index bb299bccff..64b46796ef 100644 --- a/common/cros_ec.c +++ b/common/cros_ec.c @@ -35,7 +35,7 @@ struct cros_ec_dev *board_get_cros_ec_dev(void) debug("%s: Error %d\n", __func__, ret); return NULL; } - return dev->uclass_priv; + return dev_get_uclass_priv(dev); #else return local.cros_ec_dev; #endif -- cgit v1.2.1