Skip to content

Commit c0af492

Browse files
committed
drm/ast: Remove struct ast_{vga,sil165}_connector
Both, struct ast_vga_connector and struct ast_sil164_connector, are now wrappers around struct drm_connector. Remove them. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com> Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240325200855.21150-4-tzimmermann@suse.de
1 parent d66cdb6 commit c0af492

2 files changed

Lines changed: 10 additions & 36 deletions

File tree

drivers/gpu/drm/ast/ast_drv.h

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -158,26 +158,6 @@ struct ast_i2c_chan {
158158
struct i2c_algo_bit_data bit;
159159
};
160160

161-
struct ast_vga_connector {
162-
struct drm_connector base;
163-
};
164-
165-
static inline struct ast_vga_connector *
166-
to_ast_vga_connector(struct drm_connector *connector)
167-
{
168-
return container_of(connector, struct ast_vga_connector, base);
169-
}
170-
171-
struct ast_sil164_connector {
172-
struct drm_connector base;
173-
};
174-
175-
static inline struct ast_sil164_connector *
176-
to_ast_sil164_connector(struct drm_connector *connector)
177-
{
178-
return container_of(connector, struct ast_sil164_connector, base);
179-
}
180-
181161
struct ast_bmc_connector {
182162
struct drm_connector base;
183163
struct drm_connector *physical_connector;
@@ -220,11 +200,11 @@ struct ast_device {
220200
struct {
221201
struct {
222202
struct drm_encoder encoder;
223-
struct ast_vga_connector vga_connector;
203+
struct drm_connector connector;
224204
} vga;
225205
struct {
226206
struct drm_encoder encoder;
227-
struct ast_sil164_connector sil164_connector;
207+
struct drm_connector connector;
228208
} sil164;
229209
struct {
230210
struct drm_encoder encoder;

drivers/gpu/drm/ast/ast_mode.c

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1385,10 +1385,8 @@ static const struct drm_connector_funcs ast_vga_connector_funcs = {
13851385
.atomic_destroy_state = drm_atomic_helper_connector_destroy_state,
13861386
};
13871387

1388-
static int ast_vga_connector_init(struct drm_device *dev,
1389-
struct ast_vga_connector *ast_vga_connector)
1388+
static int ast_vga_connector_init(struct drm_device *dev, struct drm_connector *connector)
13901389
{
1391-
struct drm_connector *connector = &ast_vga_connector->base;
13921390
struct ast_i2c_chan *i2c;
13931391
int ret;
13941392

@@ -1419,16 +1417,15 @@ static int ast_vga_output_init(struct ast_device *ast)
14191417
struct drm_device *dev = &ast->base;
14201418
struct drm_crtc *crtc = &ast->crtc;
14211419
struct drm_encoder *encoder = &ast->output.vga.encoder;
1422-
struct ast_vga_connector *ast_vga_connector = &ast->output.vga.vga_connector;
1423-
struct drm_connector *connector = &ast_vga_connector->base;
1420+
struct drm_connector *connector = &ast->output.vga.connector;
14241421
int ret;
14251422

14261423
ret = drm_simple_encoder_init(dev, encoder, DRM_MODE_ENCODER_DAC);
14271424
if (ret)
14281425
return ret;
14291426
encoder->possible_crtcs = drm_crtc_mask(crtc);
14301427

1431-
ret = ast_vga_connector_init(dev, ast_vga_connector);
1428+
ret = ast_vga_connector_init(dev, connector);
14321429
if (ret)
14331430
return ret;
14341431

@@ -1485,10 +1482,8 @@ static const struct drm_connector_funcs ast_sil164_connector_funcs = {
14851482
.atomic_destroy_state = drm_atomic_helper_connector_destroy_state,
14861483
};
14871484

1488-
static int ast_sil164_connector_init(struct drm_device *dev,
1489-
struct ast_sil164_connector *ast_sil164_connector)
1485+
static int ast_sil164_connector_init(struct drm_device *dev, struct drm_connector *connector)
14901486
{
1491-
struct drm_connector *connector = &ast_sil164_connector->base;
14921487
struct ast_i2c_chan *i2c;
14931488
int ret;
14941489

@@ -1519,16 +1514,15 @@ static int ast_sil164_output_init(struct ast_device *ast)
15191514
struct drm_device *dev = &ast->base;
15201515
struct drm_crtc *crtc = &ast->crtc;
15211516
struct drm_encoder *encoder = &ast->output.sil164.encoder;
1522-
struct ast_sil164_connector *ast_sil164_connector = &ast->output.sil164.sil164_connector;
1523-
struct drm_connector *connector = &ast_sil164_connector->base;
1517+
struct drm_connector *connector = &ast->output.sil164.connector;
15241518
int ret;
15251519

15261520
ret = drm_simple_encoder_init(dev, encoder, DRM_MODE_ENCODER_TMDS);
15271521
if (ret)
15281522
return ret;
15291523
encoder->possible_crtcs = drm_crtc_mask(crtc);
15301524

1531-
ret = ast_sil164_connector_init(dev, ast_sil164_connector);
1525+
ret = ast_sil164_connector_init(dev, connector);
15321526
if (ret)
15331527
return ret;
15341528

@@ -1940,13 +1934,13 @@ int ast_mode_config_init(struct ast_device *ast)
19401934
ret = ast_vga_output_init(ast);
19411935
if (ret)
19421936
return ret;
1943-
physical_connector = &ast->output.vga.vga_connector.base;
1937+
physical_connector = &ast->output.vga.connector;
19441938
}
19451939
if (ast->tx_chip_types & AST_TX_SIL164_BIT) {
19461940
ret = ast_sil164_output_init(ast);
19471941
if (ret)
19481942
return ret;
1949-
physical_connector = &ast->output.sil164.sil164_connector.base;
1943+
physical_connector = &ast->output.sil164.connector;
19501944
}
19511945
if (ast->tx_chip_types & AST_TX_DP501_BIT) {
19521946
ret = ast_dp501_output_init(ast);

0 commit comments

Comments
 (0)