drm_dp_dpcd_write_data() can be used to write the GUID for a non-root
MST branch device, similarly to writing the GUID to a root MST branch
device, do so.

Cc: Dmitry Baryshkov <dmitry.barysh...@linaro.org>
Cc: Lyude Paul <ly...@redhat.com>
Signed-off-by: Imre Deak <imre.d...@intel.com>
---
 drivers/gpu/drm/display/drm_dp_mst_topology.c | 17 +++++++----------
 1 file changed, 7 insertions(+), 10 deletions(-)

diff --git a/drivers/gpu/drm/display/drm_dp_mst_topology.c 
b/drivers/gpu/drm/display/drm_dp_mst_topology.c
index 619f461e02f76..a89f38fd3218b 100644
--- a/drivers/gpu/drm/display/drm_dp_mst_topology.c
+++ b/drivers/gpu/drm/display/drm_dp_mst_topology.c
@@ -2192,20 +2192,17 @@ static int drm_dp_check_mstb_guid(struct 
drm_dp_mst_branch *mstb, guid_t *guid)
        guid_copy(&mstb->guid, guid);
 
        if (!drm_dp_validate_guid(mstb->mgr, &mstb->guid)) {
+               struct drm_dp_aux *aux;
                u8 buf[UUID_SIZE];
 
                export_guid(buf, &mstb->guid);
 
-               if (mstb->port_parent) {
-                       ret = drm_dp_send_dpcd_write(mstb->mgr,
-                                                    mstb->port_parent,
-                                                    DP_GUID, sizeof(buf), buf);
-                       if (ret >= 0)
-                               ret = ret == sizeof(buf) ? 0 : -EPROTO;
-               } else {
-                       ret = drm_dp_dpcd_write_data(mstb->mgr->aux,
-                                                    DP_GUID, buf, sizeof(buf));
-               }
+               if (mstb->port_parent)
+                       aux = &mstb->port_parent->aux;
+               else
+                       aux = mstb->mgr->aux;
+
+               ret = drm_dp_dpcd_write_data(aux, DP_GUID, buf, sizeof(buf));
        }
 
        return ret;
-- 
2.44.2

Reply via email to