linux-mmc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mmc: renesas_sdhi: add checks for pinctrl_lookup_state
@ 2019-10-18 13:13 Chuhong Yuan
  2019-10-21 14:32 ` Ulf Hansson
  0 siblings, 1 reply; 8+ messages in thread
From: Chuhong Yuan @ 2019-10-18 13:13 UTC (permalink / raw)
  Cc: Wolfram Sang, Ulf Hansson, linux-mmc, linux-kernel, Chuhong Yuan

renesas_sdhi_probe misses checks for pinctrl_lookup_state and may miss
failures.
Add checks for them to fix the problem.

Signed-off-by: Chuhong Yuan <hslester96@gmail.com>
---
 drivers/mmc/host/renesas_sdhi_core.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/mmc/host/renesas_sdhi_core.c b/drivers/mmc/host/renesas_sdhi_core.c
index d4ada5cca2d1..dc5ad6632df3 100644
--- a/drivers/mmc/host/renesas_sdhi_core.c
+++ b/drivers/mmc/host/renesas_sdhi_core.c
@@ -694,8 +694,13 @@ int renesas_sdhi_probe(struct platform_device *pdev,
 	if (!IS_ERR(priv->pinctrl)) {
 		priv->pins_default = pinctrl_lookup_state(priv->pinctrl,
 						PINCTRL_STATE_DEFAULT);
+		if (IS_ERR(priv->pins_default))
+			return PTR_ERR(priv->pins_default);
+
 		priv->pins_uhs = pinctrl_lookup_state(priv->pinctrl,
 						"state_uhs");
+		if (IS_ERR(priv->pins_uhs))
+			return PTR_ERR(priv->pins_uhs);
 	}
 
 	host = tmio_mmc_host_alloc(pdev, mmc_data);
-- 
2.20.1

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2019-11-24  3:20 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-18 13:13 [PATCH] mmc: renesas_sdhi: add checks for pinctrl_lookup_state Chuhong Yuan
2019-10-21 14:32 ` Ulf Hansson
2019-10-21 20:10   ` Wolfram Sang
2019-10-23 15:33   ` Wolfram Sang
2019-10-30 15:09     ` Ulf Hansson
2019-10-31 22:12       ` Wolfram Sang
2019-11-07  8:30         ` Geert Uytterhoeven
2019-11-24  3:20           ` Chuhong Yuan

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).