
10 Jan
2020
10 Jan
'20
9:57 a.m.
We want to avoid allocating platform data twice. This could happen if device_probe() is called after device_ofdata_to_platdata() for the same device.
Add a flag to track whether device_ofdata_to_platdata() has been called on a device. Check the flag to make sure it doesn't happen twice, and clear the flag when the data is freed.
Signed-off-by: Simon Glass sjg@chromium.org ---
drivers/core/device-remove.c | 1 + drivers/core/device.c | 4 +++- include/dm/device.h | 3 +++ 3 files changed, 7 insertions(+), 1 deletion(-)
Applied to u-boot-dm, thanks!