* [U-Boot] [PATCH] mmc: omap_hsmmc: Make DM_GPIO calls dependent on DM_GPIO
@ 2018-08-21 12:16 Adam Ford
2018-09-18 21:25 ` [U-Boot] " Tom Rini
0 siblings, 1 reply; 2+ messages in thread
From: Adam Ford @ 2018-08-21 12:16 UTC (permalink / raw)
To: u-boot
The getcd and getwp functions when DM_MMC is enabled are
assumming the DM_GPIO is enabled. In cases (like SPL) where
DM_GPIO may not be enabled, wrap these calls in an #ifdef
Signed-off-by: Adam Ford <aford173@gmail.com>
diff --git a/drivers/mmc/omap_hsmmc.c b/drivers/mmc/omap_hsmmc.c
index caaa914604..4d171f457e 100644
--- a/drivers/mmc/omap_hsmmc.c
+++ b/drivers/mmc/omap_hsmmc.c
@@ -1365,9 +1365,10 @@ static int omap_hsmmc_set_ios(struct udevice *dev)
static int omap_hsmmc_getcd(struct udevice *dev)
{
struct omap_hsmmc_data *priv = dev_get_priv(dev);
- int value;
-
+ int value = -1;
+#if CONFIG_IS_ENABLED(DM_GPIO)
value = dm_gpio_get_value(&priv->cd_gpio);
+#endif
/* if no CD return as 1 */
if (value < 0)
return 1;
@@ -1379,10 +1380,11 @@ static int omap_hsmmc_getcd(struct udevice *dev)
static int omap_hsmmc_getwp(struct udevice *dev)
{
+ int value = 0;
+#if CONFIG_IS_ENABLED(DM_GPIO)
struct omap_hsmmc_data *priv = dev_get_priv(dev);
- int value;
-
value = dm_gpio_get_value(&priv->wp_gpio);
+#endif
/* if no WP return as 0 */
if (value < 0)
return 0;
@@ -1901,9 +1903,11 @@ static int omap_hsmmc_probe(struct udevice *dev)
device_get_supply_regulator(dev, "pbias-supply",
&priv->pbias_supply);
#endif
-#if defined(OMAP_HSMMC_USE_GPIO) && CONFIG_IS_ENABLED(OF_CONTROL)
+#if defined(OMAP_HSMMC_USE_GPIO)
+#if CONFIG_IS_ENABLED(OF_CONTROL) && CONFIG_IS_ENABLED(DM_GPIO)
gpio_request_by_name(dev, "cd-gpios", 0, &priv->cd_gpio, GPIOD_IS_IN);
gpio_request_by_name(dev, "wp-gpios", 0, &priv->wp_gpio, GPIOD_IS_IN);
+#endif
#endif
mmc->dev = dev;
--
2.17.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [U-Boot] mmc: omap_hsmmc: Make DM_GPIO calls dependent on DM_GPIO
2018-08-21 12:16 [U-Boot] [PATCH] mmc: omap_hsmmc: Make DM_GPIO calls dependent on DM_GPIO Adam Ford
@ 2018-09-18 21:25 ` Tom Rini
0 siblings, 0 replies; 2+ messages in thread
From: Tom Rini @ 2018-09-18 21:25 UTC (permalink / raw)
To: u-boot
On Tue, Aug 21, 2018 at 07:16:56AM -0500, Adam Ford wrote:
> The getcd and getwp functions when DM_MMC is enabled are
> assumming the DM_GPIO is enabled. In cases (like SPL) where
> DM_GPIO may not be enabled, wrap these calls in an #ifdef
>
> Signed-off-by: Adam Ford <aford173@gmail.com>
>
> diff --git a/drivers/mmc/omap_hsmmc.c b/drivers/mmc/omap_hsmmc.c
> index caaa914604..4d171f457e 100644
Applied to u-boot/master, thanks!
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180918/48afc321/attachment.sig>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-09-18 21:25 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-08-21 12:16 [U-Boot] [PATCH] mmc: omap_hsmmc: Make DM_GPIO calls dependent on DM_GPIO Adam Ford
2018-09-18 21:25 ` [U-Boot] " Tom Rini
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).