dm: core: Add a new flag to track platform data
authorSimon Glass <sjg@chromium.org>
Mon, 30 Dec 2019 04:19:21 +0000 (21:19 -0700)
committerSimon Glass <sjg@chromium.org>
Tue, 7 Jan 2020 23:02:38 +0000 (16:02 -0700)
commit153851ddfa39dc1bd4f3b5402d80487d52c644aa
tree3c4d8ba6098fae5410decb45a559d6f339f43fc4
parentbcd90cb6928414e14942c01af374863d4049a25d
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>
drivers/core/device-remove.c
drivers/core/device.c
include/dm/device.h