Skip to content

Commit 5abaa68

Browse files
committed
drm/ast: Rename to_ast_private() to to_ast_device()
The helper to_ast_private() now upcasts to struct ast_device. Rename it accordingly. No functional changes. Signed-off-by: Thomas Zimmermann <[email protected]> Reviewed-by: Javier Martinez Canillas <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 37b42cf commit 5abaa68

File tree

7 files changed

+46
-46
lines changed

7 files changed

+46
-46
lines changed

drivers/gpu/drm/ast/ast_dp.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
int ast_astdp_read_edid(struct drm_device *dev, u8 *ediddata)
1111
{
12-
struct ast_device *ast = to_ast_private(dev);
12+
struct ast_device *ast = to_ast_device(dev);
1313
u8 i = 0, j = 0;
1414

1515
/*
@@ -125,7 +125,7 @@ void ast_dp_launch(struct drm_device *dev, u8 bPower)
125125
u8 bDPTX = 0;
126126
u8 bDPExecute = 1;
127127

128-
struct ast_device *ast = to_ast_private(dev);
128+
struct ast_device *ast = to_ast_device(dev);
129129
// S3 come back, need more time to wait BMC ready.
130130
if (bPower)
131131
WaitCount = 300;
@@ -172,7 +172,7 @@ void ast_dp_launch(struct drm_device *dev, u8 bPower)
172172

173173
void ast_dp_power_on_off(struct drm_device *dev, bool on)
174174
{
175-
struct ast_device *ast = to_ast_private(dev);
175+
struct ast_device *ast = to_ast_device(dev);
176176
// Read and Turn off DP PHY sleep
177177
u8 bE3 = ast_get_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xE3, AST_DP_VIDEO_ENABLE);
178178

@@ -188,7 +188,7 @@ void ast_dp_power_on_off(struct drm_device *dev, bool on)
188188

189189
void ast_dp_set_on_off(struct drm_device *dev, bool on)
190190
{
191-
struct ast_device *ast = to_ast_private(dev);
191+
struct ast_device *ast = to_ast_device(dev);
192192
u8 video_on_off = on;
193193

194194
// Video On/Off
@@ -208,7 +208,7 @@ void ast_dp_set_on_off(struct drm_device *dev, bool on)
208208

209209
void ast_dp_set_mode(struct drm_crtc *crtc, struct ast_vbios_mode_info *vbios_mode)
210210
{
211-
struct ast_device *ast = to_ast_private(crtc->dev);
211+
struct ast_device *ast = to_ast_device(crtc->dev);
212212

213213
u32 ulRefreshRateIndex;
214214
u8 ModeIdx;

drivers/gpu/drm/ast/ast_dp501.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ static void ast_release_firmware(void *data)
1818

1919
static int ast_load_dp501_microcode(struct drm_device *dev)
2020
{
21-
struct ast_device *ast = to_ast_private(dev);
21+
struct ast_device *ast = to_ast_device(dev);
2222
int ret;
2323

2424
ret = request_firmware(&ast->dp501_fw, "ast_dp501_fw.bin", dev->dev);
@@ -106,7 +106,7 @@ static bool wait_fw_ready(struct ast_device *ast)
106106

107107
static bool ast_write_cmd(struct drm_device *dev, u8 data)
108108
{
109-
struct ast_device *ast = to_ast_private(dev);
109+
struct ast_device *ast = to_ast_device(dev);
110110
int retry = 0;
111111
if (wait_nack(ast)) {
112112
send_nack(ast);
@@ -128,7 +128,7 @@ static bool ast_write_cmd(struct drm_device *dev, u8 data)
128128

129129
static bool ast_write_data(struct drm_device *dev, u8 data)
130130
{
131-
struct ast_device *ast = to_ast_private(dev);
131+
struct ast_device *ast = to_ast_device(dev);
132132

133133
if (wait_nack(ast)) {
134134
send_nack(ast);
@@ -146,7 +146,7 @@ static bool ast_write_data(struct drm_device *dev, u8 data)
146146
#if 0
147147
static bool ast_read_data(struct drm_device *dev, u8 *data)
148148
{
149-
struct ast_device *ast = to_ast_private(dev);
149+
struct ast_device *ast = to_ast_device(dev);
150150
u8 tmp;
151151

152152
*data = 0;
@@ -185,7 +185,7 @@ static u32 get_fw_base(struct ast_device *ast)
185185

186186
bool ast_backup_fw(struct drm_device *dev, u8 *addr, u32 size)
187187
{
188-
struct ast_device *ast = to_ast_private(dev);
188+
struct ast_device *ast = to_ast_device(dev);
189189
u32 i, data;
190190
u32 boot_address;
191191

@@ -204,7 +204,7 @@ bool ast_backup_fw(struct drm_device *dev, u8 *addr, u32 size)
204204

205205
static bool ast_launch_m68k(struct drm_device *dev)
206206
{
207-
struct ast_device *ast = to_ast_private(dev);
207+
struct ast_device *ast = to_ast_device(dev);
208208
u32 i, data, len = 0;
209209
u32 boot_address;
210210
u8 *fw_addr = NULL;
@@ -274,7 +274,7 @@ static bool ast_launch_m68k(struct drm_device *dev)
274274

275275
bool ast_dp501_read_edid(struct drm_device *dev, u8 *ediddata)
276276
{
277-
struct ast_device *ast = to_ast_private(dev);
277+
struct ast_device *ast = to_ast_device(dev);
278278
u32 i, boot_address, offset, data;
279279
u32 *pEDIDidx;
280280

@@ -334,7 +334,7 @@ bool ast_dp501_read_edid(struct drm_device *dev, u8 *ediddata)
334334

335335
static bool ast_init_dvo(struct drm_device *dev)
336336
{
337-
struct ast_device *ast = to_ast_private(dev);
337+
struct ast_device *ast = to_ast_device(dev);
338338
u8 jreg;
339339
u32 data;
340340
ast_write32(ast, 0xf004, 0x1e6e0000);
@@ -407,7 +407,7 @@ static bool ast_init_dvo(struct drm_device *dev)
407407

408408
static void ast_init_analog(struct drm_device *dev)
409409
{
410-
struct ast_device *ast = to_ast_private(dev);
410+
struct ast_device *ast = to_ast_device(dev);
411411
u32 data;
412412

413413
/*
@@ -434,7 +434,7 @@ static void ast_init_analog(struct drm_device *dev)
434434

435435
void ast_init_3rdtx(struct drm_device *dev)
436436
{
437-
struct ast_device *ast = to_ast_private(dev);
437+
struct ast_device *ast = to_ast_device(dev);
438438
u8 jreg;
439439

440440
if (ast->chip == AST2300 || ast->chip == AST2400) {

drivers/gpu/drm/ast/ast_drv.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ struct ast_device {
210210
const struct firmware *dp501_fw; /* dp501 fw */
211211
};
212212

213-
static inline struct ast_device *to_ast_private(struct drm_device *dev)
213+
static inline struct ast_device *to_ast_device(struct drm_device *dev)
214214
{
215215
return container_of(dev, struct ast_device, base);
216216
}

drivers/gpu/drm/ast/ast_i2c.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
static void ast_i2c_setsda(void *i2c_priv, int data)
3030
{
3131
struct ast_i2c_chan *i2c = i2c_priv;
32-
struct ast_device *ast = to_ast_private(i2c->dev);
32+
struct ast_device *ast = to_ast_device(i2c->dev);
3333
int i;
3434
u8 ujcrb7, jtemp;
3535

@@ -45,7 +45,7 @@ static void ast_i2c_setsda(void *i2c_priv, int data)
4545
static void ast_i2c_setscl(void *i2c_priv, int clock)
4646
{
4747
struct ast_i2c_chan *i2c = i2c_priv;
48-
struct ast_device *ast = to_ast_private(i2c->dev);
48+
struct ast_device *ast = to_ast_device(i2c->dev);
4949
int i;
5050
u8 ujcrb7, jtemp;
5151

@@ -61,7 +61,7 @@ static void ast_i2c_setscl(void *i2c_priv, int clock)
6161
static int ast_i2c_getsda(void *i2c_priv)
6262
{
6363
struct ast_i2c_chan *i2c = i2c_priv;
64-
struct ast_device *ast = to_ast_private(i2c->dev);
64+
struct ast_device *ast = to_ast_device(i2c->dev);
6565
uint32_t val, val2, count, pass;
6666

6767
count = 0;
@@ -83,7 +83,7 @@ static int ast_i2c_getsda(void *i2c_priv)
8383
static int ast_i2c_getscl(void *i2c_priv)
8484
{
8585
struct ast_i2c_chan *i2c = i2c_priv;
86-
struct ast_device *ast = to_ast_private(i2c->dev);
86+
struct ast_device *ast = to_ast_device(i2c->dev);
8787
uint32_t val, val2, count, pass;
8888

8989
count = 0;

drivers/gpu/drm/ast/ast_main.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ uint8_t ast_get_index_reg_mask(struct ast_device *ast,
6666
static void ast_detect_config_mode(struct drm_device *dev, u32 *scu_rev)
6767
{
6868
struct device_node *np = dev->dev->of_node;
69-
struct ast_device *ast = to_ast_private(dev);
69+
struct ast_device *ast = to_ast_device(dev);
7070
struct pci_dev *pdev = to_pci_dev(dev->dev);
7171
uint32_t data, jregd0, jregd1;
7272

@@ -122,7 +122,7 @@ static void ast_detect_config_mode(struct drm_device *dev, u32 *scu_rev)
122122

123123
static int ast_detect_chip(struct drm_device *dev, bool *need_post)
124124
{
125-
struct ast_device *ast = to_ast_private(dev);
125+
struct ast_device *ast = to_ast_device(dev);
126126
struct pci_dev *pdev = to_pci_dev(dev->dev);
127127
uint32_t jreg, scu_rev;
128128

@@ -271,7 +271,7 @@ static int ast_detect_chip(struct drm_device *dev, bool *need_post)
271271
static int ast_get_dram_info(struct drm_device *dev)
272272
{
273273
struct device_node *np = dev->dev->of_node;
274-
struct ast_device *ast = to_ast_private(dev);
274+
struct ast_device *ast = to_ast_device(dev);
275275
uint32_t mcr_cfg, mcr_scu_mpll, mcr_scu_strap;
276276
uint32_t denum, num, div, ref_pll, dsel;
277277

drivers/gpu/drm/ast/ast_mode.c

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -645,7 +645,7 @@ static void ast_primary_plane_helper_atomic_update(struct drm_plane *plane,
645645
struct drm_atomic_state *state)
646646
{
647647
struct drm_device *dev = plane->dev;
648-
struct ast_device *ast = to_ast_private(dev);
648+
struct ast_device *ast = to_ast_device(dev);
649649
struct drm_plane_state *plane_state = drm_atomic_get_new_plane_state(state, plane);
650650
struct drm_shadow_plane_state *shadow_plane_state = to_drm_shadow_plane_state(plane_state);
651651
struct drm_framebuffer *fb = plane_state->fb;
@@ -683,7 +683,7 @@ static void ast_primary_plane_helper_atomic_update(struct drm_plane *plane,
683683
static void ast_primary_plane_helper_atomic_enable(struct drm_plane *plane,
684684
struct drm_atomic_state *state)
685685
{
686-
struct ast_device *ast = to_ast_private(plane->dev);
686+
struct ast_device *ast = to_ast_device(plane->dev);
687687
struct ast_plane *ast_plane = to_ast_plane(plane);
688688

689689
/*
@@ -699,7 +699,7 @@ static void ast_primary_plane_helper_atomic_enable(struct drm_plane *plane,
699699
static void ast_primary_plane_helper_atomic_disable(struct drm_plane *plane,
700700
struct drm_atomic_state *state)
701701
{
702-
struct ast_device *ast = to_ast_private(plane->dev);
702+
struct ast_device *ast = to_ast_device(plane->dev);
703703

704704
ast_set_index_reg_mask(ast, AST_IO_SEQ_PORT, 0x1, 0xdf, 0x20);
705705
}
@@ -888,7 +888,7 @@ static void ast_cursor_plane_helper_atomic_update(struct drm_plane *plane,
888888
struct drm_shadow_plane_state *shadow_plane_state = to_drm_shadow_plane_state(plane_state);
889889
struct drm_framebuffer *fb = plane_state->fb;
890890
struct drm_plane_state *old_plane_state = drm_atomic_get_old_plane_state(state, plane);
891-
struct ast_device *ast = to_ast_private(plane->dev);
891+
struct ast_device *ast = to_ast_device(plane->dev);
892892
struct iosys_map src_map = shadow_plane_state->data[0];
893893
struct drm_rect damage;
894894
const u8 *src = src_map.vaddr; /* TODO: Use mapping abstraction properly */
@@ -943,7 +943,7 @@ static void ast_cursor_plane_helper_atomic_update(struct drm_plane *plane,
943943
static void ast_cursor_plane_helper_atomic_disable(struct drm_plane *plane,
944944
struct drm_atomic_state *state)
945945
{
946-
struct ast_device *ast = to_ast_private(plane->dev);
946+
struct ast_device *ast = to_ast_device(plane->dev);
947947

948948
ast_set_cursor_enabled(ast, false);
949949
}
@@ -1007,7 +1007,7 @@ static int ast_cursor_plane_init(struct ast_device *ast)
10071007

10081008
static void ast_crtc_dpms(struct drm_crtc *crtc, int mode)
10091009
{
1010-
struct ast_device *ast = to_ast_private(crtc->dev);
1010+
struct ast_device *ast = to_ast_device(crtc->dev);
10111011
u8 ch = AST_DPMS_VSYNC_OFF | AST_DPMS_HSYNC_OFF;
10121012
struct ast_crtc_state *ast_state;
10131013
const struct drm_format_info *format;
@@ -1064,7 +1064,7 @@ static void ast_crtc_dpms(struct drm_crtc *crtc, int mode)
10641064
static enum drm_mode_status
10651065
ast_crtc_helper_mode_valid(struct drm_crtc *crtc, const struct drm_display_mode *mode)
10661066
{
1067-
struct ast_device *ast = to_ast_private(crtc->dev);
1067+
struct ast_device *ast = to_ast_device(crtc->dev);
10681068
enum drm_mode_status status;
10691069
uint32_t jtemp;
10701070

@@ -1189,7 +1189,7 @@ ast_crtc_helper_atomic_flush(struct drm_crtc *crtc,
11891189
struct drm_crtc_state *crtc_state = drm_atomic_get_new_crtc_state(state,
11901190
crtc);
11911191
struct drm_device *dev = crtc->dev;
1192-
struct ast_device *ast = to_ast_private(dev);
1192+
struct ast_device *ast = to_ast_device(dev);
11931193
struct ast_crtc_state *ast_crtc_state = to_ast_crtc_state(crtc_state);
11941194
struct ast_vbios_mode_info *vbios_mode_info = &ast_crtc_state->vbios_mode_info;
11951195

@@ -1214,7 +1214,7 @@ ast_crtc_helper_atomic_flush(struct drm_crtc *crtc,
12141214
static void ast_crtc_helper_atomic_enable(struct drm_crtc *crtc, struct drm_atomic_state *state)
12151215
{
12161216
struct drm_device *dev = crtc->dev;
1217-
struct ast_device *ast = to_ast_private(dev);
1217+
struct ast_device *ast = to_ast_device(dev);
12181218
struct drm_crtc_state *crtc_state = drm_atomic_get_new_crtc_state(state, crtc);
12191219
struct ast_crtc_state *ast_crtc_state = to_ast_crtc_state(crtc_state);
12201220
struct ast_vbios_mode_info *vbios_mode_info =
@@ -1236,7 +1236,7 @@ static void ast_crtc_helper_atomic_disable(struct drm_crtc *crtc, struct drm_ato
12361236
{
12371237
struct drm_crtc_state *old_crtc_state = drm_atomic_get_old_crtc_state(state, crtc);
12381238
struct drm_device *dev = crtc->dev;
1239-
struct ast_device *ast = to_ast_private(dev);
1239+
struct ast_device *ast = to_ast_device(dev);
12401240

12411241
ast_crtc_dpms(crtc, DRM_MODE_DPMS_OFF);
12421242

@@ -1324,7 +1324,7 @@ static const struct drm_crtc_funcs ast_crtc_funcs = {
13241324

13251325
static int ast_crtc_init(struct drm_device *dev)
13261326
{
1327-
struct ast_device *ast = to_ast_private(dev);
1327+
struct ast_device *ast = to_ast_device(dev);
13281328
struct drm_crtc *crtc = &ast->crtc;
13291329
int ret;
13301330

@@ -1350,7 +1350,7 @@ static int ast_vga_connector_helper_get_modes(struct drm_connector *connector)
13501350
{
13511351
struct ast_vga_connector *ast_vga_connector = to_ast_vga_connector(connector);
13521352
struct drm_device *dev = connector->dev;
1353-
struct ast_device *ast = to_ast_private(dev);
1353+
struct ast_device *ast = to_ast_device(dev);
13541354
struct edid *edid;
13551355
int count;
13561356

@@ -1456,7 +1456,7 @@ static int ast_sil164_connector_helper_get_modes(struct drm_connector *connector
14561456
{
14571457
struct ast_sil164_connector *ast_sil164_connector = to_ast_sil164_connector(connector);
14581458
struct drm_device *dev = connector->dev;
1459-
struct ast_device *ast = to_ast_private(dev);
1459+
struct ast_device *ast = to_ast_device(dev);
14601460
struct edid *edid;
14611461
int count;
14621462

@@ -1733,7 +1733,7 @@ static int ast_astdp_output_init(struct ast_device *ast)
17331733

17341734
static void ast_mode_config_helper_atomic_commit_tail(struct drm_atomic_state *state)
17351735
{
1736-
struct ast_device *ast = to_ast_private(state->dev);
1736+
struct ast_device *ast = to_ast_device(state->dev);
17371737

17381738
/*
17391739
* Concurrent operations could possibly trigger a call to
@@ -1754,7 +1754,7 @@ static enum drm_mode_status ast_mode_config_mode_valid(struct drm_device *dev,
17541754
const struct drm_display_mode *mode)
17551755
{
17561756
static const unsigned long max_bpp = 4; /* DRM_FORMAT_XRGB8888 */
1757-
struct ast_device *ast = to_ast_private(dev);
1757+
struct ast_device *ast = to_ast_device(dev);
17581758
unsigned long fbsize, fbpages, max_fbpages;
17591759

17601760
max_fbpages = (ast->vram_fb_available) >> PAGE_SHIFT;

0 commit comments

Comments
 (0)