Commit 55c225fb authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'fbdev-for-6.5-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/linux-fbdev

Pull fbdev fixes and cleanups from Helge Deller:
 "Just the usual bunch of code cleanups in various drivers, this time
  mostly in vgacon and imxfb:

   - Code cleanup in vgacon (Jiri Slaby)

   - Explicitly include correct DT includes (Rob Herring)

   - imxfb code cleanup (Yangtao Li, Martin Kaiser)

   - kyrofb: make arrays const and smaller (Colin Ian King)

   - ep93xx-fb: return value check fix (Yuanjun Gong)

   - au1200fb: add missing IRQ check (Zhang Shurong)"

* tag 'fbdev-for-6.5-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/linux-fbdev:
  fbdev: Explicitly include correct DT includes
  fbdev: ep93xx-fb: fix return value check in ep93xxfb_probe
  fbdev: au1200fb: Fix missing IRQ check in au1200fb_drv_probe
  fbdev: kyro: make some const read-only arrays static and reduce type size
  fbcon: remove unused display (p) from fbcon_redraw()
  sticon: make sticon_set_def_font() void and remove op parameter
  vgacon: cache vc_cell_height in vgacon_cursor()
  vgacon: let vgacon_doresize() return void
  vgacon: remove unused xpos from vgacon_set_cursor_size()
  vgacon: remove unneeded forward declarations
  vgacon: switch vgacon_scrolldelta() and vgacon_restore_screen()
  fbdev: imxfb: remove unneeded labels
  fbdev: imxfb: Convert to devm_platform_ioremap_resource()
  fbdev: imxfb: Convert to devm_kmalloc_array()
  fbdev: imxfb: Removed unneeded release_mem_region
  fbdev: imxfb: switch to DEFINE_SIMPLE_DEV_PM_OPS
  fbdev: imxfb: warn about invalid left/right margin
parents 4e076c73 e8812acb
...@@ -156,7 +156,7 @@ static bool sticon_scroll(struct vc_data *conp, unsigned int t, ...@@ -156,7 +156,7 @@ static bool sticon_scroll(struct vc_data *conp, unsigned int t,
return false; return false;
} }
static int sticon_set_def_font(int unit, struct console_font *op) static void sticon_set_def_font(int unit)
{ {
if (font_data[unit] != STI_DEF_FONT) { if (font_data[unit] != STI_DEF_FONT) {
if (--FNTREFCOUNT(font_data[unit]) == 0) { if (--FNTREFCOUNT(font_data[unit]) == 0) {
...@@ -165,8 +165,6 @@ static int sticon_set_def_font(int unit, struct console_font *op) ...@@ -165,8 +165,6 @@ static int sticon_set_def_font(int unit, struct console_font *op)
} }
font_data[unit] = STI_DEF_FONT; font_data[unit] = STI_DEF_FONT;
} }
return 0;
} }
static int sticon_set_font(struct vc_data *vc, struct console_font *op, static int sticon_set_font(struct vc_data *vc, struct console_font *op,
...@@ -246,7 +244,7 @@ static int sticon_set_font(struct vc_data *vc, struct console_font *op, ...@@ -246,7 +244,7 @@ static int sticon_set_font(struct vc_data *vc, struct console_font *op,
vc->vc_video_erase_char, font_data[vc->vc_num]); vc->vc_video_erase_char, font_data[vc->vc_num]);
/* delete old font in case it is a user font */ /* delete old font in case it is a user font */
sticon_set_def_font(unit, NULL); sticon_set_def_font(unit);
FNTREFCOUNT(cooked_font)++; FNTREFCOUNT(cooked_font)++;
font_data[unit] = cooked_font; font_data[unit] = cooked_font;
...@@ -264,7 +262,9 @@ static int sticon_set_font(struct vc_data *vc, struct console_font *op, ...@@ -264,7 +262,9 @@ static int sticon_set_font(struct vc_data *vc, struct console_font *op,
static int sticon_font_default(struct vc_data *vc, struct console_font *op, char *name) static int sticon_font_default(struct vc_data *vc, struct console_font *op, char *name)
{ {
return sticon_set_def_font(vc->vc_num, op); sticon_set_def_font(vc->vc_num);
return 0;
} }
static int sticon_font_set(struct vc_data *vc, struct console_font *font, static int sticon_font_set(struct vc_data *vc, struct console_font *font,
...@@ -297,7 +297,7 @@ static void sticon_deinit(struct vc_data *c) ...@@ -297,7 +297,7 @@ static void sticon_deinit(struct vc_data *c)
/* free memory used by user font */ /* free memory used by user font */
for (i = 0; i < MAX_NR_CONSOLES; i++) for (i = 0; i < MAX_NR_CONSOLES; i++)
sticon_set_def_font(i, NULL); sticon_set_def_font(i);
} }
static void sticon_clear(struct vc_data *conp, int sy, int sx, int height, static void sticon_clear(struct vc_data *conp, int sy, int sx, int height,
......
...@@ -65,16 +65,8 @@ static struct vgastate vgastate; ...@@ -65,16 +65,8 @@ static struct vgastate vgastate;
* Interface used by the world * Interface used by the world
*/ */
static const char *vgacon_startup(void);
static void vgacon_init(struct vc_data *c, int init);
static void vgacon_deinit(struct vc_data *c);
static void vgacon_cursor(struct vc_data *c, int mode);
static int vgacon_switch(struct vc_data *c);
static int vgacon_blank(struct vc_data *c, int blank, int mode_switch);
static void vgacon_scrolldelta(struct vc_data *c, int lines);
static int vgacon_set_origin(struct vc_data *c); static int vgacon_set_origin(struct vc_data *c);
static void vgacon_save_screen(struct vc_data *c);
static void vgacon_invert_region(struct vc_data *c, u16 * p, int count);
static struct uni_pagedict *vgacon_uni_pagedir; static struct uni_pagedict *vgacon_uni_pagedir;
static int vgacon_refcount; static int vgacon_refcount;
...@@ -142,12 +134,6 @@ static inline void vga_set_mem_top(struct vc_data *c) ...@@ -142,12 +134,6 @@ static inline void vga_set_mem_top(struct vc_data *c)
write_vga(12, (c->vc_visible_origin - vga_vram_base) / 2); write_vga(12, (c->vc_visible_origin - vga_vram_base) / 2);
} }
static void vgacon_restore_screen(struct vc_data *c)
{
if (c->vc_origin != c->vc_visible_origin)
vgacon_scrolldelta(c, 0);
}
static void vgacon_scrolldelta(struct vc_data *c, int lines) static void vgacon_scrolldelta(struct vc_data *c, int lines)
{ {
vc_scrolldelta_helper(c, lines, vga_rolled_over, (void *)vga_vram_base, vc_scrolldelta_helper(c, lines, vga_rolled_over, (void *)vga_vram_base,
...@@ -155,6 +141,12 @@ static void vgacon_scrolldelta(struct vc_data *c, int lines) ...@@ -155,6 +141,12 @@ static void vgacon_scrolldelta(struct vc_data *c, int lines)
vga_set_mem_top(c); vga_set_mem_top(c);
} }
static void vgacon_restore_screen(struct vc_data *c)
{
if (c->vc_origin != c->vc_visible_origin)
vgacon_scrolldelta(c, 0);
}
static const char *vgacon_startup(void) static const char *vgacon_startup(void)
{ {
const char *display_desc = NULL; const char *display_desc = NULL;
...@@ -445,7 +437,7 @@ static void vgacon_invert_region(struct vc_data *c, u16 * p, int count) ...@@ -445,7 +437,7 @@ static void vgacon_invert_region(struct vc_data *c, u16 * p, int count)
} }
} }
static void vgacon_set_cursor_size(int xpos, int from, int to) static void vgacon_set_cursor_size(int from, int to)
{ {
unsigned long flags; unsigned long flags;
int curs, cure; int curs, cure;
...@@ -478,18 +470,22 @@ static void vgacon_set_cursor_size(int xpos, int from, int to) ...@@ -478,18 +470,22 @@ static void vgacon_set_cursor_size(int xpos, int from, int to)
static void vgacon_cursor(struct vc_data *c, int mode) static void vgacon_cursor(struct vc_data *c, int mode)
{ {
unsigned int c_height;
if (c->vc_mode != KD_TEXT) if (c->vc_mode != KD_TEXT)
return; return;
vgacon_restore_screen(c); vgacon_restore_screen(c);
c_height = c->vc_cell_height;
switch (mode) { switch (mode) {
case CM_ERASE: case CM_ERASE:
write_vga(14, (c->vc_pos - vga_vram_base) / 2); write_vga(14, (c->vc_pos - vga_vram_base) / 2);
if (vga_video_type >= VIDEO_TYPE_VGAC) if (vga_video_type >= VIDEO_TYPE_VGAC)
vgacon_set_cursor_size(c->state.x, 31, 30); vgacon_set_cursor_size(31, 30);
else else
vgacon_set_cursor_size(c->state.x, 31, 31); vgacon_set_cursor_size(31, 31);
break; break;
case CM_MOVE: case CM_MOVE:
...@@ -497,51 +493,38 @@ static void vgacon_cursor(struct vc_data *c, int mode) ...@@ -497,51 +493,38 @@ static void vgacon_cursor(struct vc_data *c, int mode)
write_vga(14, (c->vc_pos - vga_vram_base) / 2); write_vga(14, (c->vc_pos - vga_vram_base) / 2);
switch (CUR_SIZE(c->vc_cursor_type)) { switch (CUR_SIZE(c->vc_cursor_type)) {
case CUR_UNDERLINE: case CUR_UNDERLINE:
vgacon_set_cursor_size(c->state.x, vgacon_set_cursor_size(c_height -
c->vc_cell_height - (c_height < 10 ? 2 : 3),
(c->vc_cell_height < c_height -
10 ? 2 : 3), (c_height < 10 ? 1 : 2));
c->vc_cell_height -
(c->vc_cell_height <
10 ? 1 : 2));
break; break;
case CUR_TWO_THIRDS: case CUR_TWO_THIRDS:
vgacon_set_cursor_size(c->state.x, vgacon_set_cursor_size(c_height / 3, c_height -
c->vc_cell_height / 3, (c_height < 10 ? 1 : 2));
c->vc_cell_height -
(c->vc_cell_height <
10 ? 1 : 2));
break; break;
case CUR_LOWER_THIRD: case CUR_LOWER_THIRD:
vgacon_set_cursor_size(c->state.x, vgacon_set_cursor_size(c_height * 2 / 3, c_height -
(c->vc_cell_height * 2) / 3, (c_height < 10 ? 1 : 2));
c->vc_cell_height -
(c->vc_cell_height <
10 ? 1 : 2));
break; break;
case CUR_LOWER_HALF: case CUR_LOWER_HALF:
vgacon_set_cursor_size(c->state.x, vgacon_set_cursor_size(c_height / 2, c_height -
c->vc_cell_height / 2, (c_height < 10 ? 1 : 2));
c->vc_cell_height -
(c->vc_cell_height <
10 ? 1 : 2));
break; break;
case CUR_NONE: case CUR_NONE:
if (vga_video_type >= VIDEO_TYPE_VGAC) if (vga_video_type >= VIDEO_TYPE_VGAC)
vgacon_set_cursor_size(c->state.x, 31, 30); vgacon_set_cursor_size(31, 30);
else else
vgacon_set_cursor_size(c->state.x, 31, 31); vgacon_set_cursor_size(31, 31);
break; break;
default: default:
vgacon_set_cursor_size(c->state.x, 1, vgacon_set_cursor_size(1, c_height);
c->vc_cell_height);
break; break;
} }
break; break;
} }
} }
static int vgacon_doresize(struct vc_data *c, static void vgacon_doresize(struct vc_data *c,
unsigned int width, unsigned int height) unsigned int width, unsigned int height)
{ {
unsigned long flags; unsigned long flags;
...@@ -600,7 +583,6 @@ static int vgacon_doresize(struct vc_data *c, ...@@ -600,7 +583,6 @@ static int vgacon_doresize(struct vc_data *c,
} }
raw_spin_unlock_irqrestore(&vga_lock, flags); raw_spin_unlock_irqrestore(&vga_lock, flags);
return 0;
} }
static int vgacon_switch(struct vc_data *c) static int vgacon_switch(struct vc_data *c)
......
...@@ -1732,6 +1732,9 @@ static int au1200fb_drv_probe(struct platform_device *dev) ...@@ -1732,6 +1732,9 @@ static int au1200fb_drv_probe(struct platform_device *dev)
/* Now hook interrupt too */ /* Now hook interrupt too */
irq = platform_get_irq(dev, 0); irq = platform_get_irq(dev, 0);
if (irq < 0)
return irq;
ret = request_irq(irq, au1200fb_handle_irq, ret = request_irq(irq, au1200fb_handle_irq,
IRQF_SHARED, "lcd", (void *)dev); IRQF_SHARED, "lcd", (void *)dev);
if (ret) { if (ret) {
......
...@@ -17,7 +17,8 @@ ...@@ -17,7 +17,8 @@
#include <linux/init.h> #include <linux/init.h>
#include <linux/fb.h> #include <linux/fb.h>
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/of_device.h> #include <linux/of.h>
#include <linux/platform_device.h>
#include <asm/io.h> #include <asm/io.h>
#include <asm/fbio.h> #include <asm/fbio.h>
......
...@@ -17,7 +17,8 @@ ...@@ -17,7 +17,8 @@
#include <linux/fb.h> #include <linux/fb.h>
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/uaccess.h> #include <linux/uaccess.h>
#include <linux/of_device.h> #include <linux/of.h>
#include <linux/platform_device.h>
#include <asm/io.h> #include <asm/io.h>
#include <asm/fbio.h> #include <asm/fbio.h>
......
...@@ -17,7 +17,8 @@ ...@@ -17,7 +17,8 @@
#include <linux/init.h> #include <linux/init.h>
#include <linux/fb.h> #include <linux/fb.h>
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/of_device.h> #include <linux/of.h>
#include <linux/platform_device.h>
#include <asm/io.h> #include <asm/io.h>
#include <asm/fbio.h> #include <asm/fbio.h>
......
...@@ -17,7 +17,8 @@ ...@@ -17,7 +17,8 @@
#include <linux/init.h> #include <linux/init.h>
#include <linux/fb.h> #include <linux/fb.h>
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/of_device.h> #include <linux/of.h>
#include <linux/platform_device.h>
#include <asm/io.h> #include <asm/io.h>
#include <asm/fbio.h> #include <asm/fbio.h>
......
...@@ -1612,8 +1612,7 @@ static void fbcon_redraw_blit(struct vc_data *vc, struct fb_info *info, ...@@ -1612,8 +1612,7 @@ static void fbcon_redraw_blit(struct vc_data *vc, struct fb_info *info,
} }
} }
static void fbcon_redraw(struct vc_data *vc, struct fbcon_display *p, static void fbcon_redraw(struct vc_data *vc, int line, int count, int offset)
int line, int count, int offset)
{ {
unsigned short *d = (unsigned short *) unsigned short *d = (unsigned short *)
(vc->vc_origin + vc->vc_size_row * line); (vc->vc_origin + vc->vc_size_row * line);
...@@ -1827,7 +1826,7 @@ static bool fbcon_scroll(struct vc_data *vc, unsigned int t, unsigned int b, ...@@ -1827,7 +1826,7 @@ static bool fbcon_scroll(struct vc_data *vc, unsigned int t, unsigned int b,
case SCROLL_REDRAW: case SCROLL_REDRAW:
redraw_up: redraw_up:
fbcon_redraw(vc, p, t, b - t - count, fbcon_redraw(vc, t, b - t - count,
count * vc->vc_cols); count * vc->vc_cols);
fbcon_clear(vc, b - count, 0, count, vc->vc_cols); fbcon_clear(vc, b - count, 0, count, vc->vc_cols);
scr_memsetw((unsigned short *) (vc->vc_origin + scr_memsetw((unsigned short *) (vc->vc_origin +
...@@ -1913,7 +1912,7 @@ static bool fbcon_scroll(struct vc_data *vc, unsigned int t, unsigned int b, ...@@ -1913,7 +1912,7 @@ static bool fbcon_scroll(struct vc_data *vc, unsigned int t, unsigned int b,
case SCROLL_REDRAW: case SCROLL_REDRAW:
redraw_down: redraw_down:
fbcon_redraw(vc, p, b - 1, b - t - count, fbcon_redraw(vc, b - 1, b - t - count,
-count * vc->vc_cols); -count * vc->vc_cols);
fbcon_clear(vc, t, 0, count, vc->vc_cols); fbcon_clear(vc, t, 0, count, vc->vc_cols);
scr_memsetw((unsigned short *) (vc->vc_origin + scr_memsetw((unsigned short *) (vc->vc_origin +
......
...@@ -548,7 +548,9 @@ static int ep93xxfb_probe(struct platform_device *pdev) ...@@ -548,7 +548,9 @@ static int ep93xxfb_probe(struct platform_device *pdev)
} }
ep93xxfb_set_par(info); ep93xxfb_set_par(info);
clk_prepare_enable(fbi->clk); err = clk_prepare_enable(fbi->clk);
if (err)
goto failed_check;
err = register_framebuffer(info); err = register_framebuffer(info);
if (err) if (err)
......
...@@ -16,7 +16,8 @@ ...@@ -16,7 +16,8 @@
#include <linux/fb.h> #include <linux/fb.h>
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/timer.h> #include <linux/timer.h>
#include <linux/of_device.h> #include <linux/of.h>
#include <linux/platform_device.h>
#include <asm/io.h> #include <asm/io.h>
#include <asm/upa.h> #include <asm/upa.h>
......
...@@ -12,8 +12,7 @@ ...@@ -12,8 +12,7 @@
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/dma-mapping.h> #include <linux/dma-mapping.h>
#include <linux/of_platform.h> #include <linux/of.h>
#include <linux/of_device.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/string.h> #include <linux/string.h>
......
...@@ -613,10 +613,10 @@ static int imxfb_activate_var(struct fb_var_screeninfo *var, struct fb_info *inf ...@@ -613,10 +613,10 @@ static int imxfb_activate_var(struct fb_var_screeninfo *var, struct fb_info *inf
if (var->hsync_len < 1 || var->hsync_len > 64) if (var->hsync_len < 1 || var->hsync_len > 64)
printk(KERN_ERR "%s: invalid hsync_len %d\n", printk(KERN_ERR "%s: invalid hsync_len %d\n",
info->fix.id, var->hsync_len); info->fix.id, var->hsync_len);
if (var->left_margin > 255) if (var->left_margin < 3 || var->left_margin > 255)
printk(KERN_ERR "%s: invalid left_margin %d\n", printk(KERN_ERR "%s: invalid left_margin %d\n",
info->fix.id, var->left_margin); info->fix.id, var->left_margin);
if (var->right_margin > 255) if (var->right_margin < 1 || var->right_margin > 255)
printk(KERN_ERR "%s: invalid right_margin %d\n", printk(KERN_ERR "%s: invalid right_margin %d\n",
info->fix.id, var->right_margin); info->fix.id, var->right_margin);
if (var->yres < 1 || var->yres > ymax_mask) if (var->yres < 1 || var->yres > ymax_mask)
...@@ -673,7 +673,8 @@ static int imxfb_init_fbinfo(struct platform_device *pdev) ...@@ -673,7 +673,8 @@ static int imxfb_init_fbinfo(struct platform_device *pdev)
pr_debug("%s\n",__func__); pr_debug("%s\n",__func__);
info->pseudo_palette = kmalloc_array(16, sizeof(u32), GFP_KERNEL); info->pseudo_palette = devm_kmalloc_array(&pdev->dev, 16,
sizeof(u32), GFP_KERNEL);
if (!info->pseudo_palette) if (!info->pseudo_palette)
return -ENOMEM; return -ENOMEM;
...@@ -868,7 +869,6 @@ static int imxfb_probe(struct platform_device *pdev) ...@@ -868,7 +869,6 @@ static int imxfb_probe(struct platform_device *pdev)
struct imxfb_info *fbi; struct imxfb_info *fbi;
struct lcd_device *lcd; struct lcd_device *lcd;
struct fb_info *info; struct fb_info *info;
struct resource *res;
struct imx_fb_videomode *m; struct imx_fb_videomode *m;
const struct of_device_id *of_id; const struct of_device_id *of_id;
struct device_node *display_np; struct device_node *display_np;
...@@ -885,10 +885,6 @@ static int imxfb_probe(struct platform_device *pdev) ...@@ -885,10 +885,6 @@ static int imxfb_probe(struct platform_device *pdev)
if (of_id) if (of_id)
pdev->id_entry = of_id->data; pdev->id_entry = of_id->data;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!res)
return -ENODEV;
info = framebuffer_alloc(sizeof(struct imxfb_info), &pdev->dev); info = framebuffer_alloc(sizeof(struct imxfb_info), &pdev->dev);
if (!info) if (!info)
return -ENOMEM; return -ENOMEM;
...@@ -907,7 +903,7 @@ static int imxfb_probe(struct platform_device *pdev) ...@@ -907,7 +903,7 @@ static int imxfb_probe(struct platform_device *pdev)
if (!display_np) { if (!display_np) {
dev_err(&pdev->dev, "No display defined in devicetree\n"); dev_err(&pdev->dev, "No display defined in devicetree\n");
ret = -EINVAL; ret = -EINVAL;
goto failed_of_parse; goto failed_init;
} }
/* /*
...@@ -921,13 +917,13 @@ static int imxfb_probe(struct platform_device *pdev) ...@@ -921,13 +917,13 @@ static int imxfb_probe(struct platform_device *pdev)
if (!fbi->mode) { if (!fbi->mode) {
ret = -ENOMEM; ret = -ENOMEM;
of_node_put(display_np); of_node_put(display_np);
goto failed_of_parse; goto failed_init;
} }
ret = imxfb_of_read_mode(&pdev->dev, display_np, fbi->mode); ret = imxfb_of_read_mode(&pdev->dev, display_np, fbi->mode);
of_node_put(display_np); of_node_put(display_np);
if (ret) if (ret)
goto failed_of_parse; goto failed_init;
/* Calculate maximum bytes used per pixel. In most cases this should /* Calculate maximum bytes used per pixel. In most cases this should
* be the same as m->bpp/8 */ * be the same as m->bpp/8 */
...@@ -940,7 +936,7 @@ static int imxfb_probe(struct platform_device *pdev) ...@@ -940,7 +936,7 @@ static int imxfb_probe(struct platform_device *pdev)
fbi->clk_ipg = devm_clk_get(&pdev->dev, "ipg"); fbi->clk_ipg = devm_clk_get(&pdev->dev, "ipg");
if (IS_ERR(fbi->clk_ipg)) { if (IS_ERR(fbi->clk_ipg)) {
ret = PTR_ERR(fbi->clk_ipg); ret = PTR_ERR(fbi->clk_ipg);
goto failed_getclock; goto failed_init;
} }
/* /*
...@@ -955,25 +951,25 @@ static int imxfb_probe(struct platform_device *pdev) ...@@ -955,25 +951,25 @@ static int imxfb_probe(struct platform_device *pdev)
*/ */
ret = clk_prepare_enable(fbi->clk_ipg); ret = clk_prepare_enable(fbi->clk_ipg);
if (ret) if (ret)
goto failed_getclock; goto failed_init;
clk_disable_unprepare(fbi->clk_ipg); clk_disable_unprepare(fbi->clk_ipg);
fbi->clk_ahb = devm_clk_get(&pdev->dev, "ahb"); fbi->clk_ahb = devm_clk_get(&pdev->dev, "ahb");
if (IS_ERR(fbi->clk_ahb)) { if (IS_ERR(fbi->clk_ahb)) {
ret = PTR_ERR(fbi->clk_ahb); ret = PTR_ERR(fbi->clk_ahb);
goto failed_getclock; goto failed_init;
} }
fbi->clk_per = devm_clk_get(&pdev->dev, "per"); fbi->clk_per = devm_clk_get(&pdev->dev, "per");
if (IS_ERR(fbi->clk_per)) { if (IS_ERR(fbi->clk_per)) {
ret = PTR_ERR(fbi->clk_per); ret = PTR_ERR(fbi->clk_per);
goto failed_getclock; goto failed_init;
} }
fbi->regs = devm_ioremap_resource(&pdev->dev, res); fbi->regs = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(fbi->regs)) { if (IS_ERR(fbi->regs)) {
ret = PTR_ERR(fbi->regs); ret = PTR_ERR(fbi->regs);
goto failed_ioremap; goto failed_init;
} }
fbi->map_size = PAGE_ALIGN(info->fix.smem_len); fbi->map_size = PAGE_ALIGN(info->fix.smem_len);
...@@ -982,7 +978,7 @@ static int imxfb_probe(struct platform_device *pdev) ...@@ -982,7 +978,7 @@ static int imxfb_probe(struct platform_device *pdev)
if (!info->screen_buffer) { if (!info->screen_buffer) {
dev_err(&pdev->dev, "Failed to allocate video RAM\n"); dev_err(&pdev->dev, "Failed to allocate video RAM\n");
ret = -ENOMEM; ret = -ENOMEM;
goto failed_map; goto failed_init;
} }
info->fix.smem_start = fbi->map_dma; info->fix.smem_start = fbi->map_dma;
...@@ -1034,18 +1030,11 @@ static int imxfb_probe(struct platform_device *pdev) ...@@ -1034,18 +1030,11 @@ static int imxfb_probe(struct platform_device *pdev)
failed_lcd: failed_lcd:
unregister_framebuffer(info); unregister_framebuffer(info);
failed_register: failed_register:
fb_dealloc_cmap(&info->cmap); fb_dealloc_cmap(&info->cmap);
failed_cmap: failed_cmap:
dma_free_wc(&pdev->dev, fbi->map_size, info->screen_buffer, dma_free_wc(&pdev->dev, fbi->map_size, info->screen_buffer,
fbi->map_dma); fbi->map_dma);
failed_map:
failed_ioremap:
failed_getclock:
release_mem_region(res->start, resource_size(res));
failed_of_parse:
kfree(info->pseudo_palette);
failed_init: failed_init:
framebuffer_release(info); framebuffer_release(info);
return ret; return ret;
...@@ -1062,11 +1051,10 @@ static void imxfb_remove(struct platform_device *pdev) ...@@ -1062,11 +1051,10 @@ static void imxfb_remove(struct platform_device *pdev)
fb_dealloc_cmap(&info->cmap); fb_dealloc_cmap(&info->cmap);
dma_free_wc(&pdev->dev, fbi->map_size, info->screen_buffer, dma_free_wc(&pdev->dev, fbi->map_size, info->screen_buffer,
fbi->map_dma); fbi->map_dma);
kfree(info->pseudo_palette);
framebuffer_release(info); framebuffer_release(info);
} }
static int __maybe_unused imxfb_suspend(struct device *dev) static int imxfb_suspend(struct device *dev)
{ {
struct fb_info *info = dev_get_drvdata(dev); struct fb_info *info = dev_get_drvdata(dev);
struct imxfb_info *fbi = info->par; struct imxfb_info *fbi = info->par;
...@@ -1076,7 +1064,7 @@ static int __maybe_unused imxfb_suspend(struct device *dev) ...@@ -1076,7 +1064,7 @@ static int __maybe_unused imxfb_suspend(struct device *dev)
return 0; return 0;
} }
static int __maybe_unused imxfb_resume(struct device *dev) static int imxfb_resume(struct device *dev)
{ {
struct fb_info *info = dev_get_drvdata(dev); struct fb_info *info = dev_get_drvdata(dev);
struct imxfb_info *fbi = info->par; struct imxfb_info *fbi = info->par;
...@@ -1086,13 +1074,13 @@ static int __maybe_unused imxfb_resume(struct device *dev) ...@@ -1086,13 +1074,13 @@ static int __maybe_unused imxfb_resume(struct device *dev)
return 0; return 0;
} }
static SIMPLE_DEV_PM_OPS(imxfb_pm_ops, imxfb_suspend, imxfb_resume); static DEFINE_SIMPLE_DEV_PM_OPS(imxfb_pm_ops, imxfb_suspend, imxfb_resume);
static struct platform_driver imxfb_driver = { static struct platform_driver imxfb_driver = {
.driver = { .driver = {
.name = DRIVER_NAME, .name = DRIVER_NAME,
.of_match_table = imxfb_of_dev_id, .of_match_table = imxfb_of_dev_id,
.pm = &imxfb_pm_ops, .pm = pm_sleep_ptr(&imxfb_pm_ops),
}, },
.probe = imxfb_probe, .probe = imxfb_probe,
.remove_new = imxfb_remove, .remove_new = imxfb_remove,
......
...@@ -83,11 +83,11 @@ volatile u32 i,count=0; \ ...@@ -83,11 +83,11 @@ volatile u32 i,count=0; \
static u32 InitSDRAMRegisters(volatile STG4000REG __iomem *pSTGReg, static u32 InitSDRAMRegisters(volatile STG4000REG __iomem *pSTGReg,
u32 dwSubSysID, u32 dwRevID) u32 dwSubSysID, u32 dwRevID)
{ {
u32 adwSDRAMArgCfg0[] = { 0xa0, 0x80, 0xa0, 0xa0, 0xa0 }; static const u8 adwSDRAMArgCfg0[] = { 0xa0, 0x80, 0xa0, 0xa0, 0xa0 };
u32 adwSDRAMCfg1[] = { 0x8732, 0x8732, 0xa732, 0xa732, 0x8732 }; static const u16 adwSDRAMCfg1[] = { 0x8732, 0x8732, 0xa732, 0xa732, 0x8732 };
u32 adwSDRAMCfg2[] = { 0x87d2, 0x87d2, 0xa7d2, 0x87d2, 0xa7d2 }; static const u16 adwSDRAMCfg2[] = { 0x87d2, 0x87d2, 0xa7d2, 0x87d2, 0xa7d2 };
u32 adwSDRAMRsh[] = { 36, 39, 40 }; static const u8 adwSDRAMRsh[] = { 36, 39, 40 };
u32 adwChipSpeed[] = { 110, 120, 125 }; static const u8 adwChipSpeed[] = { 110, 120, 125 };
u32 dwMemTypeIdx; u32 dwMemTypeIdx;
u32 dwChipSpeedIdx; u32 dwChipSpeedIdx;
......
...@@ -16,8 +16,9 @@ ...@@ -16,8 +16,9 @@
#include <linux/init.h> #include <linux/init.h>
#include <linux/fb.h> #include <linux/fb.h>
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/of_device.h>
#include <linux/io.h> #include <linux/io.h>
#include <linux/of.h>
#include <linux/platform_device.h>
#include <asm/fbio.h> #include <asm/fbio.h>
......
...@@ -15,9 +15,7 @@ ...@@ -15,9 +15,7 @@
#include <linux/module.h> #include <linux/module.h>
#include <linux/pci.h> #include <linux/pci.h>
#include <linux/slab.h> #include <linux/slab.h>
#if defined(CONFIG_OF)
#include <linux/of_platform.h>
#endif
#include "mb862xxfb.h" #include "mb862xxfb.h"
#include "mb862xx_reg.h" #include "mb862xx_reg.h"
#include "mb862xxfb_accel.h" #include "mb862xxfb_accel.h"
......
...@@ -18,11 +18,11 @@ ...@@ -18,11 +18,11 @@
#include <linux/init.h> #include <linux/init.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/pci.h> #include <linux/pci.h>
#if defined(CONFIG_OF) #include <linux/of.h>
#include <linux/of_address.h> #include <linux/of_address.h>
#include <linux/of_irq.h> #include <linux/of_irq.h>
#include <linux/of_platform.h> #include <linux/platform_device.h>
#endif
#include "mb862xxfb.h" #include "mb862xxfb.h"
#include "mb862xx_reg.h" #include "mb862xx_reg.h"
......
...@@ -15,12 +15,12 @@ ...@@ -15,12 +15,12 @@
#include <linux/gpio/consumer.h> #include <linux/gpio/consumer.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/jiffies.h> #include <linux/jiffies.h>
#include <linux/mod_devicetable.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/sched/signal.h> #include <linux/sched/signal.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/workqueue.h> #include <linux/workqueue.h>
#include <linux/of_device.h>
#include <video/omapfb_dss.h> #include <video/omapfb_dss.h>
#include <video/mipi_display.h> #include <video/mipi_display.h>
......
...@@ -15,7 +15,8 @@ ...@@ -15,7 +15,8 @@
#include <linux/init.h> #include <linux/init.h>
#include <linux/fb.h> #include <linux/fb.h>
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/of_device.h> #include <linux/of.h>
#include <linux/platform_device.h>
#include <asm/io.h> #include <asm/io.h>
#include <asm/fbio.h> #include <asm/fbio.h>
......
...@@ -30,9 +30,9 @@ ...@@ -30,9 +30,9 @@
#include <linux/fb.h> #include <linux/fb.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/nvram.h> #include <linux/nvram.h>
#include <linux/of.h>
#include <linux/of_address.h> #include <linux/of_address.h>
#include <linux/of_device.h> #include <linux/platform_device.h>
#include <linux/of_platform.h>
#include "macmodes.h" #include "macmodes.h"
#include "platinumfb.h" #include "platinumfb.h"
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
#include <linux/fb.h> #include <linux/fb.h>
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/uaccess.h> #include <linux/uaccess.h>
#include <linux/of_device.h> #include <linux/of.h>
#include <asm/fbio.h> #include <asm/fbio.h>
......
...@@ -8,7 +8,8 @@ ...@@ -8,7 +8,8 @@
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/fb.h> #include <linux/fb.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/of_device.h> #include <linux/of.h>
#include <linux/platform_device.h>
struct gfb_info { struct gfb_info {
struct fb_info *info; struct fb_info *info;
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
#include <linux/fb.h> #include <linux/fb.h>
#include <linux/pci.h> #include <linux/pci.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/of_device.h> #include <linux/of.h>
#include <asm/io.h> #include <asm/io.h>
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
#include <linux/fb.h> #include <linux/fb.h>
#include <linux/pci.h> #include <linux/pci.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/of_device.h> #include <linux/of.h>
#include <asm/io.h> #include <asm/io.h>
......
...@@ -17,7 +17,8 @@ ...@@ -17,7 +17,8 @@
#include <linux/init.h> #include <linux/init.h>
#include <linux/fb.h> #include <linux/fb.h>
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/of_device.h> #include <linux/of.h>
#include <linux/platform_device.h>
#include <asm/io.h> #include <asm/io.h>
#include <asm/fbio.h> #include <asm/fbio.h>
......
...@@ -24,14 +24,13 @@ ...@@ -24,14 +24,13 @@
#include <linux/module.h> #include <linux/module.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/errno.h> #include <linux/errno.h>
#include <linux/platform_device.h>
#include <linux/string.h> #include <linux/string.h>
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/fb.h> #include <linux/fb.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/dma-mapping.h> #include <linux/dma-mapping.h>
#include <linux/of_device.h> #include <linux/of.h>
#include <linux/of_platform.h>
#include <linux/of_address.h>
#include <linux/io.h> #include <linux/io.h>
#include <linux/slab.h> #include <linux/slab.h>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment