diff options
author | Thomas Zimmermann <tzimmermann@suse.de> | 2020-05-07 12:03:10 +0300 |
---|---|---|
committer | Thomas Zimmermann <tzimmermann@suse.de> | 2020-05-11 17:39:45 +0300 |
commit | 8d8ff2a9574e1a822cadf1c346a130f922ae546a (patch) | |
tree | cc1dfeea35e6fc2d4ab77a7bfc972764866eea41 /drivers/gpu/drm/mgag200/mgag200_mode.c | |
parent | 6e85bd73d50d674912618e3ed226b2f2a47a178a (diff) | |
download | linux-8d8ff2a9574e1a822cadf1c346a130f922ae546a.tar.xz |
drm/mgag200: Convert struct drm_device to struct mga_device with helper
Mgag200 uses dev_private to look up struct mga_device for instances
of struct drm_device. Use of dev_private is deprecated, so hide it in
the helper function to_mga_device().
v2:
* make to_mga_device() a function (Sam)
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20200507090315.21274-2-tzimmermann@suse.de
Diffstat (limited to 'drivers/gpu/drm/mgag200/mgag200_mode.c')
-rw-r--r-- | drivers/gpu/drm/mgag200/mgag200_mode.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/gpu/drm/mgag200/mgag200_mode.c b/drivers/gpu/drm/mgag200/mgag200_mode.c index d90e83959fca..fa91869c0db5 100644 --- a/drivers/gpu/drm/mgag200/mgag200_mode.c +++ b/drivers/gpu/drm/mgag200/mgag200_mode.c @@ -28,7 +28,7 @@ static void mga_crtc_load_lut(struct drm_crtc *crtc) { struct drm_device *dev = crtc->dev; - struct mga_device *mdev = dev->dev_private; + struct mga_device *mdev = to_mga_device(dev); struct drm_framebuffer *fb = crtc->primary->fb; u16 *r_ptr, *g_ptr, *b_ptr; int i; @@ -728,7 +728,7 @@ static int mga_crtc_set_plls(struct mga_device *mdev, long clock) static void mga_g200wb_prepare(struct drm_crtc *crtc) { - struct mga_device *mdev = crtc->dev->dev_private; + struct mga_device *mdev = to_mga_device(crtc->dev); u8 tmp; int iter_max; @@ -783,7 +783,7 @@ static void mga_g200wb_prepare(struct drm_crtc *crtc) static void mga_g200wb_commit(struct drm_crtc *crtc) { u8 tmp; - struct mga_device *mdev = crtc->dev->dev_private; + struct mga_device *mdev = to_mga_device(crtc->dev); /* 1- The first step is to ensure that the vrsten and hrsten are set */ WREG8(MGAREG_CRTCEXT_INDEX, 1); @@ -833,7 +833,7 @@ static void mga_g200wb_commit(struct drm_crtc *crtc) */ static void mga_set_start_address(struct drm_crtc *crtc, unsigned offset) { - struct mga_device *mdev = crtc->dev->dev_private; + struct mga_device *mdev = to_mga_device(crtc->dev); u32 addr; int count; u8 crtcext0; @@ -902,7 +902,7 @@ static int mga_crtc_mode_set(struct drm_crtc *crtc, int x, int y, struct drm_framebuffer *old_fb) { struct drm_device *dev = crtc->dev; - struct mga_device *mdev = dev->dev_private; + struct mga_device *mdev = to_mga_device(dev); const struct drm_framebuffer *fb = crtc->primary->fb; int hdisplay, hsyncstart, hsyncend, htotal; int vdisplay, vsyncstart, vsyncend, vtotal; @@ -1263,7 +1263,7 @@ static int mga_resume(struct drm_crtc *crtc) static void mga_crtc_dpms(struct drm_crtc *crtc, int mode) { struct drm_device *dev = crtc->dev; - struct mga_device *mdev = dev->dev_private; + struct mga_device *mdev = to_mga_device(dev); u8 seq1 = 0, crtcext1 = 0; switch (mode) { @@ -1317,7 +1317,7 @@ static void mga_crtc_dpms(struct drm_crtc *crtc, int mode) static void mga_crtc_prepare(struct drm_crtc *crtc) { struct drm_device *dev = crtc->dev; - struct mga_device *mdev = dev->dev_private; + struct mga_device *mdev = to_mga_device(dev); u8 tmp; /* mga_resume(crtc);*/ @@ -1353,7 +1353,7 @@ static void mga_crtc_prepare(struct drm_crtc *crtc) static void mga_crtc_commit(struct drm_crtc *crtc) { struct drm_device *dev = crtc->dev; - struct mga_device *mdev = dev->dev_private; + struct mga_device *mdev = to_mga_device(dev); const struct drm_crtc_helper_funcs *crtc_funcs = crtc->helper_private; u8 tmp; @@ -1495,7 +1495,7 @@ static enum drm_mode_status mga_vga_mode_valid(struct drm_connector *connector, struct drm_display_mode *mode) { struct drm_device *dev = connector->dev; - struct mga_device *mdev = (struct mga_device*)dev->dev_private; + struct mga_device *mdev = to_mga_device(dev); int bpp = 32; if (IS_G200_SE(mdev)) { |