diff --git a/drivers/flash/flash_esp32.c b/drivers/flash/flash_esp32.c index 813dced2e8f..216520b5c75 100644 --- a/drivers/flash/flash_esp32.c +++ b/drivers/flash/flash_esp32.c @@ -560,11 +560,6 @@ out: return rc; } -static int flash_esp32_write_protection(const struct device *dev, bool enable) -{ - return 0; -} - #if CONFIG_FLASH_PAGE_LAYOUT static const struct flash_pages_layout flash_esp32_pages_layout = { .pages_count = DT_REG_SIZE(SOC_NV_FLASH_NODE) / FLASH_ERASE_BLK_SZ, @@ -601,7 +596,6 @@ static const struct flash_driver_api flash_esp32_driver_api = { .read = flash_esp32_read, .write = flash_esp32_write, .erase = flash_esp32_erase, - .write_protection = flash_esp32_write_protection, .get_parameters = flash_esp32_get_parameters, #ifdef CONFIG_FLASH_PAGE_LAYOUT .page_layout = flash_esp32_page_layout, diff --git a/drivers/flash/flash_gecko.c b/drivers/flash/flash_gecko.c index a6a8e711dc3..1bfbe046495 100644 --- a/drivers/flash/flash_gecko.c +++ b/drivers/flash/flash_gecko.c @@ -122,15 +122,6 @@ static int flash_gecko_erase(const struct device *dev, off_t offset, return ret; } -static int flash_gecko_write_protection_nop(const struct device *dev, - bool enable) -{ - ARG_UNUSED(dev); - ARG_UNUSED(enable); - - return 0; -} - static void flash_gecko_write_protection(bool enable) { if (enable) { @@ -224,7 +215,6 @@ static const struct flash_driver_api flash_gecko_driver_api = { .read = flash_gecko_read, .write = flash_gecko_write, .erase = flash_gecko_erase, - .write_protection = flash_gecko_write_protection_nop, .get_parameters = flash_gecko_get_parameters, #ifdef CONFIG_FLASH_PAGE_LAYOUT .page_layout = flash_gecko_page_layout, diff --git a/drivers/flash/flash_mcux_flexspi_nor.c b/drivers/flash/flash_mcux_flexspi_nor.c index 7babea172f9..f887b5cf9a7 100644 --- a/drivers/flash/flash_mcux_flexspi_nor.c +++ b/drivers/flash/flash_mcux_flexspi_nor.c @@ -366,12 +366,6 @@ static int flash_flexspi_nor_erase(const struct device *dev, off_t offset, return 0; } -static int flash_flexspi_nor_write_protection(const struct device *dev, - bool enable) -{ - return 0; -} - static const struct flash_parameters *flash_flexspi_nor_get_parameters( const struct device *dev) { @@ -433,7 +427,6 @@ static int flash_flexspi_nor_init(const struct device *dev) } static const struct flash_driver_api flash_flexspi_nor_api = { - .write_protection = flash_flexspi_nor_write_protection, .erase = flash_flexspi_nor_erase, .write = flash_flexspi_nor_write, .read = flash_flexspi_nor_read, diff --git a/drivers/flash/flash_sam.c b/drivers/flash/flash_sam.c index b407f55f54c..88c227fb5b6 100644 --- a/drivers/flash/flash_sam.c +++ b/drivers/flash/flash_sam.c @@ -310,14 +310,6 @@ static int flash_sam_erase(const struct device *dev, off_t offset, size_t len) return rc; } -static int flash_sam_write_protection_nop(const struct device *dev, bool enable) -{ - ARG_UNUSED(dev); - ARG_UNUSED(enable); - - return 0; -} - /* Enable or disable the write protection */ static int flash_sam_write_protection(const struct device *dev, bool enable) { @@ -375,7 +367,6 @@ static int flash_sam_init(const struct device *dev) } static const struct flash_driver_api flash_sam_api = { - .write_protection = flash_sam_write_protection_nop, .erase = flash_sam_erase, .write = flash_sam_write, .read = flash_sam_read, diff --git a/drivers/flash/flash_sam0.c b/drivers/flash/flash_sam0.c index 8bde89cf0e0..db8af0d55ad 100644 --- a/drivers/flash/flash_sam0.c +++ b/drivers/flash/flash_sam0.c @@ -379,15 +379,6 @@ static int flash_sam0_erase(const struct device *dev, off_t offset, return err; } -static int flash_sam0_write_protection_nop(const struct device *dev, - bool enable) -{ - ARG_UNUSED(dev); - ARG_UNUSED(enable); - - return 0; -} - static int flash_sam0_write_protection(const struct device *dev, bool enable) { off_t offset; @@ -464,7 +455,6 @@ static int flash_sam0_init(const struct device *dev) } static const struct flash_driver_api flash_sam0_api = { - .write_protection = flash_sam0_write_protection_nop, .erase = flash_sam0_erase, .write = flash_sam0_write, .read = flash_sam0_read, diff --git a/drivers/flash/flash_simulator.c b/drivers/flash/flash_simulator.c index 7356f9a5b9b..6aa11077db5 100644 --- a/drivers/flash/flash_simulator.c +++ b/drivers/flash/flash_simulator.c @@ -156,14 +156,6 @@ static int flash_range_is_valid(const struct device *dev, off_t offset, return 1; } -static int flash_wp_set(const struct device *dev, bool enable) -{ - ARG_UNUSED(dev); - ARG_UNUSED(enable); - - return 0; -} - static int flash_sim_read(const struct device *dev, const off_t offset, void *data, const size_t len) @@ -346,7 +338,6 @@ static const struct flash_driver_api flash_sim_api = { .read = flash_sim_read, .write = flash_sim_write, .erase = flash_sim_erase, - .write_protection = flash_wp_set, .get_parameters = flash_sim_get_parameters, #ifdef CONFIG_FLASH_PAGE_LAYOUT .page_layout = flash_sim_page_layout, diff --git a/drivers/flash/flash_stm32.c b/drivers/flash/flash_stm32.c index 4903d3dc3ed..1d669eff21f 100644 --- a/drivers/flash/flash_stm32.c +++ b/drivers/flash/flash_stm32.c @@ -287,15 +287,6 @@ static int flash_stm32_write(const struct device *dev, off_t offset, return rc; } -static int flash_stm32_write_protection_nop(const struct device *dev, - bool enable) -{ - ARG_UNUSED(dev); - ARG_UNUSED(enable); - - return 0; -} - static int flash_stm32_write_protection(const struct device *dev, bool enable) { FLASH_TypeDef *regs = FLASH_STM32_REGS(dev); @@ -369,7 +360,6 @@ static struct flash_stm32_priv flash_data = { }; static const struct flash_driver_api flash_stm32_api = { - .write_protection = flash_stm32_write_protection_nop, .erase = flash_stm32_erase, .write = flash_stm32_write, .read = flash_stm32_read, diff --git a/drivers/flash/flash_stm32_qspi.c b/drivers/flash/flash_stm32_qspi.c index 5be2497b595..04b7de76667 100644 --- a/drivers/flash/flash_stm32_qspi.c +++ b/drivers/flash/flash_stm32_qspi.c @@ -422,15 +422,6 @@ static int flash_stm32_qspi_erase(const struct device *dev, off_t addr, return ret; } -static int flash_stm32_qspi_write_protection_set(const struct device *dev, - bool write_protect) -{ - ARG_UNUSED(dev); - ARG_UNUSED(write_protect); - - return 0; -} - static const struct flash_parameters flash_stm32_qspi_parameters = { .write_block_size = 1, .erase_value = 0xff @@ -562,7 +553,6 @@ static const struct flash_driver_api flash_stm32_qspi_driver_api = { .read = flash_stm32_qspi_read, .write = flash_stm32_qspi_write, .erase = flash_stm32_qspi_erase, - .write_protection = flash_stm32_qspi_write_protection_set, .get_parameters = flash_stm32_qspi_get_parameters, #if defined(CONFIG_FLASH_PAGE_LAYOUT) .page_layout = flash_stm32_qspi_pages_layout, diff --git a/drivers/flash/flash_stm32h7x.c b/drivers/flash/flash_stm32h7x.c index 530a29e4ce1..6ea0bff18ad 100644 --- a/drivers/flash/flash_stm32h7x.c +++ b/drivers/flash/flash_stm32h7x.c @@ -377,15 +377,6 @@ int flash_stm32_write_range(const struct device *dev, unsigned int offset, return rc; } -static int flash_stm32h7_write_protection_nop(const struct device *dev, - bool enable) -{ - ARG_UNUSED(dev); - ARG_UNUSED(enable); - - return 0; -} - static int flash_stm32h7_write_protection(const struct device *dev, bool enable) { FLASH_TypeDef *regs = FLASH_STM32_REGS(dev); @@ -619,7 +610,6 @@ static struct flash_stm32_priv flash_data = { }; static const struct flash_driver_api flash_stm32h7_api = { - .write_protection = flash_stm32h7_write_protection_nop, .erase = flash_stm32h7_erase, .write = flash_stm32h7_write, .read = flash_stm32h7_read, diff --git a/drivers/flash/nrf_qspi_nor.c b/drivers/flash/nrf_qspi_nor.c index be37799d7a9..1a5866e4713 100644 --- a/drivers/flash/nrf_qspi_nor.c +++ b/drivers/flash/nrf_qspi_nor.c @@ -106,8 +106,6 @@ struct qspi_nor_data { #endif /* CONFIG_MULTITHREADING */ }; -static int qspi_nor_write_protection_nop(const struct device *dev, - bool write_protect); static int qspi_nor_write_protection_set(const struct device *dev, bool write_protect); @@ -953,15 +951,6 @@ static int qspi_nor_erase(const struct device *dev, off_t addr, size_t size) return ret; } -static int qspi_nor_write_protection_nop(const struct device *dev, - bool write_protect) -{ - ARG_UNUSED(dev); - ARG_UNUSED(write_protect); - - return 0; -} - static int qspi_nor_write_protection_set(const struct device *dev, bool write_protect) { @@ -1061,7 +1050,6 @@ static const struct flash_driver_api qspi_nor_api = { .read = qspi_nor_read, .write = qspi_nor_write, .erase = qspi_nor_erase, - .write_protection = qspi_nor_write_protection_nop, .get_parameters = qspi_flash_get_parameters, #if defined(CONFIG_FLASH_PAGE_LAYOUT) .page_layout = qspi_nor_pages_layout, diff --git a/drivers/flash/soc_flash_lpc.c b/drivers/flash/soc_flash_lpc.c index c46c8f07878..e3fc2132a76 100644 --- a/drivers/flash/soc_flash_lpc.c +++ b/drivers/flash/soc_flash_lpc.c @@ -117,14 +117,6 @@ static int flash_lpc_write(const struct device *dev, off_t offset, return (rc == kStatus_FLASHIAP_Success) ? 0 : -EINVAL; } -static int flash_lpc_write_protection(const struct device *dev, bool enable) -{ - ARG_UNUSED(dev); - ARG_UNUSED(enable); - - return 0; -} - #if defined(CONFIG_FLASH_PAGE_LAYOUT) static const struct flash_pages_layout dev_layout = { .pages_count = DT_REG_SIZE(SOC_NV_FLASH_NODE) / @@ -152,7 +144,6 @@ flash_lpc_get_parameters(const struct device *dev) static struct flash_priv flash_data; static const struct flash_driver_api flash_lpc_api = { - .write_protection = flash_lpc_write_protection, .erase = flash_lpc_erase, .write = flash_lpc_write, .read = flash_lpc_read, diff --git a/drivers/flash/soc_flash_mcux.c b/drivers/flash/soc_flash_mcux.c index a8ac571ad0e..0d93ac3918a 100644 --- a/drivers/flash/soc_flash_mcux.c +++ b/drivers/flash/soc_flash_mcux.c @@ -224,14 +224,6 @@ static int flash_mcux_write(const struct device *dev, off_t offset, return (rc == kStatus_Success) ? 0 : -EINVAL; } -static int flash_mcux_write_protection(const struct device *dev, bool enable) -{ - ARG_UNUSED(dev); - ARG_UNUSED(enable); - - return 0; -} - #if defined(CONFIG_FLASH_PAGE_LAYOUT) static const struct flash_pages_layout dev_layout = { .pages_count = DT_REG_SIZE(SOC_NV_FLASH_NODE) / @@ -259,7 +251,6 @@ flash_mcux_get_parameters(const struct device *dev) static struct flash_priv flash_data; static const struct flash_driver_api flash_mcux_api = { - .write_protection = flash_mcux_write_protection, .erase = flash_mcux_erase, .write = flash_mcux_write, .read = flash_mcux_read, diff --git a/drivers/flash/soc_flash_nios2_qspi.c b/drivers/flash/soc_flash_nios2_qspi.c index 4f969f68255..8d97a8107ad 100644 --- a/drivers/flash/soc_flash_nios2_qspi.c +++ b/drivers/flash/soc_flash_nios2_qspi.c @@ -418,15 +418,6 @@ static int flash_nios2_qspi_read(const struct device *dev, off_t offset, return rc; } -static int flash_nios2_qspi_write_protection_nop(const struct device *dev, - bool write_protect) -{ - ARG_UNUSED(dev); - ARG_UNUSED(write_protect); - - return 0; -} - static int flash_nios2_qspi_write_protection(const struct device *dev, bool enable) { @@ -498,7 +489,6 @@ flash_nios2_qspi_get_parameters(const struct device *dev) } static const struct flash_driver_api flash_nios2_qspi_api = { - .write_protection = flash_nios2_qspi_write_protection_nop, .erase = flash_nios2_qspi_erase, .write = flash_nios2_qspi_write, .read = flash_nios2_qspi_read, diff --git a/drivers/flash/soc_flash_nrf.c b/drivers/flash/soc_flash_nrf.c index 396999c31da..ccd635cb115 100644 --- a/drivers/flash/soc_flash_nrf.c +++ b/drivers/flash/soc_flash_nrf.c @@ -241,11 +241,6 @@ static int flash_nrf_erase(const struct device *dev, off_t addr, size_t size) return ret; } -static int flash_nrf_write_protection(const struct device *dev, bool enable) -{ - return 0; -} - #if defined(CONFIG_FLASH_PAGE_LAYOUT) static struct flash_pages_layout dev_layout; @@ -270,7 +265,6 @@ static const struct flash_driver_api flash_nrf_api = { .read = flash_nrf_read, .write = flash_nrf_write, .erase = flash_nrf_erase, - .write_protection = flash_nrf_write_protection, .get_parameters = flash_nrf_get_parameters, #if defined(CONFIG_FLASH_PAGE_LAYOUT) .page_layout = flash_nrf_pages_layout, diff --git a/drivers/flash/soc_flash_rv32m1.c b/drivers/flash/soc_flash_rv32m1.c index 1a20b6fccf8..469896ab77e 100644 --- a/drivers/flash/soc_flash_rv32m1.c +++ b/drivers/flash/soc_flash_rv32m1.c @@ -106,14 +106,6 @@ static int flash_mcux_write(const struct device *dev, off_t offset, return (rc == kStatus_Success) ? 0 : -EINVAL; } -static int flash_mcux_write_protection(const struct device *dev, bool enable) -{ - ARG_UNUSED(dev); - ARG_UNUSED(enable); - - return 0; -} - #if defined(CONFIG_FLASH_PAGE_LAYOUT) static const struct flash_pages_layout dev_layout = { .pages_count = DT_REG_SIZE(SOC_NV_FLASH_NODE) / @@ -141,7 +133,6 @@ flash_mcux_get_parameters(const struct device *dev) static struct flash_priv flash_data; static const struct flash_driver_api flash_mcux_api = { - .write_protection = flash_mcux_write_protection, .erase = flash_mcux_erase, .write = flash_mcux_write, .read = flash_mcux_read, diff --git a/drivers/flash/spi_flash_at45.c b/drivers/flash/spi_flash_at45.c index c023b9de47e..0a246d4a2c1 100644 --- a/drivers/flash/spi_flash_at45.c +++ b/drivers/flash/spi_flash_at45.c @@ -486,24 +486,6 @@ static int spi_flash_at45_erase(const struct device *dev, off_t offset, return err; } -static int spi_flash_at45_write_protection(const struct device *dev, - bool enable) -{ - ARG_UNUSED(dev); - ARG_UNUSED(enable); - - /* The Sector Protection mechanism that is available in AT45 family - * chips is more complex than what is exposed by the the flash API - * (particular sectors need to be earlier configured in a write to - * the nonvolatile Sector Protection Register), so it is not feasible - * to try to use it here. Since the protection is not automatically - * enabled after the device is power cycled, there is nothing needed - * to be done in this function. - */ - - return 0; -} - #if IS_ENABLED(CONFIG_FLASH_PAGE_LAYOUT) static void spi_flash_at45_pages_layout(const struct device *dev, const struct flash_pages_layout **layout, @@ -648,7 +630,6 @@ static const struct flash_driver_api spi_flash_at45_api = { .read = spi_flash_at45_read, .write = spi_flash_at45_write, .erase = spi_flash_at45_erase, - .write_protection = spi_flash_at45_write_protection, .get_parameters = flash_at45_get_parameters, #if IS_ENABLED(CONFIG_FLASH_PAGE_LAYOUT) .page_layout = spi_flash_at45_pages_layout, diff --git a/drivers/flash/spi_nor.c b/drivers/flash/spi_nor.c index d69036445b1..fa1941a7888 100644 --- a/drivers/flash/spi_nor.c +++ b/drivers/flash/spi_nor.c @@ -595,15 +595,6 @@ static int spi_nor_erase(const struct device *dev, off_t addr, size_t size) return ret; } -static int spi_nor_write_protection_nop(const struct device *dev, - bool write_protect) -{ - ARG_UNUSED(dev); - ARG_UNUSED(write_protect); - - return 0; -} - static int spi_nor_write_protection_set(const struct device *dev, bool write_protect) { @@ -985,7 +976,6 @@ static const struct flash_driver_api spi_nor_api = { .read = spi_nor_read, .write = spi_nor_write, .erase = spi_nor_erase, - .write_protection = spi_nor_write_protection_nop, .get_parameters = flash_nor_get_parameters, #if defined(CONFIG_FLASH_PAGE_LAYOUT) .page_layout = spi_nor_pages_layout,