]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
mmc: Only retrieve cd pin when GPIO is enabled
authorHarm Berntsen <harm.berntsen@nedap.com>
Fri, 6 Nov 2020 12:20:44 +0000 (12:20 +0000)
committerTom Rini <trini@konsulko.com>
Mon, 18 Jan 2021 20:14:15 +0000 (15:14 -0500)
The driver only needs to retrieve the pin for the ACPI info. The driver
itself works without depending on GPIO.

Signed-off-by: Harm Berntsen <harm.berntsen@nedap.com>
CC: Simon Glass <sjg@chromium.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
drivers/mmc/pci_mmc.c

index c71c495d581f2ac6bc7ea4dd597e9c2748a6898d..b26eb034d07aeea725831650ab6295d53d00a079 100644 (file)
@@ -52,9 +52,11 @@ static int pci_mmc_probe(struct udevice *dev)
 
 static int pci_mmc_of_to_plat(struct udevice *dev)
 {
-       struct pci_mmc_priv *priv = dev_get_priv(dev);
+       if (CONFIG_IS_ENABLED(DM_GPIO)) {
+               struct pci_mmc_priv *priv = dev_get_priv(dev);
 
-       gpio_request_by_name(dev, "cd-gpios", 0, &priv->cd_gpio, GPIOD_IS_IN);
+               gpio_request_by_name(dev, "cd-gpios", 0, &priv->cd_gpio, GPIOD_IS_IN);
+       }
 
        return 0;
 }