summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/mgag200/mgag200_mode.c
diff options
context:
space:
mode:
authorThomas Zimmermann <tzimmermann@suse.de>2020-06-05 15:58:02 +0200
committerThomas Zimmermann <tzimmermann@suse.de>2020-06-11 10:06:10 +0200
commit832eddf5d8f4d83983b7674faa009b2a5ead1848 (patch)
treee16c3df1f7ceb8729a4c6a55698815889c7b97f2 /drivers/gpu/drm/mgag200/mgag200_mode.c
parent3c8923c3f15e1c7f84b804f218500febf46868a3 (diff)
downloadlinux-832eddf5d8f4d83983b7674faa009b2a5ead1848.tar.bz2
drm/mgag200: Embed instance of struct drm_device in struct mga_device
Following current best practice, the instance of struct drm_device is now embedded in struct mga_device. The respective field has been renamed from 'dev' to 'base' to reflect the relationship. Conversion from DRM device is done via upcast. Using dev_private is no longer possible. The patch also open-codes drm_dev_alloc() and DRM device initialization is now performed by a call to drm_device_init(). Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Acked-by: Sam Ravnborg <sam@ravnborg.org> Link: https://patchwork.freedesktop.org/patch/msgid/20200605135803.19811-14-tzimmermann@suse.de
Diffstat (limited to 'drivers/gpu/drm/mgag200/mgag200_mode.c')
-rw-r--r--drivers/gpu/drm/mgag200/mgag200_mode.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/gpu/drm/mgag200/mgag200_mode.c b/drivers/gpu/drm/mgag200/mgag200_mode.c
index 0155d4eb5fa6..f16bd278ab7e 100644
--- a/drivers/gpu/drm/mgag200/mgag200_mode.c
+++ b/drivers/gpu/drm/mgag200/mgag200_mode.c
@@ -854,7 +854,7 @@ static void mga_g200wb_commit(struct drm_crtc *crtc)
static void mgag200_set_startadd(struct mga_device *mdev,
unsigned long offset)
{
- struct drm_device *dev = mdev->dev;
+ struct drm_device *dev = &mdev->base;
u32 startadd;
u8 crtcc, crtcd, crtcext0;
@@ -882,7 +882,7 @@ static void mgag200_set_startadd(struct mga_device *mdev,
static void mgag200_set_pci_regs(struct mga_device *mdev)
{
uint32_t option = 0, option2 = 0;
- struct drm_device *dev = mdev->dev;
+ struct drm_device *dev = &mdev->base;
switch (mdev->type) {
case G200_SE_A:
@@ -1153,7 +1153,7 @@ static void mgag200_set_offset(struct mga_device *mdev,
static void mgag200_set_format_regs(struct mga_device *mdev,
const struct drm_framebuffer *fb)
{
- struct drm_device *dev = mdev->dev;
+ struct drm_device *dev = &mdev->base;
const struct drm_format_info *format = fb->format;
unsigned int bpp, bppshift, scale;
u8 crtcext3, xmulctrl;
@@ -1537,7 +1537,7 @@ static const struct drm_connector_funcs mga_vga_connector_funcs = {
static int mgag200_vga_connector_init(struct mga_device *mdev)
{
- struct drm_device *dev = mdev->dev;
+ struct drm_device *dev = &mdev->base;
struct mga_connector *mconnector = &mdev->connector;
struct drm_connector *connector = &mconnector->base;
struct mga_i2c_chan *i2c;
@@ -1579,7 +1579,7 @@ static void
mgag200_handle_damage(struct mga_device *mdev, struct drm_framebuffer *fb,
struct drm_rect *clip)
{
- struct drm_device *dev = mdev->dev;
+ struct drm_device *dev = &mdev->base;
void *vmap;
vmap = drm_gem_shmem_vmap(fb->obj[0]);
@@ -1718,7 +1718,7 @@ static unsigned int mgag200_preferred_depth(struct mga_device *mdev)
int mgag200_modeset_init(struct mga_device *mdev)
{
- struct drm_device *dev = mdev->dev;
+ struct drm_device *dev = &mdev->base;
struct drm_connector *connector = &mdev->connector.base;
struct drm_simple_display_pipe *pipe = &mdev->display_pipe;
size_t format_count = ARRAY_SIZE(mgag200_simple_display_pipe_formats);