Skip to content

Commit

Permalink
drm/radeon/audio: break out of loops once we match connector
Browse files Browse the repository at this point in the history
No need to continue with the loops once we've matched
the appropriate connector.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
  • Loading branch information
Alex Deucher committed Nov 1, 2013
1 parent 4039096 commit 8a992ee
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
8 changes: 6 additions & 2 deletions drivers/gpu/drm/radeon/evergreen_hdmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,10 @@ static void dce4_afmt_write_speaker_allocation(struct drm_encoder *encoder)
int sad_count;

list_for_each_entry(connector, &encoder->dev->mode_config.connector_list, head) {
if (connector->encoder == encoder)
if (connector->encoder == encoder) {
radeon_connector = to_radeon_connector(connector);
break;
}
}

if (!radeon_connector) {
Expand Down Expand Up @@ -121,8 +123,10 @@ static void evergreen_hdmi_write_sad_regs(struct drm_encoder *encoder)
};

list_for_each_entry(connector, &encoder->dev->mode_config.connector_list, head) {
if (connector->encoder == encoder)
if (connector->encoder == encoder) {
radeon_connector = to_radeon_connector(connector);
break;
}
}

if (!radeon_connector) {
Expand Down
8 changes: 6 additions & 2 deletions drivers/gpu/drm/radeon/r600_hdmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -303,8 +303,10 @@ static void dce3_2_afmt_write_speaker_allocation(struct drm_encoder *encoder)
int sad_count;

list_for_each_entry(connector, &encoder->dev->mode_config.connector_list, head) {
if (connector->encoder == encoder)
if (connector->encoder == encoder) {
radeon_connector = to_radeon_connector(connector);
break;
}
}

if (!radeon_connector) {
Expand Down Expand Up @@ -356,8 +358,10 @@ static void dce3_2_afmt_write_sad_regs(struct drm_encoder *encoder)
};

list_for_each_entry(connector, &encoder->dev->mode_config.connector_list, head) {
if (connector->encoder == encoder)
if (connector->encoder == encoder) {
radeon_connector = to_radeon_connector(connector);
break;
}
}

if (!radeon_connector) {
Expand Down

0 comments on commit 8a992ee

Please sign in to comment.