Commit f29f918f authored by Dave Airlie's avatar Dave Airlie Committed by Alex Deucher

amdgpu/dc: make stream encoder constructor return void.

The checks weren't useful here really.
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 ca19d1a6
...@@ -1605,7 +1605,7 @@ static const struct stream_encoder_funcs dce110_str_enc_funcs = { ...@@ -1605,7 +1605,7 @@ static const struct stream_encoder_funcs dce110_str_enc_funcs = {
}; };
bool dce110_stream_encoder_construct( void dce110_stream_encoder_construct(
struct dce110_stream_encoder *enc110, struct dce110_stream_encoder *enc110,
struct dc_context *ctx, struct dc_context *ctx,
struct dc_bios *bp, struct dc_bios *bp,
...@@ -1614,11 +1614,6 @@ bool dce110_stream_encoder_construct( ...@@ -1614,11 +1614,6 @@ bool dce110_stream_encoder_construct(
const struct dce_stream_encoder_shift *se_shift, const struct dce_stream_encoder_shift *se_shift,
const struct dce_stream_encoder_mask *se_mask) const struct dce_stream_encoder_mask *se_mask)
{ {
if (!enc110)
return false;
if (!bp)
return false;
enc110->base.funcs = &dce110_str_enc_funcs; enc110->base.funcs = &dce110_str_enc_funcs;
enc110->base.ctx = ctx; enc110->base.ctx = ctx;
enc110->base.id = eng_id; enc110->base.id = eng_id;
...@@ -1626,6 +1621,4 @@ bool dce110_stream_encoder_construct( ...@@ -1626,6 +1621,4 @@ bool dce110_stream_encoder_construct(
enc110->regs = regs; enc110->regs = regs;
enc110->se_shift = se_shift; enc110->se_shift = se_shift;
enc110->se_mask = se_mask; enc110->se_mask = se_mask;
return true;
} }
...@@ -697,7 +697,7 @@ struct dce110_stream_encoder { ...@@ -697,7 +697,7 @@ struct dce110_stream_encoder {
const struct dce_stream_encoder_mask *se_mask; const struct dce_stream_encoder_mask *se_mask;
}; };
bool dce110_stream_encoder_construct( void dce110_stream_encoder_construct(
struct dce110_stream_encoder *enc110, struct dce110_stream_encoder *enc110,
struct dc_context *ctx, struct dc_context *ctx,
struct dc_bios *bp, struct dc_bios *bp,
......
...@@ -389,14 +389,9 @@ static struct stream_encoder *dce100_stream_encoder_create( ...@@ -389,14 +389,9 @@ static struct stream_encoder *dce100_stream_encoder_create(
if (!enc110) if (!enc110)
return NULL; return NULL;
if (dce110_stream_encoder_construct( dce110_stream_encoder_construct(enc110, ctx, ctx->dc_bios, eng_id,
enc110, ctx, ctx->dc_bios, eng_id, &stream_enc_regs[eng_id], &se_shift, &se_mask);
&stream_enc_regs[eng_id], &se_shift, &se_mask)) return &enc110->base;
return &enc110->base;
BREAK_TO_DEBUGGER();
kfree(enc110);
return NULL;
} }
#define SRII(reg_name, block, id)\ #define SRII(reg_name, block, id)\
......
...@@ -424,14 +424,10 @@ static struct stream_encoder *dce110_stream_encoder_create( ...@@ -424,14 +424,10 @@ static struct stream_encoder *dce110_stream_encoder_create(
if (!enc110) if (!enc110)
return NULL; return NULL;
if (dce110_stream_encoder_construct( dce110_stream_encoder_construct(enc110, ctx, ctx->dc_bios, eng_id,
enc110, ctx, ctx->dc_bios, eng_id, &stream_enc_regs[eng_id],
&stream_enc_regs[eng_id], &se_shift, &se_mask)) &se_shift, &se_mask);
return &enc110->base; return &enc110->base;
BREAK_TO_DEBUGGER();
kfree(enc110);
return NULL;
} }
#define SRII(reg_name, block, id)\ #define SRII(reg_name, block, id)\
......
...@@ -428,15 +428,11 @@ static struct stream_encoder *dce112_stream_encoder_create( ...@@ -428,15 +428,11 @@ static struct stream_encoder *dce112_stream_encoder_create(
if (!enc110) if (!enc110)
return NULL; return NULL;
if (dce110_stream_encoder_construct( dce110_stream_encoder_construct(enc110, ctx, ctx->dc_bios, eng_id,
enc110, ctx, ctx->dc_bios, eng_id, &stream_enc_regs[eng_id],
&stream_enc_regs[eng_id], &se_shift, &se_mask)) &se_shift, &se_mask);
return &enc110->base; return &enc110->base;
BREAK_TO_DEBUGGER();
kfree(enc110);
return NULL;
} }
#define SRII(reg_name, block, id)\ #define SRII(reg_name, block, id)\
......
...@@ -585,14 +585,10 @@ static struct stream_encoder *dce120_stream_encoder_create( ...@@ -585,14 +585,10 @@ static struct stream_encoder *dce120_stream_encoder_create(
if (!enc110) if (!enc110)
return NULL; return NULL;
if (dce110_stream_encoder_construct( dce110_stream_encoder_construct(enc110, ctx, ctx->dc_bios, eng_id,
enc110, ctx, ctx->dc_bios, eng_id, &stream_enc_regs[eng_id],
&stream_enc_regs[eng_id], &se_shift, &se_mask)) &se_shift, &se_mask);
return &enc110->base; return &enc110->base;
BREAK_TO_DEBUGGER();
kfree(enc110);
return NULL;
} }
#define SRII(reg_name, block, id)\ #define SRII(reg_name, block, id)\
......
...@@ -441,14 +441,10 @@ static struct stream_encoder *dce80_stream_encoder_create( ...@@ -441,14 +441,10 @@ static struct stream_encoder *dce80_stream_encoder_create(
if (!enc110) if (!enc110)
return NULL; return NULL;
if (dce110_stream_encoder_construct( dce110_stream_encoder_construct(enc110, ctx, ctx->dc_bios, eng_id,
enc110, ctx, ctx->dc_bios, eng_id, &stream_enc_regs[eng_id],
&stream_enc_regs[eng_id], &se_shift, &se_mask)) &se_shift, &se_mask);
return &enc110->base; return &enc110->base;
BREAK_TO_DEBUGGER();
kfree(enc110);
return NULL;
} }
#define SRII(reg_name, block, id)\ #define SRII(reg_name, block, id)\
......
...@@ -627,14 +627,10 @@ static struct stream_encoder *dcn10_stream_encoder_create( ...@@ -627,14 +627,10 @@ static struct stream_encoder *dcn10_stream_encoder_create(
if (!enc110) if (!enc110)
return NULL; return NULL;
if (dce110_stream_encoder_construct( dce110_stream_encoder_construct(enc110, ctx, ctx->dc_bios, eng_id,
enc110, ctx, ctx->dc_bios, eng_id, &stream_enc_regs[eng_id],
&stream_enc_regs[eng_id], &se_shift, &se_mask)) &se_shift, &se_mask);
return &enc110->base; return &enc110->base;
BREAK_TO_DEBUGGER();
kfree(enc110);
return NULL;
} }
static const struct dce_hwseq_registers hwseq_reg = { static const struct dce_hwseq_registers hwseq_reg = {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment