amdgpu/dc: fix construct return values on irq service.
authorDave Airlie <airlied@redhat.com>
Fri, 29 Sep 2017 04:34:42 +0000 (14:34 +1000)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 29 Sep 2017 17:02:54 +0000 (13:02 -0400)
This just removes more unused return/errors paths.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/irq/dce110/irq_service_dce110.c
drivers/gpu/drm/amd/display/dc/irq/dce120/irq_service_dce120.c
drivers/gpu/drm/amd/display/dc/irq/dce80/irq_service_dce80.c
drivers/gpu/drm/amd/display/dc/irq/dcn10/irq_service_dcn10.c
drivers/gpu/drm/amd/display/dc/irq/irq_service.c
drivers/gpu/drm/amd/display/dc/irq/irq_service.h

index 5c558969f39fac8d712a6967a86a4604d5b8fa45..f7e40b292dfbbbdc5b81dfd8a444a63f42542a5b 100644 (file)
@@ -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;
 }
index 61d7c286802a10884be7063fa3441e816d6127cb..2ad56b1a40998d2655f235fceb6b53e5dd51c379 100644 (file)
@@ -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;
 }
index d6e1fb665d9063df123d437dda55cc8b2e9c59b6..8a2066c313fe01899f74e161b8457b9d370c812e 100644 (file)
@@ -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;
 }
 
 
index f6e861162a6e4dbec8b2a20baf707a48d56462db..74ad24714f6bdfaab8d653d4b01fbb8bd98965e4 100644 (file)
@@ -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;
 }
index ce20622c7c893a0b5548541ba7fc40fe80a1b884..b106513fc2dc85ecd1744db98c4fa8536b9b720b 100644 (file)
 #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)
index a2a2d6965c2ff5b589fed5152f42cd528663fa84..dbfcb096eedd684593cddb66a151d812b68ab50a 100644 (file)
@@ -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);