1
0
mirror of https://xff.cz/git/u-boot/ synced 2025-09-30 06:51:28 +02:00

dm: core: Rename the priv/plat members

These are supposed to be private to driver model, not accessed by any code
outside. Add a trailing underscore to indicate this.

Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Simon Glass
2020-12-22 19:30:30 -07:00
parent 89ba6d5535
commit fb8c9fb3fa
4 changed files with 33 additions and 28 deletions

View File

@@ -514,7 +514,7 @@ void *dev_get_plat(const struct udevice *dev)
return NULL; return NULL;
} }
return dev->plat; return dev->plat_;
} }
void *dev_get_parent_plat(const struct udevice *dev) void *dev_get_parent_plat(const struct udevice *dev)
@@ -524,7 +524,7 @@ void *dev_get_parent_plat(const struct udevice *dev)
return NULL; return NULL;
} }
return dev->parent_plat; return dev->parent_plat_;
} }
void *dev_get_uclass_plat(const struct udevice *dev) void *dev_get_uclass_plat(const struct udevice *dev)
@@ -534,7 +534,7 @@ void *dev_get_uclass_plat(const struct udevice *dev)
return NULL; return NULL;
} }
return dev->uclass_plat; return dev->uclass_plat_;
} }
void *dev_get_priv(const struct udevice *dev) void *dev_get_priv(const struct udevice *dev)
@@ -544,7 +544,7 @@ void *dev_get_priv(const struct udevice *dev)
return NULL; return NULL;
} }
return dev->priv; return dev->priv_;
} }
void *dev_get_uclass_priv(const struct udevice *dev) void *dev_get_uclass_priv(const struct udevice *dev)
@@ -554,7 +554,7 @@ void *dev_get_uclass_priv(const struct udevice *dev)
return NULL; return NULL;
} }
return dev->uclass_priv; return dev->uclass_priv_;
} }
void *dev_get_parent_priv(const struct udevice *dev) void *dev_get_parent_priv(const struct udevice *dev)
@@ -564,7 +564,7 @@ void *dev_get_parent_priv(const struct udevice *dev)
return NULL; return NULL;
} }
return dev->parent_priv; return dev->parent_priv_;
} }
static int device_get_device_tail(struct udevice *dev, int ret, static int device_get_device_tail(struct udevice *dev, int ret,
@@ -966,32 +966,32 @@ int device_set_name(struct udevice *dev, const char *name)
void dev_set_priv(struct udevice *dev, void *priv) void dev_set_priv(struct udevice *dev, void *priv)
{ {
dev->priv = priv; dev->priv_ = priv;
} }
void dev_set_parent_priv(struct udevice *dev, void *parent_priv) void dev_set_parent_priv(struct udevice *dev, void *parent_priv)
{ {
dev->parent_priv = parent_priv; dev->parent_priv_ = parent_priv;
} }
void dev_set_uclass_priv(struct udevice *dev, void *uclass_priv) void dev_set_uclass_priv(struct udevice *dev, void *uclass_priv)
{ {
dev->uclass_priv = uclass_priv; dev->uclass_priv_ = uclass_priv;
} }
void dev_set_plat(struct udevice *dev, void *plat) void dev_set_plat(struct udevice *dev, void *plat)
{ {
dev->plat = plat; dev->plat_ = plat;
} }
void dev_set_parent_plat(struct udevice *dev, void *parent_plat) void dev_set_parent_plat(struct udevice *dev, void *parent_plat)
{ {
dev->parent_plat = parent_plat; dev->parent_plat_ = parent_plat;
} }
void dev_set_uclass_plat(struct udevice *dev, void *uclass_plat) void dev_set_uclass_plat(struct udevice *dev, void *uclass_plat)
{ {
dev->uclass_plat = uclass_plat; dev->uclass_plat_ = uclass_plat;
} }
#if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA) #if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)

View File

@@ -165,12 +165,12 @@ const char *uclass_get_name(enum uclass_id id)
void *uclass_get_priv(const struct uclass *uc) void *uclass_get_priv(const struct uclass *uc)
{ {
return uc->priv; return uc->priv_;
} }
void uclass_set_priv(struct uclass *uc, void *priv) void uclass_set_priv(struct uclass *uc, void *priv)
{ {
uc->priv = priv; uc->priv_ = priv;
} }
enum uclass_id uclass_get_by_name(const char *name) enum uclass_id uclass_get_by_name(const char *name)

View File

@@ -116,17 +116,22 @@ enum {
* *
* @driver: The driver used by this device * @driver: The driver used by this device
* @name: Name of device, typically the FDT node name * @name: Name of device, typically the FDT node name
* @plat: Configuration data for this device * @plat_: Configuration data for this device (do not access outside driver
* @parent_plat: The parent bus's configuration data for this device * model)
* @uclass_plat: The uclass's configuration data for this device * @parent_plat_: The parent bus's configuration data for this device (do not
* access outside driver model)
* @uclass_plat_: The uclass's configuration data for this device (do not access
* outside driver model)
* @node: Reference to device tree node for this device * @node: Reference to device tree node for this device
* @driver_data: Driver data word for the entry that matched this device with * @driver_data: Driver data word for the entry that matched this device with
* its driver * its driver
* @parent: Parent of this device, or NULL for the top level device * @parent: Parent of this device, or NULL for the top level device
* @priv: Private data for this device * @priv_: Private data for this device (do not access outside driver model)
* @uclass: Pointer to uclass for this device * @uclass: Pointer to uclass for this device
* @uclass_priv: The uclass's private data for this device * @uclass_priv_: The uclass's private data for this device (do not access
* @parent_priv: The parent's private data for this device * outside driver model)
* @parent_priv_: The parent's private data for this device (do not access
* outside driver model)
* @uclass_node: Used by uclass to link its devices * @uclass_node: Used by uclass to link its devices
* @child_head: List of children of this device * @child_head: List of children of this device
* @sibling_node: Next device in list of all devices * @sibling_node: Next device in list of all devices
@@ -144,16 +149,16 @@ enum {
struct udevice { struct udevice {
const struct driver *driver; const struct driver *driver;
const char *name; const char *name;
void *plat; void *plat_;
void *parent_plat; void *parent_plat_;
void *uclass_plat; void *uclass_plat_;
ofnode node; ofnode node;
ulong driver_data; ulong driver_data;
struct udevice *parent; struct udevice *parent;
void *priv; void *priv_;
struct uclass *uclass; struct uclass *uclass;
void *uclass_priv; void *uclass_priv_;
void *parent_priv; void *parent_priv_;
struct list_head uclass_node; struct list_head uclass_node;
struct list_head child_head; struct list_head child_head;
struct list_head sibling_node; struct list_head sibling_node;

View File

@@ -24,7 +24,7 @@
* There may be drivers for on-chip SoC GPIO banks, I2C GPIO expanders and * There may be drivers for on-chip SoC GPIO banks, I2C GPIO expanders and
* PMIC IO lines, all made available in a unified way through the uclass. * PMIC IO lines, all made available in a unified way through the uclass.
* *
* @priv: Private data for this uclass * @priv_: Private data for this uclass (do not access outside driver model)
* @uc_drv: The driver for the uclass itself, not to be confused with a * @uc_drv: The driver for the uclass itself, not to be confused with a
* 'struct driver' * 'struct driver'
* @dev_head: List of devices in this uclass (devices are attached to their * @dev_head: List of devices in this uclass (devices are attached to their
@@ -32,7 +32,7 @@
* @sibling_node: Next uclass in the linked list of uclasses * @sibling_node: Next uclass in the linked list of uclasses
*/ */
struct uclass { struct uclass {
void *priv; void *priv_;
struct uclass_driver *uc_drv; struct uclass_driver *uc_drv;
struct list_head dev_head; struct list_head dev_head;
struct list_head sibling_node; struct list_head sibling_node;