drm_panel_enable(tcon->panel);
}
- if (!IS_ERR(encoder->bridge))
- drm_bridge_enable(encoder->bridge);
+ /* encoder->bridge can be NULL; drm_bridge_enable checks for it */
+ drm_bridge_enable(encoder->bridge);
sun4i_tcon_channel_enable(tcon, 0);
}
sun4i_tcon_channel_disable(tcon, 0);
- if (!IS_ERR(encoder->bridge))
- drm_bridge_disable(encoder->bridge);
+ /* encoder->bridge can be NULL; drm_bridge_disable checks for it */
+ drm_bridge_disable(encoder->bridge);
if (!IS_ERR(tcon->panel)) {
drm_panel_disable(tcon->panel);
dev_err(drm->dev, "Couldn't attach our bridge\n");
goto err_cleanup_connector;
}
+ } else {
+ encoder->bridge = NULL;
}
return 0;