40
40
static void shmob_drm_crtc_setup_geometry (struct shmob_drm_crtc * scrtc )
41
41
{
42
42
struct drm_crtc * crtc = & scrtc -> crtc ;
43
- struct shmob_drm_device * sdev = crtc -> dev -> dev_private ;
43
+ struct shmob_drm_device * sdev = to_shmob_device ( crtc -> dev ) ;
44
44
const struct shmob_drm_interface_data * idata = & sdev -> pdata -> iface ;
45
45
const struct drm_display_mode * mode = & crtc -> mode ;
46
46
u32 value ;
@@ -79,7 +79,7 @@ static void shmob_drm_crtc_setup_geometry(struct shmob_drm_crtc *scrtc)
79
79
80
80
static void shmob_drm_crtc_start_stop (struct shmob_drm_crtc * scrtc , bool start )
81
81
{
82
- struct shmob_drm_device * sdev = scrtc -> crtc .dev -> dev_private ;
82
+ struct shmob_drm_device * sdev = to_shmob_device ( scrtc -> crtc .dev ) ;
83
83
u32 value ;
84
84
85
85
value = lcdc_read (sdev , LDCNT2R );
@@ -113,7 +113,7 @@ static void shmob_drm_crtc_start_stop(struct shmob_drm_crtc *scrtc, bool start)
113
113
static void shmob_drm_crtc_start (struct shmob_drm_crtc * scrtc )
114
114
{
115
115
struct drm_crtc * crtc = & scrtc -> crtc ;
116
- struct shmob_drm_device * sdev = crtc -> dev -> dev_private ;
116
+ struct shmob_drm_device * sdev = to_shmob_device ( crtc -> dev ) ;
117
117
const struct shmob_drm_interface_data * idata = & sdev -> pdata -> iface ;
118
118
const struct shmob_drm_format_info * format ;
119
119
struct drm_device * dev = & sdev -> ddev ;
@@ -193,7 +193,7 @@ static void shmob_drm_crtc_start(struct shmob_drm_crtc *scrtc)
193
193
static void shmob_drm_crtc_stop (struct shmob_drm_crtc * scrtc )
194
194
{
195
195
struct drm_crtc * crtc = & scrtc -> crtc ;
196
- struct shmob_drm_device * sdev = crtc -> dev -> dev_private ;
196
+ struct shmob_drm_device * sdev = to_shmob_device ( crtc -> dev ) ;
197
197
198
198
if (!scrtc -> started )
199
199
return ;
@@ -247,7 +247,7 @@ static void shmob_drm_crtc_compute_base(struct shmob_drm_crtc *scrtc,
247
247
static void shmob_drm_crtc_update_base (struct shmob_drm_crtc * scrtc )
248
248
{
249
249
struct drm_crtc * crtc = & scrtc -> crtc ;
250
- struct shmob_drm_device * sdev = crtc -> dev -> dev_private ;
250
+ struct shmob_drm_device * sdev = to_shmob_device ( crtc -> dev ) ;
251
251
252
252
shmob_drm_crtc_compute_base (scrtc , crtc -> x , crtc -> y );
253
253
@@ -289,8 +289,8 @@ static int shmob_drm_crtc_mode_set(struct drm_crtc *crtc,
289
289
int x , int y ,
290
290
struct drm_framebuffer * old_fb )
291
291
{
292
+ struct shmob_drm_device * sdev = to_shmob_device (crtc -> dev );
292
293
struct shmob_drm_crtc * scrtc = to_shmob_crtc (crtc );
293
- struct shmob_drm_device * sdev = crtc -> dev -> dev_private ;
294
294
const struct shmob_drm_format_info * format ;
295
295
296
296
format = shmob_drm_format_info (crtc -> primary -> fb -> format -> format );
@@ -395,7 +395,7 @@ static void shmob_drm_crtc_enable_vblank(struct shmob_drm_device *sdev,
395
395
396
396
static int shmob_drm_enable_vblank (struct drm_crtc * crtc )
397
397
{
398
- struct shmob_drm_device * sdev = crtc -> dev -> dev_private ;
398
+ struct shmob_drm_device * sdev = to_shmob_device ( crtc -> dev ) ;
399
399
400
400
shmob_drm_crtc_enable_vblank (sdev , true);
401
401
@@ -404,7 +404,7 @@ static int shmob_drm_enable_vblank(struct drm_crtc *crtc)
404
404
405
405
static void shmob_drm_disable_vblank (struct drm_crtc * crtc )
406
406
{
407
- struct shmob_drm_device * sdev = crtc -> dev -> dev_private ;
407
+ struct shmob_drm_device * sdev = to_shmob_device ( crtc -> dev ) ;
408
408
409
409
shmob_drm_crtc_enable_vblank (sdev , false);
410
410
}
@@ -478,7 +478,7 @@ static bool shmob_drm_encoder_mode_fixup(struct drm_encoder *encoder,
478
478
struct drm_display_mode * adjusted_mode )
479
479
{
480
480
struct drm_device * dev = encoder -> dev ;
481
- struct shmob_drm_device * sdev = dev -> dev_private ;
481
+ struct shmob_drm_device * sdev = to_shmob_device ( dev ) ;
482
482
struct drm_connector * connector = & sdev -> connector .connector ;
483
483
const struct drm_display_mode * panel_mode ;
484
484
@@ -548,7 +548,7 @@ static inline struct shmob_drm_connector *to_shmob_connector(struct drm_connecto
548
548
549
549
static int shmob_drm_connector_get_modes (struct drm_connector * connector )
550
550
{
551
- struct shmob_drm_device * sdev = connector -> dev -> dev_private ;
551
+ struct shmob_drm_device * sdev = to_shmob_device ( connector -> dev ) ;
552
552
struct drm_display_mode * mode ;
553
553
554
554
mode = drm_mode_create (connector -> dev );
0 commit comments