summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/soc/intel/common/block/fast_spi/fast_spi.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/soc/intel/common/block/fast_spi/fast_spi.c b/src/soc/intel/common/block/fast_spi/fast_spi.c
index 74449df746..53826447c6 100644
--- a/src/soc/intel/common/block/fast_spi/fast_spi.c
+++ b/src/soc/intel/common/block/fast_spi/fast_spi.c
@@ -502,17 +502,17 @@ static const char *fast_spi_acpi_name(const struct device *dev)
*/
static void fast_spi_fill_ssdt(const struct device *dev)
{
+ /* Do not add SSDT if the fast SPI device is hidden. */
+ if (!CONFIG(FAST_SPI_GENERATE_SSDT) || dev->hidden)
+ return;
+
const char *scope = acpi_device_scope(dev);
const char *hid = fast_spi_acpi_hid(dev);
- struct resource *res;
- /* Do not add SSDT if the fast SPI device is hidden. */
- if (dev->hidden || !CONFIG(FAST_SPI_GENERATE_SSDT))
- return;
if (!scope || !hid)
return;
- res = probe_resource(dev, PCI_BASE_ADDRESS_0);
+ struct resource *res = probe_resource(dev, PCI_BASE_ADDRESS_0);
if (!res)
return;