diff options
author | Harm Berntsen <harm.berntsen@nedap.com> | 2020-11-06 15:20:44 +0300 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2021-01-18 23:14:15 +0300 |
commit | 7b4fe6dac112ffb63dc535c8d0ae198fcc949fed (patch) | |
tree | 27780ebe85eacab89b9ae682c84c98c19391cd8b /drivers | |
parent | e8fcb618522fd1b37ff7fac2cbe449f837258ee6 (diff) | |
download | u-boot-7b4fe6dac112ffb63dc535c8d0ae198fcc949fed.tar.xz |
mmc: Only retrieve cd pin when GPIO is enabled
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>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/mmc/pci_mmc.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/mmc/pci_mmc.c b/drivers/mmc/pci_mmc.c index c71c495d58..b26eb034d0 100644 --- a/drivers/mmc/pci_mmc.c +++ b/drivers/mmc/pci_mmc.c @@ -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; } |