Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b08c3ca4 authored by Dave Airlie's avatar Dave Airlie Committed by Alex Deucher
Browse files

amdgpu/dc: remove pointless returns in the i2caux constructor paths. (v2)



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: default avatarDave Airlie <airlied@redhat.com>
Reviewed-by: default avatarHarry Wentland <harry.wentland@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 4179cd81
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -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(
+1 −1
Original line number Diff line number Diff line
@@ -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);

+7 −14
Original line number Diff line number Diff line
@@ -95,18 +95,11 @@ struct i2caux *dal_i2caux_dce100_create(
		return NULL;
	}

	if (dal_i2caux_dce110_construct(
			i2caux_dce110,
	dal_i2caux_dce110_construct(i2caux_dce110,
				    ctx,
				    dce100_aux_regs,
				    dce100_hw_engine_regs,
				    &i2c_shift,
			&i2c_mask))
				    &i2c_mask);
	return &i2caux_dce110->base;

	ASSERT_CRITICAL(false);

	kfree(i2caux_dce110);

	return NULL;
}
+4 −16
Original line number Diff line number Diff line
@@ -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))
	construct(engine, aux_init_data);
	return &engine->base;

	ASSERT_CRITICAL(false);

	kfree(engine);

	return NULL;
}
+8 −16
Original line number Diff line number Diff line
@@ -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))
	construct(engine_dce10, arg);
	return &engine_dce10->base.base;

	ASSERT_CRITICAL(false);

	kfree(engine_dce10);

	return NULL;
}
Loading