From: Harm Berntsen Date: Fri, 6 Nov 2020 12:20:44 +0000 (+0000) Subject: mmc: Only retrieve cd pin when GPIO is enabled X-Git-Tag: v2021.10~363^2~21 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7b4fe6dac112ffb63dc535c8d0ae198fcc949fed;p=platform%2Fkernel%2Fu-boot.git 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 CC: Simon Glass Reviewed-by: Simon Glass --- diff --git a/drivers/mmc/pci_mmc.c b/drivers/mmc/pci_mmc.c index c71c495..b26eb03 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; }