diff options
author | Simon Glass <sjg@chromium.org> | 2020-12-23 05:30:29 +0300 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2021-01-05 22:24:40 +0300 |
commit | 89ba6d553572fe9177ae472170b8373e49f97953 (patch) | |
tree | e71f9263d0c27163d49e78157963de130393e148 /drivers/core/device-remove.c | |
parent | 0fd3d91152df5bb6c5f7b9ee68f01a9a1c9a875d (diff) | |
download | u-boot-89ba6d553572fe9177ae472170b8373e49f97953.tar.xz |
dm: core: Use access methods for dev/uclass private data
Use these functions in the core code as much as possible. With this, there
are only two places where each priv/plat pointer is accessed, one for read
and one for write.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers/core/device-remove.c')
-rw-r--r-- | drivers/core/device-remove.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/core/device-remove.c b/drivers/core/device-remove.c index 8c12169771..e15ab051be 100644 --- a/drivers/core/device-remove.c +++ b/drivers/core/device-remove.c @@ -94,11 +94,11 @@ int device_unbind(struct udevice *dev) } if (dev->flags & DM_FLAG_ALLOC_UCLASS_PDATA) { free(dev_get_uclass_plat(dev)); - dev->uclass_plat = NULL; + dev_set_uclass_plat(dev, NULL); } if (dev->flags & DM_FLAG_ALLOC_PARENT_PDATA) { free(dev_get_parent_plat(dev)); - dev->parent_plat = NULL; + dev_set_parent_plat(dev, NULL); } ret = uclass_unbind_device(dev); if (ret) @@ -131,7 +131,7 @@ void device_free(struct udevice *dev) size = dev->uclass->uc_drv->per_device_auto; if (size) { free(dev_get_uclass_priv(dev)); - dev->uclass_priv = NULL; + dev_set_uclass_priv(dev, NULL); } if (dev->parent) { size = dev->parent->driver->per_child_auto; @@ -141,7 +141,7 @@ void device_free(struct udevice *dev) } if (size) { free(dev_get_parent_priv(dev)); - dev->parent_priv = NULL; + dev_set_parent_priv(dev, NULL); } } dev->flags &= ~DM_FLAG_PLATDATA_VALID; |