diff options
author | Simon Glass <sjg@chromium.org> | 2019-12-29 21:19:21 -0700 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2020-01-07 16:02:38 -0700 |
commit | 153851ddfa39dc1bd4f3b5402d80487d52c644aa (patch) | |
tree | 3c4d8ba6098fae5410decb45a559d6f339f43fc4 /include | |
parent | bcd90cb6928414e14942c01af374863d4049a25d (diff) | |
download | u-boot-153851ddfa39dc1bd4f3b5402d80487d52c644aa.tar.gz u-boot-153851ddfa39dc1bd4f3b5402d80487d52c644aa.tar.bz2 u-boot-153851ddfa39dc1bd4f3b5402d80487d52c644aa.zip |
dm: core: Add a new flag to track platform data
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>
Diffstat (limited to 'include')
-rw-r--r-- | include/dm/device.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/dm/device.h b/include/dm/device.h index 21774708e7..9ebfd0a34e 100644 --- a/include/dm/device.h +++ b/include/dm/device.h @@ -65,6 +65,9 @@ struct driver_info; /* DM does not enable/disable the power domains corresponding to this device */ #define DM_FLAG_DEFAULT_PD_CTRL_OFF (1 << 11) +/* Driver platdata has been read. Cleared when the device is removed */ +#define DM_FLAG_PLATDATA_VALID (1 << 12) + /* * One or multiple of these flags are passed to device_remove() so that * a selective device removal as specified by the remove-stage and the |