mirror of
https://github.com/u-boot/u-boot.git
synced 2025-05-09 03:21:51 +00:00
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>
This commit is contained in:
parent
6a6d8fbef7
commit
89876a55a6
3 changed files with 8 additions and 4 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue