dm: Use access methods for dev/uclass private data
Most drivers use these access methods but a few do not. Update them.
In some cases the access is not permitted, so mark those with a FIXME tag
for the maintainer to check.
Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Pratyush Yadav <p.yadav@ti.com>
diff --git a/drivers/core/device-remove.c b/drivers/core/device-remove.c
index 289220b..8c12169 100644
--- a/drivers/core/device-remove.c
+++ b/drivers/core/device-remove.c
@@ -89,15 +89,15 @@
return log_msg_ret("child unbind", ret);
if (dev->flags & DM_FLAG_ALLOC_PDATA) {
- free(dev->plat);
- dev->plat = NULL;
+ free(dev_get_plat(dev));
+ dev_set_plat(dev, NULL);
}
if (dev->flags & DM_FLAG_ALLOC_UCLASS_PDATA) {
- free(dev->uclass_plat);
+ free(dev_get_uclass_plat(dev));
dev->uclass_plat = NULL;
}
if (dev->flags & DM_FLAG_ALLOC_PARENT_PDATA) {
- free(dev->parent_plat);
+ free(dev_get_parent_plat(dev));
dev->parent_plat = NULL;
}
ret = uclass_unbind_device(dev);
@@ -125,12 +125,12 @@
int size;
if (dev->driver->priv_auto) {
- free(dev->priv);
- dev->priv = NULL;
+ free(dev_get_priv(dev));
+ dev_set_priv(dev, NULL);
}
size = dev->uclass->uc_drv->per_device_auto;
if (size) {
- free(dev->uclass_priv);
+ free(dev_get_uclass_priv(dev));
dev->uclass_priv = NULL;
}
if (dev->parent) {
@@ -140,7 +140,7 @@
per_child_auto;
}
if (size) {
- free(dev->parent_priv);
+ free(dev_get_parent_priv(dev));
dev->parent_priv = NULL;
}
}