[PATCH 10/19] staging: sm750fb: replace lynx_share with sm750_dev in lynxfb_par

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Use sm750_dev instead of lynx_share in the private data of the
frambuffer device.

Signed-off-by: Mike Rapoport <mike.rapoport@xxxxxxxxx>
---
 drivers/staging/sm750fb/sm750.c    | 18 +++++++++---------
 drivers/staging/sm750fb/sm750.h    |  2 +-
 drivers/staging/sm750fb/sm750_hw.c |  6 +++---
 3 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/drivers/staging/sm750fb/sm750.c b/drivers/staging/sm750fb/sm750.c
index 46c236e..39ab614 100644
--- a/drivers/staging/sm750fb/sm750.c
+++ b/drivers/staging/sm750fb/sm750.c
@@ -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)) {
diff --git a/drivers/staging/sm750fb/sm750.h b/drivers/staging/sm750fb/sm750.h
index 248fc3a..fde1259 100644
--- a/drivers/staging/sm750fb/sm750.h
+++ b/drivers/staging/sm750fb/sm750.h
@@ -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)
diff --git a/drivers/staging/sm750fb/sm750_hw.c b/drivers/staging/sm750fb/sm750_hw.c
index a952dad..3ad82c2 100644
--- a/drivers/staging/sm750fb/sm750_hw.c
+++ b/drivers/staging/sm750fb/sm750_hw.c
@@ -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 */
-- 
2.1.0

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux