[PATCH 12/19] dm: core: Add a new flag to track platform data

sjg at google.com sjg at google.com
Fri Jan 10 09:57:39 CET 2020


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 at 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!


More information about the U-Boot mailing list