From: Simon Glass Date: Sat, 19 Dec 2020 17:40:11 +0000 (-0700) Subject: dm: core: Rename device flags to indicate it is private X-Git-Url: http://git.dujemihanovic.xyz/?a=commitdiff_plain;h=156004f863c06ed985ed089450977827e11cb451;p=u-boot.git dm: core: Rename device flags to indicate it is private To avoid having people accidentally access this member, add a trailing underscore. Signed-off-by: Simon Glass --- diff --git a/include/dm/device.h b/include/dm/device.h index 4ec423e961..a0c1752cdd 100644 --- a/include/dm/device.h +++ b/include/dm/device.h @@ -135,7 +135,8 @@ enum { * @uclass_node: Used by uclass to link its devices * @child_head: List of children of this device * @sibling_node: Next device in list of all devices - * @flags: Flags for this device DM_FLAG_... + * @flags_: Flags for this device DM_FLAG_... (do not access outside driver + * model) * @seq_: Allocated sequence number for this device (-1 = none). This is set up * when the device is bound and is unique within the device's uclass. If the * device has an alias in the devicetree then that is used to set the sequence @@ -163,7 +164,7 @@ struct udevice { struct list_head uclass_node; struct list_head child_head; struct list_head sibling_node; - uint32_t flags; + u32 flags_; int seq_; #ifdef CONFIG_DEVRES struct list_head devres_head; @@ -176,24 +177,24 @@ struct udevice { /* Returns the operations for a device */ #define device_get_ops(dev) (dev->driver->ops) -/* Returns non-zero if the device is active (probed and not removed) */ -#define device_active(dev) ((dev)->flags & DM_FLAG_ACTIVATED) - static inline u32 dev_get_flags(const struct udevice *dev) { - return dev->flags; + return dev->flags_; } static inline void dev_or_flags(struct udevice *dev, u32 or) { - dev->flags |= or; + dev->flags_ |= or; } static inline void dev_bic_flags(struct udevice *dev, u32 bic) { - dev->flags &= ~bic; + dev->flags_ &= ~bic; } +/* Returns non-zero if the device is active (probed and not removed) */ +#define device_active(dev) (dev_get_flags(dev) & DM_FLAG_ACTIVATED) + static inline int dev_of_offset(const struct udevice *dev) { return ofnode_to_offset(dev->node);