Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/vboxvideo: Stop using drm_device->dev_private

We use the baseclass pattern here, so lets to the proper (and more
typesafe) upcasting.

Acked-by: Sam Ravnborg <sam@ravnborg.org>
Acked-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Cc: Hans de Goede <hdegoede@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200415074034.175360-5-daniel.vetter@ffwll.ch

+7 -7
-1
drivers/gpu/drm/vboxvideo/vbox_drv.c
··· 52 52 return PTR_ERR(vbox); 53 53 54 54 vbox->ddev.pdev = pdev; 55 - vbox->ddev.dev_private = vbox; 56 55 pci_set_drvdata(pdev, vbox); 57 56 mutex_init(&vbox->hw_mutex); 58 57
+1
drivers/gpu/drm/vboxvideo/vbox_drv.h
··· 127 127 #define to_vbox_crtc(x) container_of(x, struct vbox_crtc, base) 128 128 #define to_vbox_connector(x) container_of(x, struct vbox_connector, base) 129 129 #define to_vbox_encoder(x) container_of(x, struct vbox_encoder, base) 130 + #define to_vbox_dev(x) container_of(x, struct vbox_private, ddev) 130 131 131 132 bool vbox_check_supported(u16 id); 132 133 int vbox_hw_init(struct vbox_private *vbox);
+1 -1
drivers/gpu/drm/vboxvideo/vbox_irq.c
··· 34 34 irqreturn_t vbox_irq_handler(int irq, void *arg) 35 35 { 36 36 struct drm_device *dev = (struct drm_device *)arg; 37 - struct vbox_private *vbox = (struct vbox_private *)dev->dev_private; 37 + struct vbox_private *vbox = to_vbox_dev(dev); 38 38 u32 host_flags = vbox_get_flags(vbox); 39 39 40 40 if (!(host_flags & HGSMIHOSTFLAGS_IRQ))
+5 -5
drivers/gpu/drm/vboxvideo/vbox_mode.c
··· 36 36 u16 flags; 37 37 s32 x_offset, y_offset; 38 38 39 - vbox = crtc->dev->dev_private; 39 + vbox = to_vbox_dev(crtc->dev); 40 40 width = vbox_crtc->width ? vbox_crtc->width : 640; 41 41 height = vbox_crtc->height ? vbox_crtc->height : 480; 42 42 bpp = fb ? fb->format->cpp[0] * 8 : 32; ··· 77 77 static int vbox_set_view(struct drm_crtc *crtc) 78 78 { 79 79 struct vbox_crtc *vbox_crtc = to_vbox_crtc(crtc); 80 - struct vbox_private *vbox = crtc->dev->dev_private; 80 + struct vbox_private *vbox = to_vbox_dev(crtc->dev); 81 81 struct vbva_infoview *p; 82 82 83 83 /* ··· 174 174 int x, int y) 175 175 { 176 176 struct drm_gem_vram_object *gbo = drm_gem_vram_of_gem(fb->obj[0]); 177 - struct vbox_private *vbox = crtc->dev->dev_private; 177 + struct vbox_private *vbox = to_vbox_dev(crtc->dev); 178 178 struct vbox_crtc *vbox_crtc = to_vbox_crtc(crtc); 179 179 bool needs_modeset = drm_atomic_crtc_needs_modeset(crtc->state); 180 180 ··· 272 272 { 273 273 struct drm_crtc *crtc = plane->state->crtc; 274 274 struct drm_framebuffer *fb = plane->state->fb; 275 - struct vbox_private *vbox = fb->dev->dev_private; 275 + struct vbox_private *vbox = to_vbox_dev(fb->dev); 276 276 struct drm_mode_rect *clips; 277 277 uint32_t num_clips, i; 278 278 ··· 704 704 int preferred_width, preferred_height; 705 705 706 706 vbox_connector = to_vbox_connector(connector); 707 - vbox = connector->dev->dev_private; 707 + vbox = to_vbox_dev(connector->dev); 708 708 709 709 hgsmi_report_flags_location(vbox->guest_pool, GUEST_HEAP_OFFSET(vbox) + 710 710 HOST_FLAGS_OFFSET);