]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
drm/dp_mst: Use drm_dp_dpcd_write_data() to write GUID for non-root MST branch devices
authorImre Deak <imre.deak@intel.com>
Tue, 1 Apr 2025 10:38:46 +0000 (13:38 +0300)
committerImre Deak <imre.deak@intel.com>
Thu, 3 Apr 2025 14:14:19 +0000 (17:14 +0300)
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.baryshkov@linaro.org>
Cc: Lyude Paul <lyude@redhat.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
Signed-off-by: Imre Deak <imre.deak@intel.com>
Link: https://lore.kernel.org/r/20250401103846.686408-2-imre.deak@intel.com
drivers/gpu/drm/display/drm_dp_mst_topology.c

index 8c312c1f172438d7c9110de655a52ac3a63ffc24..49c330567a92c97c31f2eb20b3f76401448ee3ba 100644 (file)
@@ -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;