From: Harm Berntsen <harm.berntsen@nedap.com>
To: u-boot@lists.denx.de
Subject: [PATCH v2 3/3] mmc: Only retrieve cd pin when GPIO is enabled
Date: Fri, 6 Nov 2020 12:20:44 +0000 [thread overview]
Message-ID: <d05a34a1c5deb1d08b45b6caf44de9163d013699.camel@nedap.com> (raw)
In-Reply-To: <CAPnjgZ0ESzH+jeJO+B2U2Sf=2Txs5zFm4NoCNtG4dO0XzRFVog@mail.gmail.com>
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>
---
Changes for v2:
- Changed ifdef to if (CONFIG_IS_ENABLED(DM_GPIO))
drivers/mmc/pci_mmc.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/mmc/pci_mmc.c b/drivers/mmc/pci_mmc.c
index 0c45e1b893..bd229693b0 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_ofdata_to_platdata(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;
}
--
2.29.2
next prev parent reply other threads:[~2020-11-06 12:20 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-30 8:45 [PATCH 3/3] mmc: Only retrieve cd pin when GPIO is enabled Harm Berntsen
2020-11-03 15:12 ` Simon Glass
2020-11-06 12:20 ` Harm Berntsen [this message]
2020-11-06 18:50 ` [PATCH v2 " Simon Glass
2021-01-19 13:03 ` Tom Rini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=d05a34a1c5deb1d08b45b6caf44de9163d013699.camel@nedap.com \
--to=harm.berntsen@nedap.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.