From patchwork Sun Jan 12 19:06:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 239521 List-Id: U-Boot discussion From: sjg at chromium.org (Simon Glass) Date: Sun, 12 Jan 2020 12:06:23 -0700 Subject: [PATCH 32/33] sandbox: Complete migration away from os_malloc() In-Reply-To: <20200112190624.79077-1-sjg@chromium.org> References: <20200112190624.79077-1-sjg@chromium.org> Message-ID: <20200112120216.32.I98bcf2c9d3516b00a2b4205dc94e7eb330ff6cfd@changeid> Now that we can use direct access to the system malloc() in sandbox, drop the remaining uses of os_malloc(). The only one remaining now is for the RAM buffer, which we do want to be at a known adress, so this is intended. Signed-off-by: Simon Glass --- drivers/misc/cros_ec_sandbox.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/misc/cros_ec_sandbox.c b/drivers/misc/cros_ec_sandbox.c index 4fcb2d96f5..9dd6a18b2b 100644 --- a/drivers/misc/cros_ec_sandbox.c +++ b/drivers/misc/cros_ec_sandbox.c @@ -11,10 +11,10 @@ #include #include #include -#include #include #include #include +#include #include #include #include @@ -115,7 +115,7 @@ static int cros_ec_read_state(const void *blob, int node) prop = fdt_getprop(blob, node, "flash-data", &len); if (prop) { ec->flash_data_len = len; - ec->flash_data = os_malloc(len); + ec->flash_data = malloc(len); if (!ec->flash_data) return -ENOMEM; memcpy(ec->flash_data, prop, len); @@ -545,14 +545,14 @@ int cros_ec_probe(struct udevice *dev) ec->flash_data_len != ec->ec_config.flash.length) { printf("EC data length is %x, expected %x, discarding data\n", ec->flash_data_len, ec->ec_config.flash.length); - os_free(ec->flash_data); + free(ec->flash_data); ec->flash_data = NULL; } /* Otherwise allocate the memory */ if (!ec->flash_data) { ec->flash_data_len = ec->ec_config.flash.length; - ec->flash_data = os_malloc(ec->flash_data_len); + ec->flash_data = malloc(ec->flash_data_len); if (!ec->flash_data) return -ENOMEM; }