]> git.itanic.dy.fi Git - linux-stable/commitdiff
drm/udl: introduce a macro to convert dev to udl.
authorDave Airlie <airlied@redhat.com>
Mon, 15 Jul 2019 18:05:56 +0000 (12:05 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 21 Jul 2019 07:03:17 +0000 (09:03 +0200)
commit fd96e0dba19c53c2d66f2a398716bb74df8ca85e upstream.

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
Signed-off-by: Ross Zwisler <zwisler@google.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/udl/udl_drv.h
drivers/gpu/drm/udl/udl_fb.c
drivers/gpu/drm/udl/udl_gem.c
drivers/gpu/drm/udl/udl_main.c

index 4ae67d882eae928e6b39fb4f240a46bfc272ed15..b3e08e876d622f5992619bef706b0755bb4c2beb 100644 (file)
@@ -71,6 +71,8 @@ struct udl_device {
        atomic_t cpu_kcycles_used; /* transpired during pixel processing */
 };
 
+#define to_udl(x) ((x)->dev_private)
+
 struct udl_gem_object {
        struct drm_gem_object base;
        struct page **pages;
index dd9ffded223b5fb09c025d518d5090b27716b560..590323ea261fbd5b952a968f9fbdd6ef84bb3353 100644 (file)
@@ -82,7 +82,7 @@ int udl_handle_damage(struct udl_framebuffer *fb, int x, int y,
                      int width, int height)
 {
        struct drm_device *dev = fb->base.dev;
-       struct udl_device *udl = dev->dev_private;
+       struct udl_device *udl = to_udl(dev);
        int i, ret;
        char *cmd;
        cycles_t start_cycles, end_cycles;
@@ -210,7 +210,7 @@ static int udl_fb_open(struct fb_info *info, int user)
 {
        struct udl_fbdev *ufbdev = info->par;
        struct drm_device *dev = ufbdev->ufb.base.dev;
-       struct udl_device *udl = dev->dev_private;
+       struct udl_device *udl = to_udl(dev);
 
        /* If the USB device is gone, we don't accept new opens */
        if (drm_dev_is_unplugged(udl->ddev))
@@ -441,7 +441,7 @@ static void udl_fbdev_destroy(struct drm_device *dev,
 
 int udl_fbdev_init(struct drm_device *dev)
 {
-       struct udl_device *udl = dev->dev_private;
+       struct udl_device *udl = to_udl(dev);
        int bpp_sel = fb_bpp;
        struct udl_fbdev *ufbdev;
        int ret;
@@ -480,7 +480,7 @@ int udl_fbdev_init(struct drm_device *dev)
 
 void udl_fbdev_cleanup(struct drm_device *dev)
 {
-       struct udl_device *udl = dev->dev_private;
+       struct udl_device *udl = to_udl(dev);
        if (!udl->fbdev)
                return;
 
@@ -491,7 +491,7 @@ void udl_fbdev_cleanup(struct drm_device *dev)
 
 void udl_fbdev_unplug(struct drm_device *dev)
 {
-       struct udl_device *udl = dev->dev_private;
+       struct udl_device *udl = to_udl(dev);
        struct udl_fbdev *ufbdev;
        if (!udl->fbdev)
                return;
index bb7b58407039bbbb099a371b9a432dc12983f886..3b3e17652bb20f341e68fb33302c8635a8db18c9 100644 (file)
@@ -203,7 +203,7 @@ int udl_gem_mmap(struct drm_file *file, struct drm_device *dev,
 {
        struct udl_gem_object *gobj;
        struct drm_gem_object *obj;
-       struct udl_device *udl = dev->dev_private;
+       struct udl_device *udl = to_udl(dev);
        int ret = 0;
 
        mutex_lock(&udl->gem_lock);
index 19055dda31409d0d1bcc50084a37b4caf5fc7b85..09ce98113c0eba22ac761b67987b5cc43730a27e 100644 (file)
@@ -29,7 +29,7 @@
 static int udl_parse_vendor_descriptor(struct drm_device *dev,
                                       struct usb_device *usbdev)
 {
-       struct udl_device *udl = dev->dev_private;
+       struct udl_device *udl = to_udl(dev);
        char *desc;
        char *buf;
        char *desc_end;
@@ -165,7 +165,7 @@ void udl_urb_completion(struct urb *urb)
 
 static void udl_free_urb_list(struct drm_device *dev)
 {
-       struct udl_device *udl = dev->dev_private;
+       struct udl_device *udl = to_udl(dev);
        int count = udl->urbs.count;
        struct list_head *node;
        struct urb_node *unode;
@@ -198,7 +198,7 @@ static void udl_free_urb_list(struct drm_device *dev)
 
 static int udl_alloc_urb_list(struct drm_device *dev, int count, size_t size)
 {
-       struct udl_device *udl = dev->dev_private;
+       struct udl_device *udl = to_udl(dev);
        struct urb *urb;
        struct urb_node *unode;
        char *buf;
@@ -262,7 +262,7 @@ static int udl_alloc_urb_list(struct drm_device *dev, int count, size_t size)
 
 struct urb *udl_get_urb(struct drm_device *dev)
 {
-       struct udl_device *udl = dev->dev_private;
+       struct udl_device *udl = to_udl(dev);
        int ret = 0;
        struct list_head *entry;
        struct urb_node *unode;
@@ -295,7 +295,7 @@ struct urb *udl_get_urb(struct drm_device *dev)
 
 int udl_submit_urb(struct drm_device *dev, struct urb *urb, size_t len)
 {
-       struct udl_device *udl = dev->dev_private;
+       struct udl_device *udl = to_udl(dev);
        int ret;
 
        BUG_ON(len > udl->urbs.size);
@@ -370,7 +370,7 @@ int udl_drop_usb(struct drm_device *dev)
 
 void udl_driver_unload(struct drm_device *dev)
 {
-       struct udl_device *udl = dev->dev_private;
+       struct udl_device *udl = to_udl(dev);
 
        drm_kms_helper_poll_fini(dev);