From 4b6dc179dcf8e6fa023fb38a0b4fc456b90186f5 Mon Sep 17 00:00:00 2001 From: Lars Svensson Date: Wed, 7 Oct 2015 09:20:13 +0200 Subject: [PATCH] staging: fbtft: use alternate screen pointer Member screen_base in struct fb_info is declared with __iomem qualifier causing sparse warnings when used as a regular ponter. To avoid the warnings, instead use alternate non-__iomem pointer, screen_buffer, troughout the driver. Signed-off-by: Lars Svensson Signed-off-by: Greg Kroah-Hartman --- drivers/staging/fbtft/fb_agm1264k-fl.c | 2 +- drivers/staging/fbtft/fb_pcd8544.c | 2 +- drivers/staging/fbtft/fb_ra8875.c | 2 +- drivers/staging/fbtft/fb_ssd1306.c | 2 +- drivers/staging/fbtft/fb_tls8204.c | 2 +- drivers/staging/fbtft/fb_uc1611.c | 2 +- drivers/staging/fbtft/fb_uc1701.c | 2 +- drivers/staging/fbtft/fb_watterott.c | 4 ++-- drivers/staging/fbtft/fbtft-bus.c | 6 +++--- drivers/staging/fbtft/fbtft-core.c | 4 ++-- 10 files changed, 14 insertions(+), 14 deletions(-) diff --git a/drivers/staging/fbtft/fb_agm1264k-fl.c b/drivers/staging/fbtft/fb_agm1264k-fl.c index 88718f61eb5b..19f6136eb310 100644 --- a/drivers/staging/fbtft/fb_agm1264k-fl.c +++ b/drivers/staging/fbtft/fb_agm1264k-fl.c @@ -266,7 +266,7 @@ construct_line_bitmap(struct fbtft_par *par, u8 *dest, signed short *src, static int write_vmem(struct fbtft_par *par, size_t offset, size_t len) { - u16 *vmem16 = (u16 *)par->info->screen_base; + u16 *vmem16 = (u16 *)par->info->screen_buffer; u8 *buf = par->txbuf.buf; int x, y; int ret = 0; diff --git a/drivers/staging/fbtft/fb_pcd8544.c b/drivers/staging/fbtft/fb_pcd8544.c index 8b52523fdc9e..a6b43323f29a 100644 --- a/drivers/staging/fbtft/fb_pcd8544.c +++ b/drivers/staging/fbtft/fb_pcd8544.c @@ -112,7 +112,7 @@ static void set_addr_win(struct fbtft_par *par, int xs, int ys, int xe, int ye) static int write_vmem(struct fbtft_par *par, size_t offset, size_t len) { - u16 *vmem16 = (u16 *)par->info->screen_base; + u16 *vmem16 = (u16 *)par->info->screen_buffer; u8 *buf = par->txbuf.buf; int x, y, i; int ret = 0; diff --git a/drivers/staging/fbtft/fb_ra8875.c b/drivers/staging/fbtft/fb_ra8875.c index 5c1d93d425d0..86e43e158c61 100644 --- a/drivers/staging/fbtft/fb_ra8875.c +++ b/drivers/staging/fbtft/fb_ra8875.c @@ -269,7 +269,7 @@ static int write_vmem16_bus8(struct fbtft_par *par, size_t offset, size_t len) __func__, offset, len); remain = len / 2; - vmem16 = (u16 *)(par->info->screen_base + offset); + vmem16 = (u16 *)(par->info->screen_buffer + offset); tx_array_size = par->txbuf.len / 2; txbuf16 = (u16 *)(par->txbuf.buf + 1); tx_array_size -= 2; diff --git a/drivers/staging/fbtft/fb_ssd1306.c b/drivers/staging/fbtft/fb_ssd1306.c index 568b4334c9d9..e0b34a42c9c6 100644 --- a/drivers/staging/fbtft/fb_ssd1306.c +++ b/drivers/staging/fbtft/fb_ssd1306.c @@ -160,7 +160,7 @@ static int set_gamma(struct fbtft_par *par, unsigned long *curves) static int write_vmem(struct fbtft_par *par, size_t offset, size_t len) { - u16 *vmem16 = (u16 *)par->info->screen_base; + u16 *vmem16 = (u16 *)par->info->screen_buffer; u8 *buf = par->txbuf.buf; int x, y, i; int ret = 0; diff --git a/drivers/staging/fbtft/fb_tls8204.c b/drivers/staging/fbtft/fb_tls8204.c index d609f875bcb1..2183f98c8315 100644 --- a/drivers/staging/fbtft/fb_tls8204.c +++ b/drivers/staging/fbtft/fb_tls8204.c @@ -94,7 +94,7 @@ static void set_addr_win(struct fbtft_par *par, int xs, int ys, int xe, int ye) static int write_vmem(struct fbtft_par *par, size_t offset, size_t len) { - u16 *vmem16 = (u16 *)par->info->screen_base; + u16 *vmem16 = (u16 *)par->info->screen_buffer; int x, y, i; int ret = 0; diff --git a/drivers/staging/fbtft/fb_uc1611.c b/drivers/staging/fbtft/fb_uc1611.c index a72f920ca1d7..4e828142058e 100644 --- a/drivers/staging/fbtft/fb_uc1611.c +++ b/drivers/staging/fbtft/fb_uc1611.c @@ -221,7 +221,7 @@ static int set_var(struct fbtft_par *par) static int write_vmem(struct fbtft_par *par, size_t offset, size_t len) { - u8 *vmem8 = (u8 *)(par->info->screen_base); + u8 *vmem8 = (u8 *)(par->info->screen_buffer); u8 *buf8 = (u8 *)(par->txbuf.buf); u16 *buf16 = (u16 *)(par->txbuf.buf); int line_length = par->info->fix.line_length; diff --git a/drivers/staging/fbtft/fb_uc1701.c b/drivers/staging/fbtft/fb_uc1701.c index 28aa1008b297..212908e39277 100644 --- a/drivers/staging/fbtft/fb_uc1701.c +++ b/drivers/staging/fbtft/fb_uc1701.c @@ -141,7 +141,7 @@ static void set_addr_win(struct fbtft_par *par, int xs, int ys, int xe, int ye) static int write_vmem(struct fbtft_par *par, size_t offset, size_t len) { - u16 *vmem16 = (u16 *)par->info->screen_base; + u16 *vmem16 = (u16 *)par->info->screen_buffer; u8 *buf = par->txbuf.buf; int x, y, i; int ret = 0; diff --git a/drivers/staging/fbtft/fb_watterott.c b/drivers/staging/fbtft/fb_watterott.c index be99a9d76316..f8cb610a7b69 100644 --- a/drivers/staging/fbtft/fb_watterott.c +++ b/drivers/staging/fbtft/fb_watterott.c @@ -68,7 +68,7 @@ static void write_reg8_bus8(struct fbtft_par *par, int len, ...) static int write_vmem(struct fbtft_par *par, size_t offset, size_t len) { unsigned start_line, end_line; - u16 *vmem16 = (u16 *)(par->info->screen_base + offset); + u16 *vmem16 = (u16 *)(par->info->screen_buffer + offset); u16 *pos = par->txbuf.buf + 1; u16 *buf16 = par->txbuf.buf + 10; int i, j; @@ -105,7 +105,7 @@ static int write_vmem(struct fbtft_par *par, size_t offset, size_t len) static int write_vmem_8bit(struct fbtft_par *par, size_t offset, size_t len) { unsigned start_line, end_line; - u16 *vmem16 = (u16 *)(par->info->screen_base + offset); + u16 *vmem16 = (u16 *)(par->info->screen_buffer + offset); u16 *pos = par->txbuf.buf + 1; u8 *buf8 = par->txbuf.buf + 10; int i, j; diff --git a/drivers/staging/fbtft/fbtft-bus.c b/drivers/staging/fbtft/fbtft-bus.c index 97129241cab9..9a95fde194d5 100644 --- a/drivers/staging/fbtft/fbtft-bus.c +++ b/drivers/staging/fbtft/fbtft-bus.c @@ -137,7 +137,7 @@ int fbtft_write_vmem16_bus8(struct fbtft_par *par, size_t offset, size_t len) __func__, offset, len); remain = len / 2; - vmem16 = (u16 *)(par->info->screen_base + offset); + vmem16 = (u16 *)(par->info->screen_buffer + offset); if (par->gpio.dc != -1) gpio_set_value(par->gpio.dc, 1); @@ -196,7 +196,7 @@ int fbtft_write_vmem16_bus9(struct fbtft_par *par, size_t offset, size_t len) } remain = len; - vmem8 = par->info->screen_base + offset; + vmem8 = par->info->screen_buffer + offset; tx_array_size = par->txbuf.len / 2; @@ -240,7 +240,7 @@ int fbtft_write_vmem16_bus16(struct fbtft_par *par, size_t offset, size_t len) fbtft_par_dbg(DEBUG_WRITE_VMEM, par, "%s(offset=%zu, len=%zu)\n", __func__, offset, len); - vmem16 = (u16 *)(par->info->screen_base + offset); + vmem16 = (u16 *)(par->info->screen_buffer + offset); if (par->gpio.dc != -1) gpio_set_value(par->gpio.dc, 1); diff --git a/drivers/staging/fbtft/fbtft-core.c b/drivers/staging/fbtft/fbtft-core.c index deccb1d99251..b1e45161eefc 100644 --- a/drivers/staging/fbtft/fbtft-core.c +++ b/drivers/staging/fbtft/fbtft-core.c @@ -748,7 +748,7 @@ struct fb_info *fbtft_framebuffer_alloc(struct fbtft_display *display, if (!info) goto alloc_fail; - info->screen_base = (u8 __force __iomem *)vmem; + info->screen_buffer = vmem; info->fbops = fbops; info->fbdefio = fbdefio; @@ -888,7 +888,7 @@ EXPORT_SYMBOL(fbtft_framebuffer_alloc); void fbtft_framebuffer_release(struct fb_info *info) { fb_deferred_io_cleanup(info); - vfree(info->screen_base); + vfree(info->screen_buffer); framebuffer_release(info); } EXPORT_SYMBOL(fbtft_framebuffer_release); -- 2.39.5