staging: sm750fb: replace lynx_share with sm750_dev in lynxfb_par
authorMike Rapoport <mike.rapoport@gmail.com>
Mon, 26 Oct 2015 07:05:59 +0000 (09:05 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 27 Oct 2015 08:04:57 +0000 (17:04 +0900)
Use sm750_dev instead of lynx_share in the private data of the
frambuffer device.

Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/sm750fb/sm750.c
drivers/staging/sm750fb/sm750.h
drivers/staging/sm750fb/sm750_hw.c

index 46c236ee3fe8e189e7a88ee5223caf4aafd1562b..39ab614911cae6fdeaed2aeea6b002d32cd8bf38 100644 (file)
@@ -173,7 +173,7 @@ static void lynxfb_ops_fillrect(struct fb_info *info,
                return;
 
        par = info->par;
-       share = par->share;
+       share = &par->dev->share;
 
        /*
         * each time 2d function begin to work,below three variable always need
@@ -211,7 +211,7 @@ static void lynxfb_ops_copyarea(struct fb_info *info,
        unsigned int base, pitch, Bpp;
 
        par = info->par;
-       share = par->share;
+       share = &par->dev->share;
 
        /*
         * each time 2d function begin to work,below three variable always need
@@ -245,7 +245,7 @@ static void lynxfb_ops_imageblit(struct fb_info *info,
        struct lynx_share *share;
 
        par = info->par;
-       share = par->share;
+       share = &par->dev->share;
        /*
         * each time 2d function begin to work,below three variable always need
         * be set, seems we can put them together in some place
@@ -316,7 +316,7 @@ static int lynxfb_ops_set_par(struct fb_info *info)
 
        ret = 0;
        par = info->par;
-       share = par->share;
+       share = &par->dev->share;
        crtc = &par->crtc;
        output = &par->output;
        var = &info->var;
@@ -516,7 +516,7 @@ static int lynxfb_ops_check_var(struct fb_var_screeninfo *var,
        par = info->par;
        crtc = &par->crtc;
        output = &par->output;
-       share = par->share;
+       share = &par->dev->share;
 
        pr_debug("check var:%dx%d-%d\n",
                 var->xres,
@@ -652,8 +652,8 @@ static int sm750fb_set_drv(struct lynxfb_par *par)
 
        ret = 0;
 
-       share = par->share;
-       sm750_dev = container_of(share, struct sm750_dev, share);
+       sm750_dev = par->dev;
+       share = &sm750_dev->share;
        output = &par->output;
        crtc = &par->crtc;
 
@@ -762,7 +762,7 @@ static int lynxfb_set_fbinfo(struct fb_info *info, int index)
 
        ret = 0;
        par = (struct lynxfb_par *)info->par;
-       share = par->share;
+       share = &par->dev->share;
        crtc = &par->crtc;
        output = &par->output;
        var = &info->var;
@@ -1124,7 +1124,7 @@ ALLOC_FB:
                pr_info("framebuffer #%d alloc okay\n", fbidx);
                share->fbinfo[fbidx] = info[fbidx];
                par = info[fbidx]->par;
-               par->share = share;
+               par->dev = sm750_dev;
 
                /* set fb_info structure */
                if (lynxfb_set_fbinfo(info[fbidx], fbidx)) {
index 248fc3ae3b9383a74c74fe2f4eafe9969d4717c6..fde125905671b84782fd378006155ce8eaa0f5e2 100644 (file)
@@ -185,7 +185,7 @@ struct lynxfb_par {
        struct lynxfb_crtc crtc;
        struct lynxfb_output output;
        struct fb_info *info;
-       struct lynx_share *share;
+       struct sm750_dev *dev;
 };
 
 static inline unsigned long ps_to_hz(unsigned int psvalue)
index a952dadb9a4a52fd0fe82db40672654b418825cc..3ad82c2fe7dc9ff6d0c2649405568199e970e5e6 100644 (file)
@@ -234,9 +234,9 @@ int hw_sm750_output_setMode(struct lynxfb_output *output,
 int hw_sm750_crtc_checkMode(struct lynxfb_crtc *crtc, struct fb_var_screeninfo *var)
 {
        struct lynx_share *share;
+       struct lynxfb_par *par = container_of(crtc, struct lynxfb_par, crtc);
 
-
-       share = container_of(crtc, struct lynxfb_par, crtc)->share;
+       share = &par->dev->share;
 
        switch (var->bits_per_pixel) {
        case 8:
@@ -274,7 +274,7 @@ int hw_sm750_crtc_setMode(struct lynxfb_crtc *crtc,
 
        ret = 0;
        par = container_of(crtc, struct lynxfb_par, crtc);
-       share = par->share;
+       share = &par->dev->share;
 
        if (!share->accel_off) {
                /* set 2d engine pixel format according to mode bpp */