amdgpu/dc: remove pointless returns in the i2caux constructor paths. (v2)
authorDave Airlie <airlied@redhat.com>
Fri, 29 Sep 2017 05:44:54 +0000 (15:44 +1000)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 29 Sep 2017 17:02:21 +0000 (13:02 -0400)
There was lots of return true, and error checking that was never used
in these paths.

Just remove it all.

v2: I missed one return true.

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>
28 files changed:
drivers/gpu/drm/amd/display/dc/i2caux/aux_engine.c
drivers/gpu/drm/amd/display/dc/i2caux/aux_engine.h
drivers/gpu/drm/amd/display/dc/i2caux/dce100/i2caux_dce100.c
drivers/gpu/drm/amd/display/dc/i2caux/dce110/aux_engine_dce110.c
drivers/gpu/drm/amd/display/dc/i2caux/dce110/i2c_hw_engine_dce110.c
drivers/gpu/drm/amd/display/dc/i2caux/dce110/i2c_hw_engine_dce110.h
drivers/gpu/drm/amd/display/dc/i2caux/dce110/i2c_sw_engine_dce110.c
drivers/gpu/drm/amd/display/dc/i2caux/dce110/i2caux_dce110.c
drivers/gpu/drm/amd/display/dc/i2caux/dce110/i2caux_dce110.h
drivers/gpu/drm/amd/display/dc/i2caux/dce112/i2caux_dce112.c
drivers/gpu/drm/amd/display/dc/i2caux/dce120/i2caux_dce120.c
drivers/gpu/drm/amd/display/dc/i2caux/dce80/i2c_hw_engine_dce80.c
drivers/gpu/drm/amd/display/dc/i2caux/dce80/i2c_sw_engine_dce80.c
drivers/gpu/drm/amd/display/dc/i2caux/dce80/i2caux_dce80.c
drivers/gpu/drm/amd/display/dc/i2caux/dcn10/i2caux_dcn10.c
drivers/gpu/drm/amd/display/dc/i2caux/diagnostics/i2caux_diag.c
drivers/gpu/drm/amd/display/dc/i2caux/engine.h
drivers/gpu/drm/amd/display/dc/i2caux/engine_base.c
drivers/gpu/drm/amd/display/dc/i2caux/i2c_engine.c
drivers/gpu/drm/amd/display/dc/i2caux/i2c_engine.h
drivers/gpu/drm/amd/display/dc/i2caux/i2c_generic_hw_engine.c
drivers/gpu/drm/amd/display/dc/i2caux/i2c_generic_hw_engine.h
drivers/gpu/drm/amd/display/dc/i2caux/i2c_hw_engine.c
drivers/gpu/drm/amd/display/dc/i2caux/i2c_hw_engine.h
drivers/gpu/drm/amd/display/dc/i2caux/i2c_sw_engine.c
drivers/gpu/drm/amd/display/dc/i2caux/i2c_sw_engine.h
drivers/gpu/drm/amd/display/dc/i2caux/i2caux.c
drivers/gpu/drm/amd/display/dc/i2caux/i2caux.h

index 3c9608ce94b88bff42ca7a89df491fd93159a01c..fc7a7d4ebca5fd4fee0c462fd7dc6619737b32ff 100644 (file)
@@ -555,15 +555,13 @@ bool dal_aux_engine_submit_request(
        return result;
 }
 
-bool dal_aux_engine_construct(
+void dal_aux_engine_construct(
        struct aux_engine *engine,
        struct dc_context *ctx)
 {
-       if (!dal_i2caux_construct_engine(&engine->base, ctx))
-               return false;
+       dal_i2caux_construct_engine(&engine->base, ctx);
        engine->delay = 0;
        engine->max_defer_write_retry = 0;
-       return true;
 }
 
 void dal_aux_engine_destruct(
index 40b202893772bebedf4df22a96b104f49ebb3fc0..8e71324ccb1094435e51d14134c7d42d5a97f163 100644 (file)
@@ -100,7 +100,7 @@ struct aux_engine {
        bool acquire_reset;
 };
 
-bool dal_aux_engine_construct(
+void dal_aux_engine_construct(
        struct aux_engine *engine,
        struct dc_context *ctx);
 
index c45a2ee8c336e91d0f7b45daf54565ebee4a0bc6..e8d3781deaed028dbee299c3800b5cf7cb7162f3 100644 (file)
@@ -95,18 +95,11 @@ struct i2caux *dal_i2caux_dce100_create(
                return NULL;
        }
 
-       if (dal_i2caux_dce110_construct(
-                       i2caux_dce110,
-                       ctx,
-                       dce100_aux_regs,
-                       dce100_hw_engine_regs,
-                       &i2c_shift,
-                       &i2c_mask))
-               return &i2caux_dce110->base;
-
-       ASSERT_CRITICAL(false);
-
-       kfree(i2caux_dce110);
-
-       return NULL;
+       dal_i2caux_dce110_construct(i2caux_dce110,
+                                   ctx,
+                                   dce100_aux_regs,
+                                   dce100_hw_engine_regs,
+                                   &i2c_shift,
+                                   &i2c_mask);
+       return &i2caux_dce110->base;
 }
index 4b673b48bf42b215a8183aaa1ee9fe3ca5b14869..0c4bbc10510d0ab2facb3e84fb47982229581e75 100644 (file)
@@ -426,22 +426,16 @@ static const struct engine_funcs engine_funcs = {
        .acquire = dal_aux_engine_acquire,
 };
 
-static bool construct(
+static void construct(
        struct aux_engine_dce110 *engine,
        const struct aux_engine_dce110_init_data *aux_init_data)
 {
-       if (!dal_aux_engine_construct(
-               &engine->base, aux_init_data->ctx)) {
-               ASSERT_CRITICAL(false);
-               return false;
-       }
+       dal_aux_engine_construct(&engine->base, aux_init_data->ctx);
        engine->base.base.funcs = &engine_funcs;
        engine->base.funcs = &aux_engine_funcs;
 
        engine->timeout_period = aux_init_data->timeout_period;
        engine->regs = aux_init_data->regs;
-
-       return true;
 }
 
 static void destruct(
@@ -471,12 +465,6 @@ struct aux_engine *dal_aux_engine_dce110_create(
                return NULL;
        }
 
-       if (construct(engine, aux_init_data))
-               return &engine->base;
-
-       ASSERT_CRITICAL(false);
-
-       kfree(engine);
-
-       return NULL;
+       construct(engine, aux_init_data);
+       return &engine->base;
 }
index aab77a81008a4ae214238ab5670fc18f3a4c4133..1a5b3f70ddc948d4cb396c385cdce4156ea57723 100644 (file)
@@ -498,17 +498,13 @@ static const struct i2c_hw_engine_funcs i2c_hw_engine_funcs = {
        .wait_on_operation_result = dal_i2c_hw_engine_wait_on_operation_result,
 };
 
-bool i2c_hw_engine_dce110_construct(
+static void construct(
        struct i2c_hw_engine_dce110 *hw_engine,
        const struct i2c_hw_engine_dce110_create_arg *arg)
 {
        uint32_t xtal_ref_div = 0;
 
-       if (!arg->reference_frequency)
-               return false;
-
-       if (!dal_i2c_hw_engine_construct(&hw_engine->base, arg->ctx))
-               return false;
+       dal_i2c_hw_engine_construct(&hw_engine->base, arg->ctx);
 
        hw_engine->base.base.base.funcs = &engine_funcs;
        hw_engine->base.base.funcs = &i2c_engine_funcs;
@@ -545,8 +541,6 @@ bool i2c_hw_engine_dce110_construct(
         */
        hw_engine->reference_frequency =
                (arg->reference_frequency * 2) / xtal_ref_div;
-
-       return true;
 }
 
 struct i2c_engine *dal_i2c_hw_engine_dce110_create(
@@ -558,6 +552,10 @@ struct i2c_engine *dal_i2c_hw_engine_dce110_create(
                ASSERT_CRITICAL(false);
                return NULL;
        }
+       if (!arg->reference_frequency) {
+               ASSERT_CRITICAL(false);
+               return NULL;
+       }
 
        engine_dce10 = kzalloc(sizeof(struct i2c_hw_engine_dce110),
                               GFP_KERNEL);
@@ -567,12 +565,6 @@ struct i2c_engine *dal_i2c_hw_engine_dce110_create(
                return NULL;
        }
 
-       if (i2c_hw_engine_dce110_construct(engine_dce10, arg))
-               return &engine_dce10->base.base;
-
-       ASSERT_CRITICAL(false);
-
-       kfree(engine_dce10);
-
-       return NULL;
+       construct(engine_dce10, arg);
+       return &engine_dce10->base.base;
 }
index c573c6459ec65a60372759be76dfebade7e22d96..5bb04085f670657b5c2d50aa3c6debc46ea059a8 100644 (file)
@@ -207,8 +207,4 @@ struct i2c_hw_engine_dce110_create_arg {
 struct i2c_engine *dal_i2c_hw_engine_dce110_create(
        const struct i2c_hw_engine_dce110_create_arg *arg);
 
-bool i2c_hw_engine_dce110_construct(
-       struct i2c_hw_engine_dce110 *engine_dce110,
-       const struct i2c_hw_engine_dce110_create_arg *arg);
-
 #endif
index bf2c4b240b784c5f9cd24b696a4b7761a2ae84c5..3aa7f791e523c66638816e53a5f44cbbe899f278 100644 (file)
@@ -118,7 +118,7 @@ static const struct engine_funcs engine_funcs = {
        .submit_request = dal_i2c_sw_engine_submit_request,
 };
 
-static bool construct(
+static void construct(
        struct i2c_sw_engine_dce110 *engine_dce110,
        const struct i2c_sw_engine_dce110_create_arg *arg_dce110)
 {
@@ -127,11 +127,7 @@ static bool construct(
        arg_base.ctx = arg_dce110->ctx;
        arg_base.default_speed = arg_dce110->default_speed;
 
-       if (!dal_i2c_sw_engine_construct(
-                       &engine_dce110->base, &arg_base)) {
-               ASSERT_CRITICAL(false);
-               return false;
-       }
+       dal_i2c_sw_engine_construct(&engine_dce110->base, &arg_base);
 
        /*struct engine   struct engine_funcs*/
        engine_dce110->base.base.base.funcs = &engine_funcs;
@@ -139,8 +135,6 @@ static bool construct(
        engine_dce110->base.base.funcs = &i2c_engine_funcs;
        engine_dce110->base.default_speed = arg_dce110->default_speed;
        engine_dce110->engine_id = arg_dce110->engine_id;
-
-       return true;
 }
 
 struct i2c_engine *dal_i2c_sw_engine_dce110_create(
@@ -161,12 +155,6 @@ struct i2c_engine *dal_i2c_sw_engine_dce110_create(
                return NULL;
        }
 
-       if (construct(engine_dce110, arg))
-               return &engine_dce110->base.base;
-
-       ASSERT_CRITICAL(false);
-
-       kfree(engine_dce110);
-
-       return NULL;
+       construct(engine_dce110, arg);
+       return &engine_dce110->base.base;
 }
index ae9adb389319ae185961c5588e052ce89fa93b2d..2a047f8ca0e9ab3d9023204edc0b01167f8c26b8 100644 (file)
@@ -196,7 +196,7 @@ static const struct dce110_i2c_hw_engine_mask i2c_mask = {
                I2C_COMMON_MASK_SH_LIST_DCE110(_MASK)
 };
 
-bool dal_i2caux_dce110_construct(
+void dal_i2caux_dce110_construct(
        struct i2caux_dce110 *i2caux_dce110,
        struct dc_context *ctx,
        const struct dce110_aux_registers aux_regs[],
@@ -217,10 +217,7 @@ bool dal_i2caux_dce110_construct(
 
        base = &i2caux_dce110->base;
 
-       if (!dal_i2caux_construct(base, ctx)) {
-               ASSERT_CRITICAL(false);
-               return false;
-       }
+       dal_i2caux_construct(base, ctx);
 
        i2caux_dce110->base.funcs = &i2caux_funcs;
        i2caux_dce110->i2c_hw_buffer_in_use = false;
@@ -278,8 +275,6 @@ bool dal_i2caux_dce110_construct(
        } while (i < ARRAY_SIZE(hw_aux_lines));
 
        /*TODO Generic I2C SW and HW*/
-
-       return true;
 }
 
 /*
@@ -306,18 +301,11 @@ struct i2caux *dal_i2caux_dce110_create(
                return NULL;
        }
 
-       if (dal_i2caux_dce110_construct(
-                       i2caux_dce110,
-                       ctx,
-                       dce110_aux_regs,
-                       i2c_hw_engine_regs,
-                       &i2c_shift,
-                       &i2c_mask))
-               return &i2caux_dce110->base;
-
-       ASSERT_CRITICAL(false);
-
-       kfree(i2caux_dce110);
-
-       return NULL;
+       dal_i2caux_dce110_construct(i2caux_dce110,
+                                   ctx,
+                                   dce110_aux_regs,
+                                   i2c_hw_engine_regs,
+                                   &i2c_shift,
+                                   &i2c_mask);
+       return &i2caux_dce110->base;
 }
index fd1cc23c3d701e0c70343bec8b683912ef9135d7..1b1f71c60ac93baac87d3dae2926035b5a67628f 100644 (file)
@@ -42,7 +42,7 @@ struct dce110_i2c_hw_engine_mask;
 struct i2caux *dal_i2caux_dce110_create(
        struct dc_context *ctx);
 
-bool dal_i2caux_dce110_construct(
+void dal_i2caux_dce110_construct(
        struct i2caux_dce110 *i2caux_dce110,
        struct dc_context *ctx,
        const struct dce110_aux_registers *aux_regs,
index 715ba43909577d561f2cd423d7101ef41f45fb4c..dafc1a727f7f9c0135cab912723e3d071c1ae74b 100644 (file)
@@ -87,22 +87,16 @@ static const struct dce110_i2c_hw_engine_mask i2c_mask = {
                I2C_COMMON_MASK_SH_LIST_DCE110(_MASK)
 };
 
-static bool construct(
+static void construct(
        struct i2caux_dce110 *i2caux_dce110,
        struct dc_context *ctx)
 {
-       if (!dal_i2caux_dce110_construct(
-                       i2caux_dce110,
-                       ctx,
-                       dce112_aux_regs,
-                       dce112_hw_engine_regs,
-                       &i2c_shift,
-                       &i2c_mask)) {
-               ASSERT_CRITICAL(false);
-               return false;
-       }
-
-       return true;
+       dal_i2caux_dce110_construct(i2caux_dce110,
+                                   ctx,
+                                   dce112_aux_regs,
+                                   dce112_hw_engine_regs,
+                                   &i2c_shift,
+                                   &i2c_mask);
 }
 
 /*
@@ -129,12 +123,6 @@ struct i2caux *dal_i2caux_dce112_create(
                return NULL;
        }
 
-       if (construct(i2caux_dce110, ctx))
-               return &i2caux_dce110->base;
-
-       ASSERT_CRITICAL(false);
-
-       kfree(i2caux_dce110);
-
-       return NULL;
+       construct(i2caux_dce110, ctx);
+       return &i2caux_dce110->base;
 }
index d52827ae3f1a0f049178f1ea7e2050660556ff15..668981a4c285770256e8bda9815396ffdd9da614 100644 (file)
@@ -108,18 +108,11 @@ struct i2caux *dal_i2caux_dce120_create(
                return NULL;
        }
 
-       if (dal_i2caux_dce110_construct(
-                       i2caux_dce110,
-                       ctx,
-                       dce120_aux_regs,
-                       dce120_hw_engine_regs,
-                       &i2c_shift,
-                       &i2c_mask))
-               return &i2caux_dce110->base;
-
-       ASSERT_CRITICAL(false);
-
-       kfree(i2caux_dce110);
-
-       return NULL;
+       dal_i2caux_dce110_construct(i2caux_dce110,
+                                   ctx,
+                                   dce120_aux_regs,
+                                   dce120_hw_engine_regs,
+                                   &i2c_shift,
+                                   &i2c_mask);
+       return &i2caux_dce110->base;
 }
index d41e37c94214738e99e9ced6946b818f0c0b034c..fd0832dd2c751cf183703cb5ceb2a30ea072f127 100644 (file)
@@ -824,20 +824,11 @@ static const struct i2c_hw_engine_funcs i2c_hw_engine_funcs = {
                dal_i2c_hw_engine_wait_on_operation_result,
 };
 
-static bool construct(
+static void construct(
        struct i2c_hw_engine_dce80 *engine,
        const struct i2c_hw_engine_dce80_create_arg *arg)
 {
-       if (arg->engine_id >= sizeof(ddc_setup_offset) / sizeof(int32_t))
-               return false;
-       if (arg->engine_id >= sizeof(ddc_speed_offset) / sizeof(int32_t))
-               return false;
-
-       if (!arg->reference_frequency)
-               return false;
-
-       if (!dal_i2c_hw_engine_construct(&engine->base, arg->ctx))
-               return false;
+       dal_i2c_hw_engine_construct(&engine->base, arg->ctx);
 
        engine->base.base.base.funcs = &engine_funcs;
        engine->base.base.funcs = &i2c_engine_funcs;
@@ -853,8 +844,6 @@ static bool construct(
        engine->buffer_used_bytes = 0;
        engine->transaction_count = 0;
        engine->engine_keep_power_up_count = 1;
-
-       return true;
 }
 
 struct i2c_engine *dal_i2c_hw_engine_dce80_create(
@@ -867,6 +856,13 @@ struct i2c_engine *dal_i2c_hw_engine_dce80_create(
                return NULL;
        }
 
+       if ((arg->engine_id >= sizeof(ddc_setup_offset) / sizeof(int32_t)) ||
+           (arg->engine_id >= sizeof(ddc_speed_offset) / sizeof(int32_t)) ||
+           !arg->reference_frequency) {
+               BREAK_TO_DEBUGGER();
+               return NULL;
+       }
+
        engine = kzalloc(sizeof(struct i2c_hw_engine_dce80), GFP_KERNEL);
 
        if (!engine) {
@@ -874,12 +870,6 @@ struct i2c_engine *dal_i2c_hw_engine_dce80_create(
                return NULL;
        }
 
-       if (construct(engine, arg))
-               return &engine->base.base;
-
-       BREAK_TO_DEBUGGER();
-
-       kfree(engine);
-
-       return NULL;
+       construct(engine, arg);
+       return &engine->base.base;
 }
index 6be77bc931c6e58a13fc5bde3b6ff626cd1aebff..4853ee26096a2a57bfb488dc75414c481a53d92e 100644 (file)
@@ -133,7 +133,7 @@ static const struct engine_funcs engine_funcs = {
        .submit_request = dal_i2c_sw_engine_submit_request,
 };
 
-static bool construct(
+static void construct(
        struct i2c_sw_engine_dce80 *engine,
        const struct i2c_sw_engine_dce80_create_arg *arg)
 {
@@ -142,17 +142,12 @@ static bool construct(
        arg_base.ctx = arg->ctx;
        arg_base.default_speed = arg->default_speed;
 
-       if (!dal_i2c_sw_engine_construct(&engine->base, &arg_base)) {
-               BREAK_TO_DEBUGGER();
-               return false;
-       }
+       dal_i2c_sw_engine_construct(&engine->base, &arg_base);
 
        engine->base.base.base.funcs = &engine_funcs;
        engine->base.base.funcs = &i2c_engine_funcs;
        engine->base.default_speed = arg->default_speed;
        engine->engine_id = arg->engine_id;
-
-       return true;
 }
 
 struct i2c_engine *dal_i2c_sw_engine_dce80_create(
@@ -172,13 +167,7 @@ struct i2c_engine *dal_i2c_sw_engine_dce80_create(
                return NULL;
        }
 
-       if (construct(engine, arg))
-               return &engine->base.base;
-
-       BREAK_TO_DEBUGGER();
-
-       kfree(engine);
-
-       return NULL;
+       construct(engine, arg);
+       return &engine->base.base;
 }
 
index d3c157e5eccdf0104a4686e5a76dc9778efac4b1..ed48596dd2a52155e8bc6fa3dc392b28cb47c47a 100644 (file)
@@ -187,7 +187,7 @@ static const struct i2caux_funcs i2caux_funcs = {
        .acquire_aux_engine = dal_i2caux_acquire_aux_engine,
 };
 
-static bool construct(
+static void construct(
        struct i2caux_dce80 *i2caux_dce80,
        struct dc_context *ctx)
 {
@@ -207,10 +207,7 @@ static bool construct(
 
        uint32_t i;
 
-       if (!dal_i2caux_construct(base, ctx)) {
-               BREAK_TO_DEBUGGER();
-               return false;
-       }
+       dal_i2caux_construct(base, ctx);
 
        i2caux_dce80->base.funcs = &i2caux_funcs;
        i2caux_dce80->i2c_hw_buffer_in_use = false;
@@ -269,8 +266,6 @@ static bool construct(
        } while (i < ARRAY_SIZE(hw_aux_lines));
 
        /* TODO Generic I2C SW and HW */
-
-       return true;
 }
 
 struct i2caux *dal_i2caux_dce80_create(
@@ -284,12 +279,6 @@ struct i2caux *dal_i2caux_dce80_create(
                return NULL;
        }
 
-       if (construct(i2caux_dce80, ctx))
-               return &i2caux_dce80->base;
-
-       BREAK_TO_DEBUGGER();
-
-       kfree(i2caux_dce80);
-
-       return NULL;
+       construct(i2caux_dce80, ctx);
+       return &i2caux_dce80->base;
 }
index f8659f1c5f9d719cae3b4e576e2115c0f270dc95..13b807d8aff8a5e2a714665e0af36b72666d3d83 100644 (file)
@@ -108,18 +108,11 @@ struct i2caux *dal_i2caux_dcn10_create(
                return NULL;
        }
 
-       if (dal_i2caux_dce110_construct(
-                       i2caux_dce110,
-                       ctx,
-                       dcn10_aux_regs,
-                       dcn10_hw_engine_regs,
-                       &i2c_shift,
-                       &i2c_mask))
-               return &i2caux_dce110->base;
-
-       ASSERT_CRITICAL(false);
-
-       kfree(i2caux_dce110);
-
-       return NULL;
+       dal_i2caux_dce110_construct(i2caux_dce110,
+                                   ctx,
+                                   dcn10_aux_regs,
+                                   dcn10_hw_engine_regs,
+                                   &i2c_shift,
+                                   &i2c_mask);
+       return &i2caux_dce110->base;
 }
index 1fdb3252920b548ef757cf1ce57c24155a86f24b..e6408f644086c2da1ff9c20679845e92edbaae29 100644 (file)
@@ -73,18 +73,12 @@ static const struct i2caux_funcs i2caux_funcs = {
        .acquire_aux_engine = NULL,
 };
 
-static bool construct(
+static void construct(
        struct i2caux *i2caux,
        struct dc_context *ctx)
 {
-       if (!dal_i2caux_construct(i2caux, ctx)) {
-               ASSERT_CRITICAL(false);
-               return false;
-       }
-
+       dal_i2caux_construct(i2caux, ctx);
        i2caux->funcs = &i2caux_funcs;
-
-       return true;
 }
 
 struct i2caux *dal_i2caux_diag_fpga_create(
@@ -98,12 +92,6 @@ struct i2caux *dal_i2caux_diag_fpga_create(
                return NULL;
        }
 
-       if (construct(i2caux, ctx))
-               return i2caux;
-
-       ASSERT_CRITICAL(false);
-
-       kfree(i2caux);
-
-       return NULL;
+       construct(i2caux, ctx);
+       return i2caux;
 }
index 76fe2df3c2f86d1919b2bb27ddb12c3409f3f2b4..33de8a8834dc1a71e9f898b81c6a2818549f13e6 100644 (file)
@@ -110,7 +110,7 @@ struct engine {
        struct dc_context *ctx;
 };
 
-bool dal_i2caux_construct_engine(
+void dal_i2caux_construct_engine(
        struct engine *engine,
        struct dc_context *ctx);
 
index 09da8137949137efbd389e5f3f6273af71a69071..5d155d36d353ebbab49bb5f83487eaab78d6b9ee 100644 (file)
 
 #include "engine.h"
 
-bool dal_i2caux_construct_engine(
+void dal_i2caux_construct_engine(
        struct engine *engine,
        struct dc_context *ctx)
 {
        engine->ddc = NULL;
        engine->ctx = ctx;
-       return true;
 }
 
 void dal_i2caux_destruct_engine(
index 144f51dc4523bfcdcffc2faa5fc1c7537614de84..70e20bd47ce4955727fbbc4610d3bd7702aa2c81 100644 (file)
@@ -103,15 +103,12 @@ void dal_i2c_engine_process_channel_reply(
 
 }
 
-bool dal_i2c_engine_construct(
+void dal_i2c_engine_construct(
        struct i2c_engine *engine,
        struct dc_context *ctx)
 {
-       if (!dal_i2caux_construct_engine(&engine->base, ctx))
-               return false;
-
+       dal_i2caux_construct_engine(&engine->base, ctx);
        engine->timeout_delay = 0;
-       return true;
 }
 
 void dal_i2c_engine_destruct(
index ce2c51ddea02efe4d309054e0fe18afee9a04108..58fc0f25ecebb68d1d7900cf58c620d5109aa9b1 100644 (file)
@@ -88,7 +88,7 @@ struct i2c_engine {
        uint32_t timeout_delay;
 };
 
-bool dal_i2c_engine_construct(
+void dal_i2c_engine_construct(
        struct i2c_engine *engine,
        struct dc_context *ctx);
 
index 521c4ec9863224c7ecc77221af8ac15d4f8e3502..5a4295e0fae52d3c3a0e3b0b8dd9cfc483773db8 100644 (file)
@@ -270,13 +270,11 @@ uint32_t dal_i2c_generic_hw_engine_get_transaction_timeout(
                (1 + (length << 3) + 1);
 }
 
-bool dal_i2c_generic_hw_engine_construct(
+void dal_i2c_generic_hw_engine_construct(
        struct i2c_generic_hw_engine *engine,
        struct dc_context *ctx)
 {
-       if (!dal_i2c_hw_engine_construct(&engine->base, ctx))
-               return false;
-       return true;
+       dal_i2c_hw_engine_construct(&engine->base, ctx);
 }
 
 void dal_i2c_generic_hw_engine_destruct(
index 083bb0dee9a1d7be57627e9e0d4d8db70bbe969e..1da0397b04a276c46f06c75f531f3a7c4019d949 100644 (file)
@@ -59,7 +59,7 @@ struct i2c_generic_hw_engine {
        const struct i2c_generic_hw_engine_funcs *funcs;
 };
 
-bool dal_i2c_generic_hw_engine_construct(
+void dal_i2c_generic_hw_engine_construct(
        struct i2c_generic_hw_engine *engine,
        struct dc_context *ctx);
 
index 00a8f07a74e9c92605bfab90118e511e31509701..4b54fcfb28ecd81bea5571ffde73d235d479aa97 100644 (file)
@@ -228,15 +228,13 @@ enum i2c_channel_operation_result dal_i2c_hw_engine_wait_on_operation_result(
        return result;
 }
 
-bool dal_i2c_hw_engine_construct(
+void dal_i2c_hw_engine_construct(
        struct i2c_hw_engine *engine,
        struct dc_context *ctx)
 {
-       if (!dal_i2c_engine_construct(&engine->base, ctx))
-               return false;
+       dal_i2c_engine_construct(&engine->base, ctx);
        engine->original_speed = I2CAUX_DEFAULT_I2C_HW_SPEED;
        engine->default_speed = I2CAUX_DEFAULT_I2C_HW_SPEED;
-       return true;
 }
 
 void dal_i2c_hw_engine_destruct(
index f2df1749820e2a1e8c644010a1eae3b0504af2cd..8936a994804a01466c582a044f835c6d34d74f06 100644 (file)
@@ -53,7 +53,7 @@ struct i2c_hw_engine {
        uint32_t default_speed;
 };
 
-bool dal_i2c_hw_engine_construct(
+void dal_i2c_hw_engine_construct(
        struct i2c_hw_engine *engine,
        struct dc_context *ctx);
 
index 9d0077ade12c2c28c5880dd49b92070585e47bec..8e19bb6293947b6827f155a2f402b2f8343106aa 100644 (file)
@@ -569,17 +569,14 @@ static const struct engine_funcs engine_funcs = {
        .submit_request = dal_i2c_sw_engine_submit_request,
 };
 
-bool dal_i2c_sw_engine_construct(
+void dal_i2c_sw_engine_construct(
        struct i2c_sw_engine *engine,
        const struct i2c_sw_engine_create_arg *arg)
 {
-       if (!dal_i2c_engine_construct(&engine->base, arg->ctx))
-               return false;
-
+       dal_i2c_engine_construct(&engine->base, arg->ctx);
        dal_i2c_sw_engine_set_speed(&engine->base, arg->default_speed);
        engine->base.funcs = &i2c_engine_funcs;
        engine->base.base.funcs = &engine_funcs;
-       return true;
 }
 
 struct i2c_engine *dal_i2c_sw_engine_create(
@@ -599,12 +596,6 @@ struct i2c_engine *dal_i2c_sw_engine_create(
                return NULL;
        }
 
-       if (dal_i2c_sw_engine_construct(engine, arg))
-               return &engine->base;
-
-       BREAK_TO_DEBUGGER();
-
-       kfree(engine);
-
-       return NULL;
+       dal_i2c_sw_engine_construct(engine, arg);
+       return &engine->base;
 }
index e0cb4c3d483d8b6e7229dd41c9c0402362c98746..546f15b0d3f1a12653857fb86693b49ce3283f00 100644 (file)
@@ -48,7 +48,7 @@ struct i2c_sw_engine_create_arg {
        struct dc_context *ctx;
 };
 
-bool dal_i2c_sw_engine_construct(
+void dal_i2c_sw_engine_construct(
        struct i2c_sw_engine *engine,
        const struct i2c_sw_engine_create_arg *arg);
 
index 9b115e1e2f1a0e59b1f47fe42de99364983b2862..e1593ffe5a2bd1753c1cbdc9a5dfac1120341a89 100644 (file)
@@ -423,7 +423,7 @@ void dal_i2caux_release_engine(
        engine->ddc = NULL;
 }
 
-bool dal_i2caux_construct(
+void dal_i2caux_construct(
        struct i2caux *i2caux,
        struct dc_context *ctx)
 {
@@ -451,8 +451,6 @@ bool dal_i2caux_construct(
                i2caux->default_i2c_hw_speed = DEFAULT_I2C_HW_SPEED;
                i2caux->default_i2c_sw_speed = DEFAULT_I2C_SW_SPEED;
        }
-
-       return true;
 }
 
 void dal_i2caux_destruct(
index bc20de3da1c4fbf00503797298cabd8c51187477..64f51bb06915fe9f2bdc9b74dbd8983c7d62cef5 100644 (file)
@@ -97,7 +97,7 @@ struct i2caux {
        uint32_t default_i2c_hw_speed;
 };
 
-bool dal_i2caux_construct(
+void dal_i2caux_construct(
        struct i2caux *i2caux,
        struct dc_context *ctx);