From aa284fcd49379fefe869b502050aaa40110ea1de Mon Sep 17 00:00:00 2001 From: Tim Lin Date: Tue, 13 Jul 2021 14:54:30 +0800 Subject: zephyr/drivers: it8xxx2: flash protection API is deprecated The function of flash_write_protection_set() is deprecated and will be removed in Zephyr 2.8. BUG=b:187192628 BRANCH=none TEST=No warning while building the board of hayato on zephyr2.6 Change-Id: I65e38557d7d65b6f079f20af7ecc098e30d57220 Signed-off-by: Tim Lin Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3023747 Reviewed-by: Denis Brockus Reviewed-by: Keith Short Tested-by: Denis Brockus Commit-Queue: Denis Brockus --- zephyr/drivers/cros_flash/cros_flash_it8xxx2.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/zephyr/drivers/cros_flash/cros_flash_it8xxx2.c b/zephyr/drivers/cros_flash/cros_flash_it8xxx2.c index 0f2102f401..5b7c04a24a 100644 --- a/zephyr/drivers/cros_flash/cros_flash_it8xxx2.c +++ b/zephyr/drivers/cros_flash/cros_flash_it8xxx2.c @@ -232,7 +232,9 @@ static int cros_flash_it8xxx2_protect_now(const struct device *dev, int all) if (all) { /* Protect the entire flash */ - flash_write_protection_set(flash_controller, all); + flash_protect_banks(0, + CONFIG_FLASH_SIZE_BYTES / CONFIG_FLASH_BANK_SIZE, + FLASH_WP_EC); data->all_protected = 1; } else { /* Protect the read-only section and persistent state */ -- cgit v1.2.1