Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 29 Jul 2020 08:24:40 +0000 (UTC)
From:      Andrew Turner <andrew@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r363660 - head/sys/arm/broadcom/bcm2835
Message-ID:  <202007290824.06T8Oev4035466@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: andrew
Date: Wed Jul 29 08:24:40 2020
New Revision: 363660
URL: https://svnweb.freebsd.org/changeset/base/363660

Log:
  Only try managing the regulator when EXT_RESOURCES is defined
  
  Not all Raspberry Pi kernel configs define EXT_RESOURCES. Check for this
  before trying to manage the regulator.
  
  Sponsored by:	Innovate UK

Modified:
  head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c

Modified: head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c
==============================================================================
--- head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c	Wed Jul 29 05:27:19 2020	(r363659)
+++ head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c	Wed Jul 29 08:24:40 2020	(r363660)
@@ -394,10 +394,13 @@ bcm_sdhci_intr(void *arg)
 static int
 bcm_sdhci_update_ios(device_t bus, device_t child)
 {
+#ifdef EXT_RESOURCES
 	struct bcm_sdhci_softc *sc;
 	struct mmc_ios *ios;
+#endif
 	int rv;
 
+#ifdef EXT_RESOURCES
 	sc = device_get_softc(bus);
 	ios = &sc->sc_slot.host.ios;
 
@@ -407,17 +410,20 @@ bcm_sdhci_update_ios(device_t bus, device_t child)
 		if (sc->sc_mmc_helper.vqmmc_supply)
 			regulator_enable(sc->sc_mmc_helper.vqmmc_supply);
 	}
+#endif
 
 	rv = sdhci_generic_update_ios(bus, child);
 	if (rv != 0)
 		return (rv);
 
+#ifdef EXT_RESOURCES
 	if (ios->power_mode == power_off) {
 		if (sc->sc_mmc_helper.vmmc_supply)
 			regulator_disable(sc->sc_mmc_helper.vmmc_supply);
 		if (sc->sc_mmc_helper.vqmmc_supply)
 			regulator_disable(sc->sc_mmc_helper.vqmmc_supply);
 	}
+#endif
 
 	return (0);
 }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202007290824.06T8Oev4035466>