diff options
author | Douglas Anderson <[email protected]> | 2019-06-10 10:52:34 -0700 |
---|---|---|
committer | Sean Paul <[email protected]> | 2019-06-10 15:14:57 -0400 |
commit | 0bd79f915c68ca3372696fee2dfe3c4bde9997a3 (patch) | |
tree | ec6355faf2790b4bf54bc2fcfe3766f86dca70f8 | |
parent | 427231bc6d585befe09ea793776f0ba4d032c3f8 (diff) |
drm/bridge/synopsys: dw-hdmi: Fix unwedge crash when no pinctrl entries
In commit 50f9495efe30 ("drm/bridge/synopsys: dw-hdmi: Add "unwedge"
for ddc bus") I stupidly used IS_ERR() to check for whether we have an
"unwedge" pinctrl state even though on most flows through the driver
the unwedge state will just be NULL.
Fix it so that we consistently use NULL for no unwedge state.
Fixes: 50f9495efe30 ("drm/bridge/synopsys: dw-hdmi: Add "unwedge" for ddc bus")
Cc: Douglas Anderson <[email protected]>
Cc: Sean Paul <[email protected]>
Cc: Andrzej Hajda <[email protected]>
Cc: Laurent Pinchart <[email protected]>
Cc: Daniel Vetter <[email protected]>
Cc: Neil Armstrong <[email protected]>
Cc: Jonas Karlman <[email protected]>
Cc: Jernej Skrabec <[email protected]>
Cc: Sam Ravnborg <[email protected]>
Reported-by: Erico Nunes <[email protected]>
Signed-off-by: Douglas Anderson <[email protected]>
Signed-off-by: Sean Paul <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
-rw-r--r-- | drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c index 7c8d5d316f04..3a6320108575 100644 --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c @@ -256,7 +256,7 @@ static void dw_hdmi_i2c_init(struct dw_hdmi *hdmi) static bool dw_hdmi_i2c_unwedge(struct dw_hdmi *hdmi) { /* If no unwedge state then give up */ - if (IS_ERR(hdmi->unwedge_state)) + if (!hdmi->unwedge_state) return false; dev_info(hdmi->dev, "Attempting to unwedge stuck i2c bus\n"); @@ -2691,11 +2691,13 @@ __dw_hdmi_probe(struct platform_device *pdev, hdmi->default_state = pinctrl_lookup_state(hdmi->pinctrl, "default"); - if (IS_ERR(hdmi->default_state) && - !IS_ERR(hdmi->unwedge_state)) { - dev_warn(dev, - "Unwedge requires default pinctrl\n"); - hdmi->unwedge_state = ERR_PTR(-ENODEV); + if (IS_ERR(hdmi->default_state) || + IS_ERR(hdmi->unwedge_state)) { + if (!IS_ERR(hdmi->unwedge_state)) + dev_warn(dev, + "Unwedge requires default pinctrl\n"); + hdmi->default_state = NULL; + hdmi->unwedge_state = NULL; } } |