Skip to content
Snippets Groups Projects
Commit 1aa25632 authored by Lyude Paul's avatar Lyude Paul
Browse files

drm/dp_mst: Cleanup drm_dp_send_link_address() a bit


Declare local pointer to the drm_dp_link_address_ack_reply struct
instead of constantly dereferencing it through the union in
txmsg->reply. Also rearrange variable declarations a bit.

Signed-off-by: Lyude Paul's avatarLyude Paul <lyude@redhat.com>
parent 23a8b221
No related branches found
No related tags found
No related merge requests found
......@@ -2033,9 +2033,9 @@ drm_dp_dump_link_address(struct drm_dp_link_address_ack_reply *reply)
static void drm_dp_send_link_address(struct drm_dp_mst_topology_mgr *mgr,
struct drm_dp_mst_branch *mstb)
{
int len;
struct drm_dp_sideband_msg_tx *txmsg;
int ret;
struct drm_dp_link_address_ack_reply *reply;
int len, ret;
txmsg = kzalloc(sizeof(*txmsg), GFP_KERNEL);
if (!txmsg)
......@@ -2054,13 +2054,16 @@ static void drm_dp_send_link_address(struct drm_dp_mst_topology_mgr *mgr,
if (txmsg->reply.reply_type == DP_SIDEBAND_REPLY_NAK) {
DRM_DEBUG_KMS("link address nak received\n");
} else {
DRM_DEBUG_KMS("link address reply: %d\n", txmsg->reply.u.link_addr.nports);
drm_dp_dump_link_address(&txmsg->reply.u.link_addr);
reply = &txmsg->reply.u.link_addr;
DRM_DEBUG_KMS("link address reply: %d\n",
reply->nports);
drm_dp_dump_link_address(reply);
drm_dp_check_mstb_guid(mstb, txmsg->reply.u.link_addr.guid);
drm_dp_check_mstb_guid(mstb, reply->guid);
for (i = 0; i < txmsg->reply.u.link_addr.nports; i++) {
drm_dp_add_port(mstb, mgr->dev, &txmsg->reply.u.link_addr.ports[i]);
for (i = 0; i < reply->nports; i++) {
drm_dp_add_port(mstb, mgr->dev,
&reply->ports[i]);
}
drm_kms_helper_hotplug_event(mgr->dev);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment