From 4339138a2086f8449b9356130cb6e97a81aa8679 Mon Sep 17 00:00:00 2001
From: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Date: Tue, 4 Jun 2024 07:44:25 +0200
Subject: [PATCH] dfu: add missing dependency for SPI flash DFU driver
MIME-Version: 1.0
Content-Type: text/plain; charset=utf8
Content-Transfer-Encoding: 8bit

Building the SPI flash DFU driver fails if SPI flash support is missing.

    drivers/dfu/dfu_sf.c:123:29: error:
    ‘CONFIG_SF_DEFAULT_MODE’ undeclared (first use in this function);

Add the missing dependency.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Link: https://lore.kernel.org/r/20240604054425.105902-1-heinrich.schuchardt@canonical.com
Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
---
 drivers/dfu/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/dfu/Kconfig b/drivers/dfu/Kconfig
index 0360d9da14..971204758a 100644
--- a/drivers/dfu/Kconfig
+++ b/drivers/dfu/Kconfig
@@ -68,6 +68,7 @@ config DFU_RAM
 
 config DFU_SF
 	bool "SPI flash back end for DFU"
+	depends on SPI_FLASH || DM_SPI_FLASH
 	help
 	  This option enables using DFU to read and write to SPI flash based
 	  storage.
-- 
2.39.5