From b08bf4c35caa2baaa0453b7979ed538cf71b6de5 Mon Sep 17 00:00:00 2001 From: Marcin Wojtas Date: Thu, 20 May 2021 11:16:40 +0200 Subject: [PATCH] sdhci_fsl_fdt: Skip vccq reconfiguration without regulator There is no need to preform any voltage reconfiguration in case the vccq regulator is not physically attached to the slot. Submitted by: Lukasz Hajec Obtained from: Semihalf Sponsored by: Alstom Group Differential Revision: https://reviews.freebsd.org/D30355 --- sys/dev/sdhci/sdhci_fsl_fdt.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/dev/sdhci/sdhci_fsl_fdt.c b/sys/dev/sdhci/sdhci_fsl_fdt.c index 26092f662406..91d926c343cc 100644 --- a/sys/dev/sdhci/sdhci_fsl_fdt.c +++ b/sys/dev/sdhci/sdhci_fsl_fdt.c @@ -493,15 +493,15 @@ sdhci_fsl_fdt_switch_vccq(device_t brdev, device_t reqdev) struct sdhci_slot *slot; int uvolt, err; - err = sdhci_generic_switch_vccq(brdev, reqdev); - if (err != 0) - return (err); - sc = device_get_softc(brdev); if (sc->fdt_helper.vqmmc_supply == NULL) return EOPNOTSUPP; + err = sdhci_generic_switch_vccq(brdev, reqdev); + if (err != 0) + return (err); + slot = device_get_ivars(reqdev); switch (slot->host.ios.vccq) { case vccq_180: