diff options
author | Simon Glass <sjg@chromium.org> | 2020-12-23 05:30:27 +0300 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2021-01-05 22:24:40 +0300 |
commit | 12559f5bab3e43b603dccfa6c354ffd7da03249c (patch) | |
tree | 91034c495cff6034a6c35ece663db199c81334c7 /drivers/core/device.c | |
parent | 806473933adf52740864ab6cdab8c90a84c0b1f3 (diff) | |
download | u-boot-12559f5bab3e43b603dccfa6c354ffd7da03249c.tar.xz |
dm: core: Add functions to set priv/plat
This should not normally be needed in drivers, but add accessors for the
few cases that exist.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers/core/device.c')
-rw-r--r-- | drivers/core/device.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/drivers/core/device.c b/drivers/core/device.c index d1a08ce783..f2d750c8de 100644 --- a/drivers/core/device.c +++ b/drivers/core/device.c @@ -959,6 +959,36 @@ int device_set_name(struct udevice *dev, const char *name) return 0; } +void dev_set_priv(struct udevice *dev, void *priv) +{ + dev->priv = priv; +} + +void dev_set_parent_priv(struct udevice *dev, void *parent_priv) +{ + dev->parent_priv = parent_priv; +} + +void dev_set_uclass_priv(struct udevice *dev, void *uclass_priv) +{ + dev->uclass_priv = uclass_priv; +} + +void dev_set_plat(struct udevice *dev, void *plat) +{ + dev->plat = plat; +} + +void dev_set_parent_plat(struct udevice *dev, void *parent_plat) +{ + dev->parent_plat = parent_plat; +} + +void dev_set_uclass_plat(struct udevice *dev, void *uclass_plat) +{ + dev->uclass_plat = uclass_plat; +} + #if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA) bool device_is_compatible(const struct udevice *dev, const char *compat) { |