From 6be663b5bdb7cc299b2aafca56be39f6618090ab Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Fri, 29 Sep 2017 14:34:42 +1000 Subject: [PATCH] amdgpu/dc: fix construct return values on irq service. This just removes more unused return/errors paths. Signed-off-by: Dave Airlie Reviewed-by: Harry Wentland Signed-off-by: Alex Deucher --- .../amd/display/dc/irq/dce110/irq_service_dce110.c | 14 ++++---------- .../amd/display/dc/irq/dce120/irq_service_dce120.c | 14 ++++---------- .../amd/display/dc/irq/dce80/irq_service_dce80.c | 14 ++++---------- .../amd/display/dc/irq/dcn10/irq_service_dcn10.c | 14 ++++---------- drivers/gpu/drm/amd/display/dc/irq/irq_service.c | 9 +++++---- drivers/gpu/drm/amd/display/dc/irq/irq_service.h | 2 +- 6 files changed, 22 insertions(+), 45 deletions(-) diff --git a/drivers/gpu/drm/amd/display/dc/irq/dce110/irq_service_dce110.c b/drivers/gpu/drm/amd/display/dc/irq/dce110/irq_service_dce110.c index 5c558969f39f..f7e40b292dfb 100644 --- a/drivers/gpu/drm/amd/display/dc/irq/dce110/irq_service_dce110.c +++ b/drivers/gpu/drm/amd/display/dc/irq/dce110/irq_service_dce110.c @@ -406,17 +406,14 @@ static const struct irq_service_funcs irq_service_funcs_dce110 = { .to_dal_irq_source = to_dal_irq_source_dce110 }; -static bool construct( +static void construct( struct irq_service *irq_service, struct irq_service_init_data *init_data) { - if (!dal_irq_service_construct(irq_service, init_data)) - return false; + dal_irq_service_construct(irq_service, init_data); irq_service->info = irq_source_info_dce110; irq_service->funcs = &irq_service_funcs_dce110; - - return true; } struct irq_service *dal_irq_service_dce110_create( @@ -428,9 +425,6 @@ struct irq_service *dal_irq_service_dce110_create( if (!irq_service) return NULL; - if (construct(irq_service, init_data)) - return irq_service; - - kfree(irq_service); - return NULL; + construct(irq_service, init_data); + return irq_service; } diff --git a/drivers/gpu/drm/amd/display/dc/irq/dce120/irq_service_dce120.c b/drivers/gpu/drm/amd/display/dc/irq/dce120/irq_service_dce120.c index 61d7c286802a..2ad56b1a4099 100644 --- a/drivers/gpu/drm/amd/display/dc/irq/dce120/irq_service_dce120.c +++ b/drivers/gpu/drm/amd/display/dc/irq/dce120/irq_service_dce120.c @@ -265,17 +265,14 @@ static const struct irq_service_funcs irq_service_funcs_dce120 = { .to_dal_irq_source = to_dal_irq_source_dce110 }; -static bool construct( +static void construct( struct irq_service *irq_service, struct irq_service_init_data *init_data) { - if (!dal_irq_service_construct(irq_service, init_data)) - return false; + dal_irq_service_construct(irq_service, init_data); irq_service->info = irq_source_info_dce120; irq_service->funcs = &irq_service_funcs_dce120; - - return true; } struct irq_service *dal_irq_service_dce120_create( @@ -287,9 +284,6 @@ struct irq_service *dal_irq_service_dce120_create( if (!irq_service) return NULL; - if (construct(irq_service, init_data)) - return irq_service; - - kfree(irq_service); - return NULL; + construct(irq_service, init_data); + return irq_service; } diff --git a/drivers/gpu/drm/amd/display/dc/irq/dce80/irq_service_dce80.c b/drivers/gpu/drm/amd/display/dc/irq/dce80/irq_service_dce80.c index d6e1fb665d90..8a2066c313fe 100644 --- a/drivers/gpu/drm/amd/display/dc/irq/dce80/irq_service_dce80.c +++ b/drivers/gpu/drm/amd/display/dc/irq/dce80/irq_service_dce80.c @@ -277,17 +277,14 @@ static const struct irq_service_funcs irq_service_funcs_dce80 = { .to_dal_irq_source = to_dal_irq_source_dce110 }; -static bool construct( +static void construct( struct irq_service *irq_service, struct irq_service_init_data *init_data) { - if (!dal_irq_service_construct(irq_service, init_data)) - return false; + dal_irq_service_construct(irq_service, init_data); irq_service->info = irq_source_info_dce80; irq_service->funcs = &irq_service_funcs_dce80; - - return true; } struct irq_service *dal_irq_service_dce80_create( @@ -299,11 +296,8 @@ struct irq_service *dal_irq_service_dce80_create( if (!irq_service) return NULL; - if (construct(irq_service, init_data)) - return irq_service; - - kfree(irq_service); - return NULL; + construct(irq_service, init_data); + return irq_service; } diff --git a/drivers/gpu/drm/amd/display/dc/irq/dcn10/irq_service_dcn10.c b/drivers/gpu/drm/amd/display/dc/irq/dcn10/irq_service_dcn10.c index f6e861162a6e..74ad24714f6b 100644 --- a/drivers/gpu/drm/amd/display/dc/irq/dcn10/irq_service_dcn10.c +++ b/drivers/gpu/drm/amd/display/dc/irq/dcn10/irq_service_dcn10.c @@ -332,17 +332,14 @@ static const struct irq_service_funcs irq_service_funcs_dcn10 = { .to_dal_irq_source = to_dal_irq_source_dcn10 }; -static bool construct( +static void construct( struct irq_service *irq_service, struct irq_service_init_data *init_data) { - if (!dal_irq_service_construct(irq_service, init_data)) - return false; + dal_irq_service_construct(irq_service, init_data); irq_service->info = irq_source_info_dcn10; irq_service->funcs = &irq_service_funcs_dcn10; - - return true; } struct irq_service *dal_irq_service_dcn10_create( @@ -354,9 +351,6 @@ struct irq_service *dal_irq_service_dcn10_create( if (!irq_service) return NULL; - if (construct(irq_service, init_data)) - return irq_service; - - kfree(irq_service); - return NULL; + construct(irq_service, init_data); + return irq_service; } diff --git a/drivers/gpu/drm/amd/display/dc/irq/irq_service.c b/drivers/gpu/drm/amd/display/dc/irq/irq_service.c index ce20622c7c89..b106513fc2dc 100644 --- a/drivers/gpu/drm/amd/display/dc/irq/irq_service.c +++ b/drivers/gpu/drm/amd/display/dc/irq/irq_service.c @@ -48,15 +48,16 @@ #define CTX \ irq_service->ctx -bool dal_irq_service_construct( +void dal_irq_service_construct( struct irq_service *irq_service, struct irq_service_init_data *init_data) { - if (!init_data || !init_data->ctx) - return false; + if (!init_data || !init_data->ctx) { + BREAK_TO_DEBUGGER(); + return; + } irq_service->ctx = init_data->ctx; - return true; } void dal_irq_service_destroy(struct irq_service **irq_service) diff --git a/drivers/gpu/drm/amd/display/dc/irq/irq_service.h b/drivers/gpu/drm/amd/display/dc/irq/irq_service.h index a2a2d6965c2f..dbfcb096eedd 100644 --- a/drivers/gpu/drm/amd/display/dc/irq/irq_service.h +++ b/drivers/gpu/drm/amd/display/dc/irq/irq_service.h @@ -69,7 +69,7 @@ struct irq_service { const struct irq_service_funcs *funcs; }; -bool dal_irq_service_construct( +void dal_irq_service_construct( struct irq_service *irq_service, struct irq_service_init_data *init_data);