From mboxrd@z Thu Jan 1 00:00:00 1970 From: sjg at google.com Date: Fri, 10 Jan 2020 03:57:39 -0500 Subject: [PATCH 12/19] dm: core: Add a new flag to track platform data In-Reply-To: <20191229211913.12.Iaee21ff41733fc4ee01284e3a7ca6f57874a1a1b@changeid> References: <20191229211913.12.Iaee21ff41733fc4ee01284e3a7ca6f57874a1a1b@changeid> <20191230041928.74874-1-sjg@chromium.org> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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 --- 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!