mirror of https://gitee.com/openkylin/linux.git
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 <lars1.svensson@sonymobile.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
17a7b0b4d9
commit
4b6dc179dc
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue