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

drm/udl: introduce a macro to convert dev to udl.

This just makes it easier to later embed drm into udl.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190405031715.5959-3-airlied@gmail.com

+14 -12
+2
drivers/gpu/drm/udl/udl_drv.h
··· 71 71 atomic_t cpu_kcycles_used; /* transpired during pixel processing */ 72 72 }; 73 73 74 + #define to_udl(x) ((x)->dev_private) 75 + 74 76 struct udl_gem_object { 75 77 struct drm_gem_object base; 76 78 struct page **pages;
+5 -5
drivers/gpu/drm/udl/udl_fb.c
··· 82 82 int width, int height) 83 83 { 84 84 struct drm_device *dev = fb->base.dev; 85 - struct udl_device *udl = dev->dev_private; 85 + struct udl_device *udl = to_udl(dev); 86 86 int i, ret; 87 87 char *cmd; 88 88 cycles_t start_cycles, end_cycles; ··· 210 210 { 211 211 struct udl_fbdev *ufbdev = info->par; 212 212 struct drm_device *dev = ufbdev->ufb.base.dev; 213 - struct udl_device *udl = dev->dev_private; 213 + struct udl_device *udl = to_udl(dev); 214 214 215 215 /* If the USB device is gone, we don't accept new opens */ 216 216 if (drm_dev_is_unplugged(udl->ddev)) ··· 437 437 438 438 int udl_fbdev_init(struct drm_device *dev) 439 439 { 440 - struct udl_device *udl = dev->dev_private; 440 + struct udl_device *udl = to_udl(dev); 441 441 int bpp_sel = fb_bpp; 442 442 struct udl_fbdev *ufbdev; 443 443 int ret; ··· 476 476 477 477 void udl_fbdev_cleanup(struct drm_device *dev) 478 478 { 479 - struct udl_device *udl = dev->dev_private; 479 + struct udl_device *udl = to_udl(dev); 480 480 if (!udl->fbdev) 481 481 return; 482 482 ··· 487 487 488 488 void udl_fbdev_unplug(struct drm_device *dev) 489 489 { 490 - struct udl_device *udl = dev->dev_private; 490 + struct udl_device *udl = to_udl(dev); 491 491 struct udl_fbdev *ufbdev; 492 492 if (!udl->fbdev) 493 493 return;
+1 -1
drivers/gpu/drm/udl/udl_gem.c
··· 203 203 { 204 204 struct udl_gem_object *gobj; 205 205 struct drm_gem_object *obj; 206 - struct udl_device *udl = dev->dev_private; 206 + struct udl_device *udl = to_udl(dev); 207 207 int ret = 0; 208 208 209 209 mutex_lock(&udl->gem_lock);
+6 -6
drivers/gpu/drm/udl/udl_main.c
··· 30 30 static int udl_parse_vendor_descriptor(struct drm_device *dev, 31 31 struct usb_device *usbdev) 32 32 { 33 - struct udl_device *udl = dev->dev_private; 33 + struct udl_device *udl = to_udl(dev); 34 34 char *desc; 35 35 char *buf; 36 36 char *desc_end; ··· 166 166 167 167 static void udl_free_urb_list(struct drm_device *dev) 168 168 { 169 - struct udl_device *udl = dev->dev_private; 169 + struct udl_device *udl = to_udl(dev); 170 170 int count = udl->urbs.count; 171 171 struct list_head *node; 172 172 struct urb_node *unode; ··· 199 199 200 200 static int udl_alloc_urb_list(struct drm_device *dev, int count, size_t size) 201 201 { 202 - struct udl_device *udl = dev->dev_private; 202 + struct udl_device *udl = to_udl(dev); 203 203 struct urb *urb; 204 204 struct urb_node *unode; 205 205 char *buf; ··· 263 263 264 264 struct urb *udl_get_urb(struct drm_device *dev) 265 265 { 266 - struct udl_device *udl = dev->dev_private; 266 + struct udl_device *udl = to_udl(dev); 267 267 int ret = 0; 268 268 struct list_head *entry; 269 269 struct urb_node *unode; ··· 296 296 297 297 int udl_submit_urb(struct drm_device *dev, struct urb *urb, size_t len) 298 298 { 299 - struct udl_device *udl = dev->dev_private; 299 + struct udl_device *udl = to_udl(dev); 300 300 int ret; 301 301 302 302 BUG_ON(len > udl->urbs.size); ··· 371 371 372 372 void udl_driver_unload(struct drm_device *dev) 373 373 { 374 - struct udl_device *udl = dev->dev_private; 374 + struct udl_device *udl = to_udl(dev); 375 375 376 376 drm_kms_helper_poll_fini(dev); 377 377