[PATCH] drm/amdgpu/display: fix wrong enum type for ddc_result
Harry Wentland
harry.wentland at amd.com
Fri Feb 2 15:48:33 UTC 2018
On 2018-02-01 08:55 PM, dbehr at chromium.org wrote:
> From: Dominik Behr <dbehr at chromium.org>
>
> v2: now with fixed result comparison and spelling fixes
>
> Signed-off-by: Dominik Behr <dbehr at chromium.org>
> ---
> drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c | 2 +-
> drivers/gpu/drm/amd/display/dc/core/dc_link.c | 2 +-
> drivers/gpu/drm/amd/display/dc/core/dc_link_ddc.c | 4 ++--
> drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c | 4 ++--
> drivers/gpu/drm/amd/display/include/ddc_service_types.h | 2 +-
> 5 files changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c
> index 1e8a21b67df7..3b05900ccccd 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c
> @@ -130,7 +130,7 @@ static ssize_t dm_dp_aux_transfer(struct drm_dp_aux *aux,
> msg->address,
> msg->buffer,
> msg->size,
> - r == DDC_RESULT_SUCESSFULL);
> + r == DDC_RESULT_SUCCESSFUL);
> #endif
>
> return msg->size;
> diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link.c b/drivers/gpu/drm/amd/display/dc/core/dc_link.c
> index 0023754e034b..3abd0f1a287f 100644
> --- a/drivers/gpu/drm/amd/display/dc/core/dc_link.c
> +++ b/drivers/gpu/drm/amd/display/dc/core/dc_link.c
> @@ -1176,7 +1176,7 @@ static void dpcd_configure_panel_mode(
> &edp_config_set.raw,
> sizeof(edp_config_set.raw));
>
> - ASSERT(result == DDC_RESULT_SUCESSFULL);
> + ASSERT(result == DDC_RESULT_SUCCESSFUL);
> }
> }
> dm_logger_write(link->ctx->logger, LOG_DETECTION_DP_CAPS,
> diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link_ddc.c b/drivers/gpu/drm/amd/display/dc/core/dc_link_ddc.c
> index d5294798b0a5..6b69b339dba2 100644
> --- a/drivers/gpu/drm/amd/display/dc/core/dc_link_ddc.c
> +++ b/drivers/gpu/drm/amd/display/dc/core/dc_link_ddc.c
> @@ -661,7 +661,7 @@ enum ddc_result dal_ddc_service_read_dpcd_data(
> ddc->ctx->i2caux,
> ddc->ddc_pin,
> &command))
> - return DDC_RESULT_SUCESSFULL;
> + return DDC_RESULT_SUCCESSFUL;
>
> return DDC_RESULT_FAILED_OPERATION;
> }
> @@ -698,7 +698,7 @@ enum ddc_result dal_ddc_service_write_dpcd_data(
> ddc->ctx->i2caux,
> ddc->ddc_pin,
> &command))
> - return DDC_RESULT_SUCESSFULL;
> + return DDC_RESULT_SUCCESSFUL;
>
> return DDC_RESULT_FAILED_OPERATION;
> }
> diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c b/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c
> index 33d91e4474ea..cc067d04505d 100644
> --- a/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c
> +++ b/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c
> @@ -1926,7 +1926,7 @@ bool dc_link_handle_hpd_rx_irq(struct dc_link *link, union hpd_irq_data *out_hpd
> {
> union hpd_irq_data hpd_irq_dpcd_data = {{{{0}}}};
> union device_service_irq device_service_clear = { { 0 } };
> - enum dc_status result = DDC_RESULT_UNKNOWN;
> + enum ddc_result result = DDC_RESULT_UNKNOWN;
Result gets the return value from read_hpd_rx_irq_data which is dc_status. This line should be
enum dc_status result = DC_OK;
> bool status = false;
> /* For use cases related to down stream connection status change,
> * PSR and device auto test, refer to function handle_sst_hpd_irq
> @@ -1946,7 +1946,7 @@ bool dc_link_handle_hpd_rx_irq(struct dc_link *link, union hpd_irq_data *out_hpd
> if (out_hpd_irq_dpcd_data)
> *out_hpd_irq_dpcd_data = hpd_irq_dpcd_data;
>
> - if (result != DC_OK) {
> + if (result != DDC_RESULT_SUCCESSFUL) {
We should keep the result != DC_OK check here as read_hpd_rx_irq_data returns dc_status.
Harry
> dm_logger_write(link->ctx->logger, LOG_HW_HPD_IRQ,
> "%s: DPCD read failed to obtain irq data\n",
> __func__);
> diff --git a/drivers/gpu/drm/amd/display/include/ddc_service_types.h b/drivers/gpu/drm/amd/display/include/ddc_service_types.h
> index 019e7a095ea1..f3bf749b3636 100644
> --- a/drivers/gpu/drm/amd/display/include/ddc_service_types.h
> +++ b/drivers/gpu/drm/amd/display/include/ddc_service_types.h
> @@ -32,7 +32,7 @@
>
> enum ddc_result {
> DDC_RESULT_UNKNOWN = 0,
> - DDC_RESULT_SUCESSFULL,
> + DDC_RESULT_SUCCESSFUL,
> DDC_RESULT_FAILED_CHANNEL_BUSY,
> DDC_RESULT_FAILED_TIMEOUT,
> DDC_RESULT_FAILED_PROTOCOL_ERROR,
>
More information about the amd-gfx
mailing list