@@ -92,6 +92,11 @@ struct bochs_device {
92
92
struct drm_connector connector ;
93
93
};
94
94
95
+ static struct bochs_device * to_bochs_device (const struct drm_device * dev )
96
+ {
97
+ return (struct bochs_device * )dev -> dev_private ;
98
+ }
99
+
95
100
/* ---------------------------------------------------------------------- */
96
101
97
102
static void bochs_vga_writeb (struct bochs_device * bochs , u16 ioport , u8 val )
@@ -191,7 +196,7 @@ static int bochs_get_edid_block(void *data, u8 *buf, unsigned int block, size_t
191
196
static const struct drm_edid * bochs_hw_read_edid (struct drm_connector * connector )
192
197
{
193
198
struct drm_device * dev = connector -> dev ;
194
- struct bochs_device * bochs = dev -> dev_private ;
199
+ struct bochs_device * bochs = to_bochs_device ( dev ) ;
195
200
u8 header [8 ];
196
201
197
202
/* check header to detect whenever edid support is enabled in qemu */
@@ -420,23 +425,23 @@ static void bochs_pipe_enable(struct drm_simple_display_pipe *pipe,
420
425
struct drm_crtc_state * crtc_state ,
421
426
struct drm_plane_state * plane_state )
422
427
{
423
- struct bochs_device * bochs = pipe -> crtc .dev -> dev_private ;
428
+ struct bochs_device * bochs = to_bochs_device ( pipe -> crtc .dev ) ;
424
429
425
430
bochs_hw_setmode (bochs , & crtc_state -> mode );
426
431
bochs_plane_update (bochs , plane_state );
427
432
}
428
433
429
434
static void bochs_pipe_disable (struct drm_simple_display_pipe * pipe )
430
435
{
431
- struct bochs_device * bochs = pipe -> crtc .dev -> dev_private ;
436
+ struct bochs_device * bochs = to_bochs_device ( pipe -> crtc .dev ) ;
432
437
433
438
bochs_hw_blank (bochs , true);
434
439
}
435
440
436
441
static void bochs_pipe_update (struct drm_simple_display_pipe * pipe ,
437
442
struct drm_plane_state * old_state )
438
443
{
439
- struct bochs_device * bochs = pipe -> crtc .dev -> dev_private ;
444
+ struct bochs_device * bochs = to_bochs_device ( pipe -> crtc .dev ) ;
440
445
441
446
bochs_plane_update (bochs , pipe -> plane .state );
442
447
}
0 commit comments