OMAPDRM: Remove manager->device references
With the introduction of output entities, managers will now connect to outputs. Use the helper op for managers named get_device. This will abstract away the information on how to get the device from an overlay manager. Using the helper function will reduce the number of pointer dereferences a user of OMAPDSS needs to do and reduce risk of a NULL dereference. Signed-off-by: Archit Taneja <archit@ti.com>
This commit is contained in:
parent
4249e61e04
commit
23e2aa644f
|
@ -106,7 +106,8 @@ static void dump_video_chains(void)
|
||||||
for (i = 0; i < omap_dss_get_num_overlays(); i++) {
|
for (i = 0; i < omap_dss_get_num_overlays(); i++) {
|
||||||
struct omap_overlay *ovl = omap_dss_get_overlay(i);
|
struct omap_overlay *ovl = omap_dss_get_overlay(i);
|
||||||
struct omap_overlay_manager *mgr = ovl->manager;
|
struct omap_overlay_manager *mgr = ovl->manager;
|
||||||
struct omap_dss_device *dssdev = mgr ? mgr->device : NULL;
|
struct omap_dss_device *dssdev = mgr ?
|
||||||
|
mgr->get_device(mgr) : NULL;
|
||||||
if (dssdev) {
|
if (dssdev) {
|
||||||
DBG("%d: %s -> %s -> %s", i, ovl->name, mgr->name,
|
DBG("%d: %s -> %s -> %s", i, ovl->name, mgr->name,
|
||||||
dssdev->name);
|
dssdev->name);
|
||||||
|
@ -185,7 +186,7 @@ static int create_connector(struct drm_device *dev,
|
||||||
for (j = 0; j < priv->num_encoders; j++) {
|
for (j = 0; j < priv->num_encoders; j++) {
|
||||||
struct omap_overlay_manager *mgr =
|
struct omap_overlay_manager *mgr =
|
||||||
omap_encoder_get_manager(priv->encoders[j]);
|
omap_encoder_get_manager(priv->encoders[j]);
|
||||||
if (mgr->device == dssdev) {
|
if (mgr->get_device(mgr) == dssdev) {
|
||||||
drm_mode_connector_attach_encoder(connector,
|
drm_mode_connector_attach_encoder(connector,
|
||||||
priv->encoders[j]);
|
priv->encoders[j]);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue