diff options
author | Simon Glass <sjg@chromium.org> | 2014-06-11 23:29:49 -0600 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2014-06-20 11:55:49 -0600 |
commit | 89876a55a62f495302e2fd76094e45a65ca188b2 (patch) | |
tree | 54dee9f0c349937bf39a2aebc2a7e1d9e6e60842 /include/dm | |
parent | 6a6d8fbef7eb801a6babad8a62b1318d098ed7ed (diff) | |
download | u-boot-89876a55a62f495302e2fd76094e45a65ca188b2.zip u-boot-89876a55a62f495302e2fd76094e45a65ca188b2.tar.gz u-boot-89876a55a62f495302e2fd76094e45a65ca188b2.tar.bz2 |
dm: Cast away the const-ness of the global_data pointer
In a very few cases we need to adjust the driver model root device, such as
when setting it up at initialisation. Add a macro to make this easier.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include/dm')
-rw-r--r-- | include/dm/device-internal.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/dm/device-internal.h b/include/dm/device-internal.h index ea3df36..26e5cf5 100644 --- a/include/dm/device-internal.h +++ b/include/dm/device-internal.h @@ -84,4 +84,8 @@ int device_remove(struct udevice *dev); */ int device_unbind(struct udevice *dev); +/* Cast away any volatile pointer */ +#define DM_ROOT_NON_CONST (((gd_t *)gd)->dm_root) +#define DM_UCLASS_ROOT_NON_CONST (((gd_t *)gd)->uclass_root) + #endif |