Pull fbdev fixes and updates from Helge Deller: "Mostly just small patches, with the exception of the bigger indenting cleanups in the sisfb and radeonfb drivers. Two patches should be mentioned though: A fix-up for fbdev if the screen resize fails (by Shigeru Yoshida), and a potential divide by zero fix in fb_pm2fb (by Letu Ren). Summary: Major fixes: - Revert the changes for fbcon console when vc_resize() fails [Shigeru Yoshida] - Avoid a potential divide by zero error in fb_pm2fb [Letu Ren] Minor fixes: - Add missing pci_disable_device() in chipsfb_pci_init() [Yang Yingliang] - Fix tests for platform_get_irq() failure in omapfb [Yu Zhe] - Destroy mutex on freeing struct fb_info in fbsysfs [Shigeru Yoshida] Cleanups: - Move fbdev drivers from strlcpy to strscpy [Wolfram Sang] - Indenting fixes, comment fixes, ... [Jiapeng Chong & Jilin Yuan]" * tag 'fbdev-for-6.0-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/linux-fbdev: fbdev: fbcon: Properly revert changes when vc_resize() failed fbdev: Move fbdev drivers from strlcpy to strscpy fbdev: omap: Remove unnecessary print function dev_err() fbdev: chipsfb: Add missing pci_disable_device() in chipsfb_pci_init() fbdev: fbcon: Destroy mutex on freeing struct fb_info fbdev: radeon: Clean up some inconsistent indenting fbdev: sisfb: Clean up some inconsistent indenting fbdev: fb_pm2fb: Avoid potential divide by zero error fbdev: ssd1307fb: Fix repeated words in comments fbdev: omapfb: Fix tests for platform_get_irq() failure
Unified · Split
| @@ -290,7 +290,7 @@ static char default_sti_path[21] __read_mostly; · 289 unmodified lines | |||
| 290 | static int __init sti_setup(char *str) | 290 | static int __init sti_setup(char *str) |
| 291 | { | 291 | { |
| 292 | if (str) | 292 | if (str) |
| 293 | strlcpy (default_sti_path, str, sizeof (default_sti_path)); | 293 | strscpy(default_sti_path, str, sizeof(default_sti_path)); |
| 294 | 294 | ||
| 295 | return 1; | 295 | return 1; |
| 296 | } | 296 | } |
| @@ -3891,7 +3891,7 @@ static int __init atyfb_setup(char *options) · 3890 unmodified lines | |||
| 3891 | && (!strncmp(this_opt, "Mach64:", 7))) { | 3891 | && (!strncmp(this_opt, "Mach64:", 7))) { |
| 3892 | static unsigned char m64_num; | 3892 | static unsigned char m64_num; |
| 3893 | static char mach64_str[80]; | 3893 | static char mach64_str[80]; |
| 3894 | strlcpy(mach64_str, this_opt + 7, sizeof(mach64_str)); | 3894 | strscpy(mach64_str, this_opt + 7, sizeof(mach64_str)); |
| 3895 | if (!store_video_par(mach64_str, m64_num)) { | 3895 | if (!store_video_par(mach64_str, m64_num)) { |
| 3896 | m64_num++; | 3896 | m64_num++; |
| 3897 | mach64_count = m64_num; | 3897 | mach64_count = m64_num; |
| @@ -1980,7 +1980,7 @@ static int radeon_set_fbinfo(struct radeonfb_info *rinfo) · 1979 unmodified lines | |||
| 1980 | info->screen_base = rinfo->fb_base; | 1980 | info->screen_base = rinfo->fb_base; |
| 1981 | info->screen_size = rinfo->mapped_vram; | 1981 | info->screen_size = rinfo->mapped_vram; |
| 1982 | /* Fill fix common fields */ | 1982 | /* Fill fix common fields */ |
| 1983 | strlcpy(info->fix.id, rinfo->name, sizeof(info->fix.id)); | 1983 | strscpy(info->fix.id, rinfo->name, sizeof(info->fix.id)); |
| 1984 | info->fix.smem_start = rinfo->fb_base_phys; | 1984 | info->fix.smem_start = rinfo->fb_base_phys; |
| 1985 | info->fix.smem_len = rinfo->video_ram; | 1985 | info->fix.smem_len = rinfo->video_ram; |
| 1986 | info->fix.type = FB_TYPE_PACKED_PIXELS; | 1986 | info->fix.type = FB_TYPE_PACKED_PIXELS; |
| @@ -2094,34 +2094,34 @@ static void radeon_identify_vram(struct radeonfb_info *rinfo) · 107 unmodified lines | |||
| 2094 | u32 tmp; | 2094 | u32 tmp; |
| 2095 | 2095 | ||
| 2096 | /* framebuffer size */ | 2096 | /* framebuffer size */ |
| 2097 | if ((rinfo->family == CHIP_FAMILY_RS100) || | 2097 | if ((rinfo->family == CHIP_FAMILY_RS100) || |
| 2098 | (rinfo->family == CHIP_FAMILY_RS200) || | 2098 | (rinfo->family == CHIP_FAMILY_RS200) || |
| 2099 | (rinfo->family == CHIP_FAMILY_RS300) || | 2099 | (rinfo->family == CHIP_FAMILY_RS300) || |
| 2100 | (rinfo->family == CHIP_FAMILY_RC410) || | 2100 | (rinfo->family == CHIP_FAMILY_RC410) || |
| 2101 | (rinfo->family == CHIP_FAMILY_RS400) || | 2101 | (rinfo->family == CHIP_FAMILY_RS400) || |
| 2102 | (rinfo->family == CHIP_FAMILY_RS480) ) { | 2102 | (rinfo->family == CHIP_FAMILY_RS480) ) { |
| 2103 | u32 tom = INREG(NB_TOM); | 2103 | u32 tom = INREG(NB_TOM); |
| 2104 | tmp = ((((tom >> 16) - (tom & 0xffff) + 1) << 6) * 1024); | 2104 | |
| 2105 | 2105 | tmp = ((((tom >> 16) - (tom & 0xffff) + 1) << 6) * 1024); | |
| 2106 | radeon_fifo_wait(6); | 2106 | radeon_fifo_wait(6); |
| 2107 | OUTREG(MC_FB_LOCATION, tom); | 2107 | OUTREG(MC_FB_LOCATION, tom); |
| 2108 | OUTREG(DISPLAY_BASE_ADDR, (tom & 0xffff) << 16); | 2108 | OUTREG(DISPLAY_BASE_ADDR, (tom & 0xffff) << 16); |
| 2109 | OUTREG(CRTC2_DISPLAY_BASE_ADDR, (tom & 0xffff) << 16); | 2109 | OUTREG(CRTC2_DISPLAY_BASE_ADDR, (tom & 0xffff) << 16); |
| 2110 | OUTREG(OV0_BASE_ADDR, (tom & 0xffff) << 16); | 2110 | OUTREG(OV0_BASE_ADDR, (tom & 0xffff) << 16); |
| 2111 | 2111 | ||
| 2112 | /* This is supposed to fix the crtc2 noise problem. */ | 2112 | /* This is supposed to fix the crtc2 noise problem. */ |
| 2113 | OUTREG(GRPH2_BUFFER_CNTL, INREG(GRPH2_BUFFER_CNTL) & ~0x7f0000); | 2113 | OUTREG(GRPH2_BUFFER_CNTL, INREG(GRPH2_BUFFER_CNTL) & ~0x7f0000); |
| 2114 | 2114 | ||
| 2115 | if ((rinfo->family == CHIP_FAMILY_RS100) || | 2115 | if ((rinfo->family == CHIP_FAMILY_RS100) || |
| 2116 | (rinfo->family == CHIP_FAMILY_RS200)) { | 2116 | (rinfo->family == CHIP_FAMILY_RS200)) { |
| 2117 | /* This is to workaround the asic bug for RMX, some versions | 2117 | /* This is to workaround the asic bug for RMX, some versions |
| 2118 | of BIOS doesn't have this register initialized correctly. | 2118 | * of BIOS doesn't have this register initialized correctly. |
| 2119 | */ | 2119 | */ |
| 2120 | OUTREGP(CRTC_MORE_CNTL, CRTC_H_CUTOFF_ACTIVE_EN, | 2120 | OUTREGP(CRTC_MORE_CNTL, CRTC_H_CUTOFF_ACTIVE_EN, |
| 2121 | ~CRTC_H_CUTOFF_ACTIVE_EN); | 2121 | ~CRTC_H_CUTOFF_ACTIVE_EN); |
| 2122 | } | 2122 | } |
| 2123 | } else { | 2123 | } else { |
| 2124 | tmp = INREG(CNFG_MEMSIZE); | 2124 | tmp = INREG(CNFG_MEMSIZE); |
| 2125 | } | 2125 | } |
| 2126 | 2126 | ||
| 2127 | /* mem size is bits [28:0], mask off the rest */ | 2127 | /* mem size is bits [28:0], mask off the rest */ |
| @@ -182,7 +182,7 @@ static int bw2_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg) · 181 unmodified lines | |||
| 182 | 182 | ||
| 183 | static void bw2_init_fix(struct fb_info *info, int linebytes) | 183 | static void bw2_init_fix(struct fb_info *info, int linebytes) |
| 184 | { | 184 | { |
| 185 | strlcpy(info->fix.id, "bwtwo", sizeof(info->fix.id)); | 185 | strscpy(info->fix.id, "bwtwo", sizeof(info->fix.id)); |
| 186 | 186 | ||
| 187 | info->fix.type = FB_TYPE_PACKED_PIXELS; | 187 | info->fix.type = FB_TYPE_PACKED_PIXELS; |
| 188 | info->fix.visual = FB_VISUAL_MONO01; | 188 | info->fix.visual = FB_VISUAL_MONO01; |
| @@ -430,6 +430,7 @@ static int chipsfb_pci_init(struct pci_dev *dp, const struct pci_device_id *ent) · 429 unmodified lines | |||
| 430 | err_release_fb: | 430 | err_release_fb: |
| 431 | framebuffer_release(p); | 431 | framebuffer_release(p); |
| 432 | err_disable: | 432 | err_disable: |
| 433 | pci_disable_device(dp); | ||
| 433 | err_out: | 434 | err_out: |
| 434 | return rc; | 435 | return rc; |
| 435 | } | 436 | } |
| @@ -1999,7 +1999,7 @@ static int cirrusfb_set_fbinfo(struct fb_info *info) · 1998 unmodified lines | |||
| 1999 | } | 1999 | } |
| 2000 | 2000 | ||
| 2001 | /* Fill fix common fields */ | 2001 | /* Fill fix common fields */ |
| 2002 | strlcpy(info->fix.id, cirrusfb_board_info[cinfo->btype].name, | 2002 | strscpy(info->fix.id, cirrusfb_board_info[cinfo->btype].name, |
| 2003 | sizeof(info->fix.id)); | 2003 | sizeof(info->fix.id)); |
| 2004 | 2004 | ||
| 2005 | /* monochrome: only 1 memory plane */ | 2005 | /* monochrome: only 1 memory plane */ |
| @@ -326,7 +326,7 @@ static int clps711x_fb_probe(struct platform_device *pdev) · 325 unmodified lines | |||
| 326 | info->var.vmode = FB_VMODE_NONINTERLACED; | 326 | info->var.vmode = FB_VMODE_NONINTERLACED; |
| 327 | info->fix.type = FB_TYPE_PACKED_PIXELS; | 327 | info->fix.type = FB_TYPE_PACKED_PIXELS; |
| 328 | info->fix.accel = FB_ACCEL_NONE; | 328 | info->fix.accel = FB_ACCEL_NONE; |
| 329 | strlcpy(info->fix.id, CLPS711X_FB_NAME, sizeof(info->fix.id)); | 329 | strscpy(info->fix.id, CLPS711X_FB_NAME, sizeof(info->fix.id)); |
| 330 | fb_videomode_to_var(&info->var, &cfb->mode); | 330 | fb_videomode_to_var(&info->var, &cfb->mode); |
| 331 | 331 | ||
| 332 | ret = fb_alloc_cmap(&info->cmap, BIT(CLPS711X_FB_BPP_MAX), 0); | 332 | ret = fb_alloc_cmap(&info->cmap, BIT(CLPS711X_FB_BPP_MAX), 0); |
| @@ -412,7 +412,7 @@ static int __init fb_console_setup(char *this_opt) · 411 unmodified lines | |||
| 412 | 412 | ||
| 413 | while ((options = strsep(&this_opt, ",")) != NULL) { | 413 | while ((options = strsep(&this_opt, ",")) != NULL) { |
| 414 | if (!strncmp(options, "font:", 5)) { | 414 | if (!strncmp(options, "font:", 5)) { |
| 415 | strlcpy(fontname, options + 5, sizeof(fontname)); | 415 | strscpy(fontname, options + 5, sizeof(fontname)); |
| 416 | continue; | 416 | continue; |
| 417 | } | 417 | } |
| 418 | 418 | ||
| @@ -2401,15 +2401,21 @@ static int fbcon_do_set_font(struct vc_data *vc, int w, int h, int charcount, · 1982 unmodified lines | |||
| 2401 | struct fb_info *info = fbcon_info_from_console(vc->vc_num); | 2401 | struct fb_info *info = fbcon_info_from_console(vc->vc_num); |
| 2402 | struct fbcon_ops *ops = info->fbcon_par; | 2402 | struct fbcon_ops *ops = info->fbcon_par; |
| 2403 | struct fbcon_display *p = &fb_display[vc->vc_num]; | 2403 | struct fbcon_display *p = &fb_display[vc->vc_num]; |
| 2404 | int resize; | 2404 | int resize, ret, old_userfont, old_width, old_height, old_charcount; |
| 2405 | char *old_data = NULL; | 2405 | char *old_data = NULL; |
| 2406 | 2406 | ||
| 2407 | resize = (w != vc->vc_font.width) || (h != vc->vc_font.height); | 2407 | resize = (w != vc->vc_font.width) || (h != vc->vc_font.height); |
| 2408 | if (p->userfont) | 2408 | if (p->userfont) |
| 2409 | old_data = vc->vc_font.data; | 2409 | old_data = vc->vc_font.data; |
| 2410 | vc->vc_font.data = (void *)(p->fontdata = data); | 2410 | vc->vc_font.data = (void *)(p->fontdata = data); |
| 2411 | old_userfont = p->userfont; | ||
| 2411 | if ((p->userfont = userfont)) | 2412 | if ((p->userfont = userfont)) |
| 2412 | REFCOUNT(data)++; | 2413 | REFCOUNT(data)++; |
| 2414 | |||
| 2415 | old_width = vc->vc_font.width; | ||
| 2416 | old_height = vc->vc_font.height; | ||
| 2417 | old_charcount = vc->vc_font.charcount; | ||
| 2418 | |||
| 2413 | vc->vc_font.width = w; | 2419 | vc->vc_font.width = w; |
| 2414 | vc->vc_font.height = h; | 2420 | vc->vc_font.height = h; |
| 2415 | vc->vc_font.charcount = charcount; | 2421 | vc->vc_font.charcount = charcount; |
| @@ -2425,7 +2431,9 @@ static int fbcon_do_set_font(struct vc_data *vc, int w, int h, int charcount, · 9 unmodified lines | |||
| 2425 | rows = FBCON_SWAP(ops->rotate, info->var.yres, info->var.xres); | 2431 | rows = FBCON_SWAP(ops->rotate, info->var.yres, info->var.xres); |
| 2426 | cols /= w; | 2432 | cols /= w; |
| 2427 | rows /= h; | 2433 | rows /= h; |
| 2428 | vc_resize(vc, cols, rows); | 2434 | ret = vc_resize(vc, cols, rows); |
| 2435 | if (ret) | ||
| 2436 | goto err_out; | ||
| 2429 | } else if (con_is_visible(vc) | 2437 | } else if (con_is_visible(vc) |
| 2430 | && vc->vc_mode == KD_TEXT) { | 2438 | && vc->vc_mode == KD_TEXT) { |
| 2431 | fbcon_clear_margins(vc, 0); | 2439 | fbcon_clear_margins(vc, 0); |
| @@ -2435,6 +2443,21 @@ static int fbcon_do_set_font(struct vc_data *vc, int w, int h, int charcount, · 3 unmodified lines | |||
| 2435 | if (old_data && (--REFCOUNT(old_data) == 0)) | 2443 | if (old_data && (--REFCOUNT(old_data) == 0)) |
| 2436 | kfree(old_data - FONT_EXTRA_WORDS * sizeof(int)); | 2444 | kfree(old_data - FONT_EXTRA_WORDS * sizeof(int)); |
| 2437 | return 0; | 2445 | return 0; |
| 2446 | |||
| 2447 | err_out: | ||
| 2448 | p->fontdata = old_data; | ||
| 2449 | vc->vc_font.data = (void *)old_data; | ||
| 2450 | |||
| 2451 | if (userfont) { | ||
| 2452 | p->userfont = old_userfont; | ||
| 2453 | REFCOUNT(data)--; | ||
| 2454 | } | ||
| 2455 | |||
| 2456 | vc->vc_font.width = old_width; | ||
| 2457 | vc->vc_font.height = old_height; | ||
| 2458 | vc->vc_font.charcount = old_charcount; | ||
| 2459 | |||
| 2460 | return ret; | ||
| 2438 | } | 2461 | } |
| 2439 | 2462 | ||
| 2440 | /* | 2463 | /* |
| @@ -84,6 +84,10 @@ void framebuffer_release(struct fb_info *info) · 83 unmodified lines | |||
| 84 | if (WARN_ON(refcount_read(&info->count))) | 84 | if (WARN_ON(refcount_read(&info->count))) |
| 85 | return; | 85 | return; |
| 86 | 86 | ||
| 87 | #if IS_ENABLED(CONFIG_FB_BACKLIGHT) | ||
| 88 | mutex_destroy(&info->bl_curve_mutex); | ||
| 89 | #endif | ||
| 90 | |||
| 87 | kfree(info->apertures); | 91 | kfree(info->apertures); |
| 88 | kfree(info); | 92 | kfree(info); |
| 89 | } | 93 | } |
| @@ -1134,7 +1134,7 @@ int cyber2000fb_attach(struct cyberpro_info *info, int idx) · 1133 unmodified lines | |||
| 1134 | info->fb_size = int_cfb_info->fb.fix.smem_len; | 1134 | info->fb_size = int_cfb_info->fb.fix.smem_len; |
| 1135 | info->info = int_cfb_info; | 1135 | info->info = int_cfb_info; |
| 1136 | 1136 | ||
| 1137 | strlcpy(info->dev_name, int_cfb_info->fb.fix.id, | 1137 | strscpy(info->dev_name, int_cfb_info->fb.fix.id, |
| 1138 | sizeof(info->dev_name)); | 1138 | sizeof(info->dev_name)); |
| 1139 | } | 1139 | } |
| 1140 | 1140 | ||
| @@ -1229,7 +1229,7 @@ static int cyber2000fb_ddc_getsda(void *data) · 88 unmodified lines | |||
| 1229 | 1229 | ||
| 1230 | static int cyber2000fb_setup_ddc_bus(struct cfb_info *cfb) | 1230 | static int cyber2000fb_setup_ddc_bus(struct cfb_info *cfb) |
| 1231 | { | 1231 | { |
| 1232 | strlcpy(cfb->ddc_adapter.name, cfb->fb.fix.id, | 1232 | strscpy(cfb->ddc_adapter.name, cfb->fb.fix.id, |
| 1233 | sizeof(cfb->ddc_adapter.name)); | 1233 | sizeof(cfb->ddc_adapter.name)); |
| 1234 | cfb->ddc_adapter.owner = THIS_MODULE; | 1234 | cfb->ddc_adapter.owner = THIS_MODULE; |
| 1235 | cfb->ddc_adapter.class = I2C_CLASS_DDC; | 1235 | cfb->ddc_adapter.class = I2C_CLASS_DDC; |
| @@ -1304,7 +1304,7 @@ static int cyber2000fb_i2c_getscl(void *data) · 68 unmodified lines | |||
| 1304 | 1304 | ||
| 1305 | static int cyber2000fb_i2c_register(struct cfb_info *cfb) | 1305 | static int cyber2000fb_i2c_register(struct cfb_info *cfb) |
| 1306 | { | 1306 | { |
| 1307 | strlcpy(cfb->i2c_adapter.name, cfb->fb.fix.id, | 1307 | strscpy(cfb->i2c_adapter.name, cfb->fb.fix.id, |
| 1308 | sizeof(cfb->i2c_adapter.name)); | 1308 | sizeof(cfb->i2c_adapter.name)); |
| 1309 | cfb->i2c_adapter.owner = THIS_MODULE; | 1309 | cfb->i2c_adapter.owner = THIS_MODULE; |
| 1310 | cfb->i2c_adapter.algo_data = &cfb->i2c_algo; | 1310 | cfb->i2c_adapter.algo_data = &cfb->i2c_algo; |
| @@ -1500,7 +1500,7 @@ static int cyber2000fb_setup(char *options) · 189 unmodified lines | |||
| 1500 | if (strncmp(opt, "font:", 5) == 0) { | 1500 | if (strncmp(opt, "font:", 5) == 0) { |
| 1501 | static char default_font_storage[40]; | 1501 | static char default_font_storage[40]; |
| 1502 | 1502 | ||
| 1503 | strlcpy(default_font_storage, opt + 5, | 1503 | strscpy(default_font_storage, opt + 5, |
| 1504 | sizeof(default_font_storage)); | 1504 | sizeof(default_font_storage)); |
| 1505 | default_font = default_font_storage; | 1505 | default_font = default_font_storage; |
| 1506 | continue; | 1506 | continue; |
| @@ -883,7 +883,7 @@ static void ffb_init_fix(struct fb_info *info) · 882 unmodified lines | |||
| 883 | } else | 883 | } else |
| 884 | ffb_type_name = "Elite 3D"; | 884 | ffb_type_name = "Elite 3D"; |
| 885 | 885 | ||
| 886 | strlcpy(info->fix.id, ffb_type_name, sizeof(info->fix.id)); | 886 | strscpy(info->fix.id, ffb_type_name, sizeof(info->fix.id)); |
| 887 | 887 | ||
| 888 | info->fix.type = FB_TYPE_PACKED_PIXELS; | 888 | info->fix.type = FB_TYPE_PACKED_PIXELS; |
| 889 | info->fix.visual = FB_VISUAL_TRUECOLOR; | 889 | info->fix.visual = FB_VISUAL_TRUECOLOR; |
| @@ -410,13 +410,13 @@ static void __init gx1fb_setup(char *options) · 409 unmodified lines | |||
| 410 | continue; | 410 | continue; |
| 411 | 411 | ||
| 412 | if (!strncmp(this_opt, "mode:", 5)) | 412 | if (!strncmp(this_opt, "mode:", 5)) |
| 413 | strlcpy(mode_option, this_opt + 5, sizeof(mode_option)); | 413 | strscpy(mode_option, this_opt + 5, sizeof(mode_option)); |
| 414 | else if (!strncmp(this_opt, "crt:", 4)) | 414 | else if (!strncmp(this_opt, "crt:", 4)) |
| 415 | crt_option = !!simple_strtoul(this_opt + 4, NULL, 0); | 415 | crt_option = !!simple_strtoul(this_opt + 4, NULL, 0); |
| 416 | else if (!strncmp(this_opt, "panel:", 6)) | 416 | else if (!strncmp(this_opt, "panel:", 6)) |
| 417 | strlcpy(panel_option, this_opt + 6, sizeof(panel_option)); | 417 | strscpy(panel_option, this_opt + 6, sizeof(panel_option)); |
| 418 | else | 418 | else |
| 419 | strlcpy(mode_option, this_opt, sizeof(mode_option)); | 419 | strscpy(mode_option, this_opt, sizeof(mode_option)); |
| 420 | } | 420 | } |
| 421 | } | 421 | } |
| 422 | #endif | 422 | #endif |
| @@ -650,7 +650,7 @@ static int gxt4500_probe(struct pci_dev *pdev, const struct pci_device_id *ent) · 649 unmodified lines | |||
| 650 | cardtype = ent->driver_data; | 650 | cardtype = ent->driver_data; |
| 651 | par->refclk_ps = cardinfo[cardtype].refclk_ps; | 651 | par->refclk_ps = cardinfo[cardtype].refclk_ps; |
| 652 | info->fix = gxt4500_fix; | 652 | info->fix = gxt4500_fix; |
| 653 | strlcpy(info->fix.id, cardinfo[cardtype].cardname, | 653 | strscpy(info->fix.id, cardinfo[cardtype].cardname, |
| 654 | sizeof(info->fix.id)); | 654 | sizeof(info->fix.id)); |
| 655 | info->pseudo_palette = par->pseudo_palette; | 655 | info->pseudo_palette = par->pseudo_palette; |
| 656 | 656 | ||
| @@ -159,7 +159,7 @@ static int i740fb_setup_ddc_bus(struct fb_info *info) · 158 unmodified lines | |||
| 159 | { | 159 | { |
| 160 | struct i740fb_par *par = info->par; | 160 | struct i740fb_par *par = info->par; |
| 161 | 161 | ||
| 162 | strlcpy(par->ddc_adapter.name, info->fix.id, | 162 | strscpy(par->ddc_adapter.name, info->fix.id, |
| 163 | sizeof(par->ddc_adapter.name)); | 163 | sizeof(par->ddc_adapter.name)); |
| 164 | par->ddc_adapter.owner = THIS_MODULE; | 164 | par->ddc_adapter.owner = THIS_MODULE; |
| 165 | par->ddc_adapter.class = I2C_CLASS_DDC; | 165 | par->ddc_adapter.class = I2C_CLASS_DDC; |
| @@ -681,7 +681,7 @@ static int imxfb_init_fbinfo(struct platform_device *pdev) · 680 unmodified lines | |||
| 681 | 681 | ||
| 682 | fbi->devtype = pdev->id_entry->driver_data; | 682 | fbi->devtype = pdev->id_entry->driver_data; |
| 683 | 683 | ||
| 684 | strlcpy(info->fix.id, IMX_NAME, sizeof(info->fix.id)); | 684 | strscpy(info->fix.id, IMX_NAME, sizeof(info->fix.id)); |
| 685 | 685 | ||
| 686 | info->fix.type = FB_TYPE_PACKED_PIXELS; | 686 | info->fix.type = FB_TYPE_PACKED_PIXELS; |
| 687 | info->fix.type_aux = 0; | 687 | info->fix.type_aux = 0; |
| @@ -2383,9 +2383,9 @@ static int __init matroxfb_setup(char *options) { · 2382 unmodified lines | |||
| 2383 | else if (!strncmp(this_opt, "mem:", 4)) | 2383 | else if (!strncmp(this_opt, "mem:", 4)) |
| 2384 | mem = simple_strtoul(this_opt+4, NULL, 0); | 2384 | mem = simple_strtoul(this_opt+4, NULL, 0); |
| 2385 | else if (!strncmp(this_opt, "mode:", 5)) | 2385 | else if (!strncmp(this_opt, "mode:", 5)) |
| 2386 | strlcpy(videomode, this_opt+5, sizeof(videomode)); | 2386 | strscpy(videomode, this_opt + 5, sizeof(videomode)); |
| 2387 | else if (!strncmp(this_opt, "outputs:", 8)) | 2387 | else if (!strncmp(this_opt, "outputs:", 8)) |
| 2388 | strlcpy(outputs, this_opt+8, sizeof(outputs)); | 2388 | strscpy(outputs, this_opt + 8, sizeof(outputs)); |
| 2389 | else if (!strncmp(this_opt, "dfp:", 4)) { | 2389 | else if (!strncmp(this_opt, "dfp:", 4)) { |
| 2390 | dfp_type = simple_strtoul(this_opt+4, NULL, 0); | 2390 | dfp_type = simple_strtoul(this_opt+4, NULL, 0); |
| 2391 | dfp = 1; | 2391 | dfp = 1; |
| @@ -2455,7 +2455,7 @@ static int __init matroxfb_setup(char *options) { · 63 unmodified lines | |||
| 2455 | else if (!strcmp(this_opt, "dfp")) | 2455 | else if (!strcmp(this_opt, "dfp")) |
| 2456 | dfp = value; | 2456 | dfp = value; |
| 2457 | else { | 2457 | else { |
| 2458 | strlcpy(videomode, this_opt, sizeof(videomode)); | 2458 | strscpy(videomode, this_opt, sizeof(videomode)); |
| 2459 | } | 2459 | } |
| 2460 | } | 2460 | } |
| 2461 | } | 2461 | } |
| @@ -1642,15 +1642,13 @@ static int omapfb_do_probe(struct platform_device *pdev, · 1641 unmodified lines | |||
| 1642 | goto cleanup; | 1642 | goto cleanup; |
| 1643 | } | 1643 | } |
| 1644 | fbdev->int_irq = platform_get_irq(pdev, 0); | 1644 | fbdev->int_irq = platform_get_irq(pdev, 0); |
| 1645 | if (!fbdev->int_irq) { | 1645 | if (fbdev->int_irq < 0) { |
| 1646 | dev_err(&pdev->dev, "unable to get irq\n"); | ||
| 1647 | r = ENXIO; | 1646 | r = ENXIO; |
| 1648 | goto cleanup; | 1647 | goto cleanup; |
| 1649 | } | 1648 | } |
| 1650 | 1649 | ||
| 1651 | fbdev->ext_irq = platform_get_irq(pdev, 1); | 1650 | fbdev->ext_irq = platform_get_irq(pdev, 1); |
| 1652 | if (!fbdev->ext_irq) { | 1651 | if (fbdev->ext_irq < 0) { |
| 1653 | dev_err(&pdev->dev, "unable to get irq\n"); | ||
| 1654 | r = ENXIO; | 1652 | r = ENXIO; |
| 1655 | goto cleanup; | 1653 | goto cleanup; |
| 1656 | } | 1654 | } |
| @@ -1331,7 +1331,7 @@ static void clear_fb_info(struct fb_info *fbi) · 1330 unmodified lines | |||
| 1331 | { | 1331 | { |
| 1332 | memset(&fbi->var, 0, sizeof(fbi->var)); | 1332 | memset(&fbi->var, 0, sizeof(fbi->var)); |
| 1333 | memset(&fbi->fix, 0, sizeof(fbi->fix)); | 1333 | memset(&fbi->fix, 0, sizeof(fbi->fix)); |
| 1334 | strlcpy(fbi->fix.id, MODULE_NAME, sizeof(fbi->fix.id)); | 1334 | strscpy(fbi->fix.id, MODULE_NAME, sizeof(fbi->fix.id)); |
| 1335 | } | 1335 | } |
| 1336 | 1336 | ||
| 1337 | static int omapfb_free_all_fbmem(struct omapfb2_device *fbdev) | 1337 | static int omapfb_free_all_fbmem(struct omapfb2_device *fbdev) |
| @@ -617,6 +617,11 @@ static int pm2fb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) · 616 unmodified lines | |||
| 617 | return -EINVAL; | 617 | return -EINVAL; |
| 618 | } | 618 | } |
| 619 | 619 | ||
| 620 | if (!var->pixclock) { | ||
| 621 | DPRINTK("pixclock is zero\n"); | ||
| 622 | return -EINVAL; | ||
| 623 | } | ||
| 624 | |||
| 620 | if (PICOS2KHZ(var->pixclock) > PM2_MAX_PIXCLOCK) { | 625 | if (PICOS2KHZ(var->pixclock) > PM2_MAX_PIXCLOCK) { |
| 621 | DPRINTK("pixclock too high (%ldKHz)\n", | 626 | DPRINTK("pixclock too high (%ldKHz)\n", |
| 622 | PICOS2KHZ(var->pixclock)); | 627 | PICOS2KHZ(var->pixclock)); |
| @@ -640,7 +640,7 @@ static int pxa168fb_probe(struct platform_device *pdev) · 639 unmodified lines | |||
| 640 | info->flags = FBINFO_DEFAULT | FBINFO_PARTIAL_PAN_OK | | 640 | info->flags = FBINFO_DEFAULT | FBINFO_PARTIAL_PAN_OK | |
| 641 | FBINFO_HWACCEL_XPAN | FBINFO_HWACCEL_YPAN; | 641 | FBINFO_HWACCEL_XPAN | FBINFO_HWACCEL_YPAN; |
| 642 | info->node = -1; | 642 | info->node = -1; |
| 643 | strlcpy(info->fix.id, mi->id, 16); | 643 | strscpy(info->fix.id, mi->id, 16); |
| 644 | info->fix.type = FB_TYPE_PACKED_PIXELS; | 644 | info->fix.type = FB_TYPE_PACKED_PIXELS; |
| 645 | info->fix.type_aux = 0; | 645 | info->fix.type_aux = 0; |
| 646 | info->fix.xpanstep = 0; | 646 | info->fix.xpanstep = 0; |
| @@ -2042,7 +2042,7 @@ static int __init pxafb_setup_options(void) · 2041 unmodified lines | |||
| 2042 | return -ENODEV; | 2042 | return -ENODEV; |
| 2043 | 2043 | ||
| 2044 | if (options) | 2044 | if (options) |
| 2045 | strlcpy(g_options, options, sizeof(g_options)); | 2045 | strscpy(g_options, options, sizeof(g_options)); |
| 2046 | 2046 | ||
| 2047 | return 0; | 2047 | return 0; |
| 2048 | } | 2048 | } |
| @@ -248,7 +248,7 @@ static int s3fb_setup_ddc_bus(struct fb_info *info) · 247 unmodified lines | |||
| 248 | { | 248 | { |
| 249 | struct s3fb_info *par = info->par; | 249 | struct s3fb_info *par = info->par; |
| 250 | 250 | ||
| 251 | strlcpy(par->ddc_adapter.name, info->fix.id, | 251 | strscpy(par->ddc_adapter.name, info->fix.id, |
| 252 | sizeof(par->ddc_adapter.name)); | 252 | sizeof(par->ddc_adapter.name)); |
| 253 | par->ddc_adapter.owner = THIS_MODULE; | 253 | par->ddc_adapter.owner = THIS_MODULE; |
| 254 | par->ddc_adapter.class = I2C_CLASS_DDC; | 254 | par->ddc_adapter.class = I2C_CLASS_DDC; |
| @@ -355,7 +355,7 @@ static int simplefb_regulators_get(struct simplefb_par *par, · 354 unmodified lines | |||
| 355 | if (!p || p == prop->name) | 355 | if (!p || p == prop->name) |
| 356 | continue; | 356 | continue; |
| 357 | 357 | ||
| 358 | strlcpy(name, prop->name, | 358 | strscpy(name, prop->name, |
| 359 | strlen(prop->name) - strlen(SUPPLY_SUFFIX) + 1); | 359 | strlen(prop->name) - strlen(SUPPLY_SUFFIX) + 1); |
| 360 | regulator = devm_regulator_get_optional(&pdev->dev, name); | 360 | regulator = devm_regulator_get_optional(&pdev->dev, name); |
| 361 | if (IS_ERR(regulator)) { | 361 | if (IS_ERR(regulator)) { |
| @@ -649,37 +649,37 @@ sisfb_validate_mode(struct sis_video_info *ivideo, int myindex, u32 vbflags) · 648 unmodified lines | |||
| 649 | u16 xres=0, yres, myres; | 649 | u16 xres=0, yres, myres; |
| 650 | 650 | ||
| 651 | #ifdef CONFIG_FB_SIS_300 | 651 | #ifdef CONFIG_FB_SIS_300 |
| 652 | if(ivideo->sisvga_engine == SIS_300_VGA) { | 652 | if (ivideo->sisvga_engine == SIS_300_VGA) { |
| 653 | if(!(sisbios_mode[myindex].chipset & MD_SIS300)) | 653 | if (!(sisbios_mode[myindex].chipset & MD_SIS300)) |
| 654 | return -1 ; | 654 | return -1 ; |
| 655 | } | 655 | } |
| 656 | #endif | 656 | #endif |
| 657 | #ifdef CONFIG_FB_SIS_315 | 657 | #ifdef CONFIG_FB_SIS_315 |
| 658 | if(ivideo->sisvga_engine == SIS_315_VGA) { | 658 | if (ivideo->sisvga_engine == SIS_315_VGA) { |
| 659 | if(!(sisbios_mode[myindex].chipset & MD_SIS315)) | 659 | if (!(sisbios_mode[myindex].chipset & MD_SIS315)) |
| 660 | return -1; | 660 | return -1; |
| 661 | } | 661 | } |
| 662 | #endif | 662 | #endif |
| 663 | 663 | ||
| 664 | myres = sisbios_mode[myindex].yres; | 664 | myres = sisbios_mode[myindex].yres; |
| 665 | 665 | ||
| 666 | switch(vbflags & VB_DISPTYPE_DISP2) { | 666 | switch (vbflags & VB_DISPTYPE_DISP2) { |
| 667 | 667 | ||
| 668 | case CRT2_LCD: | 668 | case CRT2_LCD: |
| 669 | xres = ivideo->lcdxres; yres = ivideo->lcdyres; | 669 | xres = ivideo->lcdxres; yres = ivideo->lcdyres; |
| 670 | 670 | ||
| 671 | if((ivideo->SiS_Pr.SiS_CustomT != CUT_PANEL848) && | 671 | if ((ivideo->SiS_Pr.SiS_CustomT != CUT_PANEL848) && |
| 672 | (ivideo->SiS_Pr.SiS_CustomT != CUT_PANEL856)) { | 672 | (ivideo->SiS_Pr.SiS_CustomT != CUT_PANEL856)) { |
| 673 | if(sisbios_mode[myindex].xres > xres) | 673 | if (sisbios_mode[myindex].xres > xres) |
| 674 | return -1; | 674 | return -1; |
| 675 | if(myres > yres) | 675 | if (myres > yres) |
| 676 | return -1; | 676 | return -1; |
| 677 | } | 677 | } |
| 678 | 678 | ||
| 679 | if(ivideo->sisfb_fstn) { | 679 | if (ivideo->sisfb_fstn) { |
| 680 | if(sisbios_mode[myindex].xres == 320) { | 680 | if (sisbios_mode[myindex].xres == 320) { |
| 681 | if(myres == 240) { | 681 | if (myres == 240) { |
| 682 | switch(sisbios_mode[myindex].mode_no[1]) { | 682 | switch (sisbios_mode[myindex].mode_no[1]) { |
| 683 | case 0x50: myindex = MODE_FSTN_8; break; | 683 | case 0x50: myindex = MODE_FSTN_8; break; |
| 684 | case 0x56: myindex = MODE_FSTN_16; break; | 684 | case 0x56: myindex = MODE_FSTN_16; break; |
| 685 | case 0x53: return -1; | 685 | case 0x53: return -1; |
| @@ -688,7 +688,7 @@ sisfb_validate_mode(struct sis_video_info *ivideo, int myindex, u32 vbflags) · 2 unmodified lines | |||
| 688 | } | 688 | } |
| 689 | } | 689 | } |
| 690 | 690 | ||
| 691 | if(SiS_GetModeID_LCD(ivideo->sisvga_engine, vbflags, sisbios_mode[myindex].xres, | 691 | if (SiS_GetModeID_LCD(ivideo->sisvga_engine, vbflags, sisbios_mode[myindex].xres, |
| 692 | sisbios_mode[myindex].yres, 0, ivideo->sisfb_fstn, | 692 | sisbios_mode[myindex].yres, 0, ivideo->sisfb_fstn, |
| 693 | ivideo->SiS_Pr.SiS_CustomT, xres, yres, ivideo->vbflags2) < 0x14) { | 693 | ivideo->SiS_Pr.SiS_CustomT, xres, yres, ivideo->vbflags2) < 0x14) { |
| 694 | return -1; | 694 | return -1; |
| @@ -696,14 +696,14 @@ sisfb_validate_mode(struct sis_video_info *ivideo, int myindex, u32 vbflags) · 1 unmodified line | |||
| 696 | break; | 696 | break; |
| 697 | 697 | ||
| 698 | case CRT2_TV: | 698 | case CRT2_TV: |
| 699 | if(SiS_GetModeID_TV(ivideo->sisvga_engine, vbflags, sisbios_mode[myindex].xres, | 699 | if (SiS_GetModeID_TV(ivideo->sisvga_engine, vbflags, sisbios_mode[myindex].xres, |
| 700 | sisbios_mode[myindex].yres, 0, ivideo->vbflags2) < 0x14) { | 700 | sisbios_mode[myindex].yres, 0, ivideo->vbflags2) < 0x14) { |
| 701 | return -1; | 701 | return -1; |
| 702 | } | 702 | } |
| 703 | break; | 703 | break; |
| 704 | 704 | ||
| 705 | case CRT2_VGA: | 705 | case CRT2_VGA: |
| 706 | if(SiS_GetModeID_VGA2(ivideo->sisvga_engine, vbflags, sisbios_mode[myindex].xres, | 706 | if (SiS_GetModeID_VGA2(ivideo->sisvga_engine, vbflags, sisbios_mode[myindex].xres, |
| 707 | sisbios_mode[myindex].yres, 0, ivideo->vbflags2) < 0x14) { | 707 | sisbios_mode[myindex].yres, 0, ivideo->vbflags2) < 0x14) { |
| 708 | return -1; | 708 | return -1; |
| 709 | } | 709 | } |
| @@ -1872,7 +1872,7 @@ sisfb_get_fix(struct fb_fix_screeninfo *fix, int con, struct fb_info *info) · 1162 unmodified lines | |||
| 1872 | 1872 | ||
| 1873 | memset(fix, 0, sizeof(struct fb_fix_screeninfo)); | 1873 | memset(fix, 0, sizeof(struct fb_fix_screeninfo)); |
| 1874 | 1874 | ||
| 1875 | strlcpy(fix->id, ivideo->myid, sizeof(fix->id)); | 1875 | strscpy(fix->id, ivideo->myid, sizeof(fix->id)); |
| 1876 | 1876 | ||
| 1877 | mutex_lock(&info->mm_lock); | 1877 | mutex_lock(&info->mm_lock); |
| 1878 | fix->smem_start = ivideo->video_base + ivideo->video_offset; | 1878 | fix->smem_start = ivideo->video_base + ivideo->video_offset; |
| @@ -2204,82 +2204,88 @@ static bool sisfb_test_DDC1(struct sis_video_info *ivideo) · 325 unmodified lines | |||
| 2204 | 2204 | ||
| 2205 | static void sisfb_sense_crt1(struct sis_video_info *ivideo) | 2205 | static void sisfb_sense_crt1(struct sis_video_info *ivideo) |
| 2206 | { | 2206 | { |
| 2207 | bool mustwait = false; | 2207 | bool mustwait = false; |
| 2208 | u8 sr1F, cr17; | 2208 | u8 sr1F, cr17; |
| 2209 | #ifdef CONFIG_FB_SIS_315 | 2209 | #ifdef CONFIG_FB_SIS_315 |
| 2210 | u8 cr63=0; | 2210 | u8 cr63 = 0; |
| 2211 | #endif | 2211 | #endif |
| 2212 | u16 temp = 0xffff; | 2212 | u16 temp = 0xffff; |
| 2213 | int i; | 2213 | int i; |
| 2214 | |||
| 2215 | sr1F = SiS_GetReg(SISSR, 0x1F); | ||
| 2216 | SiS_SetRegOR(SISSR, 0x1F, 0x04); | ||
| 2217 | SiS_SetRegAND(SISSR, 0x1F, 0x3F); | ||
| 2214 | 2218 | ||
| 2215 | sr1F = SiS_GetReg(SISSR, 0x1F); | 2219 | if (sr1F & 0xc0) |
| 2216 | SiS_SetRegOR(SISSR, 0x1F, 0x04); | 2220 | mustwait = true; |
| 2217 | SiS_SetRegAND(SISSR, 0x1F, 0x3F); | ||
| 2218 | if(sr1F & 0xc0) mustwait = true; | ||
| 2219 | 2221 | ||
| 2220 | #ifdef CONFIG_FB_SIS_315 | 2222 | #ifdef CONFIG_FB_SIS_315 |
| 2221 | if(ivideo->sisvga_engine == SIS_315_VGA) { | 2223 | if (ivideo->sisvga_engine == SIS_315_VGA) { |
| 2222 | cr63 = SiS_GetReg(SISCR, ivideo->SiS_Pr.SiS_MyCR63); | 2224 | cr63 = SiS_GetReg(SISCR, ivideo->SiS_Pr.SiS_MyCR63); |
| 2223 | cr63 &= 0x40; | 2225 | cr63 &= 0x40; |
| 2224 | SiS_SetRegAND(SISCR, ivideo->SiS_Pr.SiS_MyCR63, 0xBF); | 2226 | SiS_SetRegAND(SISCR, ivideo->SiS_Pr.SiS_MyCR63, 0xBF); |
| 2225 | } | 2227 | } |
| 2226 | #endif | 2228 | #endif |
| 2227 | 2229 | ||
| 2228 | cr17 = SiS_GetReg(SISCR, 0x17); | 2230 | cr17 = SiS_GetReg(SISCR, 0x17); |
| 2229 | cr17 &= 0x80; | 2231 | cr17 &= 0x80; |
| 2230 | if(!cr17) { | ||
| 2231 | SiS_SetRegOR(SISCR, 0x17, 0x80); | ||
| 2232 | mustwait = true; | ||
| 2233 | SiS_SetReg(SISSR, 0x00, 0x01); | ||
| 2234 | SiS_SetReg(SISSR, 0x00, 0x03); | ||
| 2235 | } | ||
| 2236 | 2232 | ||
| 2237 | if(mustwait) { | 2233 | if (!cr17) { |
| 2238 | for(i=0; i < 10; i++) sisfbwaitretracecrt1(ivideo); | 2234 | SiS_SetRegOR(SISCR, 0x17, 0x80); |
| 2239 | } | 2235 | mustwait = true; |
| 2236 | SiS_SetReg(SISSR, 0x00, 0x01); | ||
| 2237 | SiS_SetReg(SISSR, 0x00, 0x03); | ||
| 2238 | } | ||
| 2240 | 2239 | ||
| 2240 | if (mustwait) { | ||
| 2241 | for (i = 0; i < 10; i++) | ||
| 2242 | sisfbwaitretracecrt1(ivideo); | ||
| 2243 | } | ||
| 2241 | #ifdef CONFIG_FB_SIS_315 | 2244 | #ifdef CONFIG_FB_SIS_315 |
| 2242 | if(ivideo->chip >= SIS_330) { | 2245 | if (ivideo->chip >= SIS_330) { |
| 2243 | SiS_SetRegAND(SISCR, 0x32, ~0x20); | 2246 | SiS_SetRegAND(SISCR, 0x32, ~0x20); |
| 2244 | if(ivideo->chip >= SIS_340) { | 2247 | if (ivideo->chip >= SIS_340) |
| 2245 | SiS_SetReg(SISCR, 0x57, 0x4a); | 2248 | SiS_SetReg(SISCR, 0x57, 0x4a); |
| 2246 | } else { | 2249 | else |
| 2247 | SiS_SetReg(SISCR, 0x57, 0x5f); | 2250 | SiS_SetReg(SISCR, 0x57, 0x5f); |
| 2248 | } | 2251 | |
| 2249 | SiS_SetRegOR(SISCR, 0x53, 0x02); | 2252 | SiS_SetRegOR(SISCR, 0x53, 0x02); |
| 2250 | while ((SiS_GetRegByte(SISINPSTAT)) & 0x01) break; | 2253 | while ((SiS_GetRegByte(SISINPSTAT)) & 0x01) |
| 2251 | while (!((SiS_GetRegByte(SISINPSTAT)) & 0x01)) break; | 2254 | break; |
| 2252 | if ((SiS_GetRegByte(SISMISCW)) & 0x10) temp = 1; | 2255 | while (!((SiS_GetRegByte(SISINPSTAT)) & 0x01)) |
| 2253 | SiS_SetRegAND(SISCR, 0x53, 0xfd); | 2256 | break; |
| 2254 | SiS_SetRegAND(SISCR, 0x57, 0x00); | 2257 | if ((SiS_GetRegByte(SISMISCW)) & 0x10) |
| 2255 | } | 2258 | temp = 1; |
| 2259 | |||
| 2260 | SiS_SetRegAND(SISCR, 0x53, 0xfd); | ||
| 2261 | SiS_SetRegAND(SISCR, 0x57, 0x00); | ||
| 2262 | } | ||
| 2256 | #endif | 2263 | #endif |
| 2257 | 2264 | ||
| 2258 | if(temp == 0xffff) { | 2265 | if (temp == 0xffff) { |
| 2259 | i = 3; | 2266 | i = 3; |
| 2260 | do { | ||
| 2261 | temp = SiS_HandleDDC(&ivideo->SiS_Pr, ivideo->vbflags, | ||
| 2262 | ivideo->sisvga_engine, 0, 0, NULL, ivideo->vbflags2); | ||
| 2263 | } while(((temp == 0) || (temp == 0xffff)) && i--); | ||
| 2264 | 2267 | ||
| 2265 | if((temp == 0) || (temp == 0xffff)) { | 2268 | do { |
| 2266 | if(sisfb_test_DDC1(ivideo)) temp = 1; | 2269 | temp = SiS_HandleDDC(&ivideo->SiS_Pr, ivideo->vbflags, |
| 2267 | } | 2270 | ivideo->sisvga_engine, 0, 0, NULL, ivideo->vbflags2); |
| 2268 | } | 2271 | } while (((temp == 0) || (temp == 0xffff)) && i--); |
| 2269 | 2272 | ||
| 2270 | if((temp) && (temp != 0xffff)) { | 2273 | if ((temp == 0) || (temp == 0xffff)) { |
| 2271 | SiS_SetRegOR(SISCR, 0x32, 0x20); | 2274 | if (sisfb_test_DDC1(ivideo)) |
| 2272 | } | 2275 | temp = 1; |
| 2276 | } | ||
| 2277 | } | ||
| 2278 | |||
| 2279 | if ((temp) && (temp != 0xffff)) | ||
| 2280 | SiS_SetRegOR(SISCR, 0x32, 0x20); | ||
| 2273 | 2281 | ||
| 2274 | #ifdef CONFIG_FB_SIS_315 | 2282 | #ifdef CONFIG_FB_SIS_315 |
| 2275 | if(ivideo->sisvga_engine == SIS_315_VGA) { | 2283 | if (ivideo->sisvga_engine == SIS_315_VGA) |
| 2276 | SiS_SetRegANDOR(SISCR, ivideo->SiS_Pr.SiS_MyCR63, 0xBF, cr63); | 2284 | SiS_SetRegANDOR(SISCR, ivideo->SiS_Pr.SiS_MyCR63, 0xBF, cr63); |
| 2277 | } | ||
| 2278 | #endif | 2285 | #endif |
| 2279 | 2286 | ||
| 2280 | SiS_SetRegANDOR(SISCR, 0x17, 0x7F, cr17); | 2287 | SiS_SetRegANDOR(SISCR, 0x17, 0x7F, cr17); |
| 2281 | 2288 | SiS_SetReg(SISSR, 0x1F, sr1F); | |
| 2282 | SiS_SetReg(SISSR, 0x1F, sr1F); | ||
| 2283 | } | 2289 | } |
| 2284 | 2290 | ||
| 2285 | /* Determine and detect attached devices on SiS30x */ | 2291 | /* Determine and detect attached devices on SiS30x */ |
| @@ -2293,25 +2299,25 @@ static void SiS_SenseLCD(struct sis_video_info *ivideo) · 7 unmodified lines | |||
| 2293 | ivideo->SiS_Pr.PanelSelfDetected = false; | 2299 | ivideo->SiS_Pr.PanelSelfDetected = false; |
| 2294 | 2300 | ||
| 2295 | /* LCD detection only for TMDS bridges */ | 2301 | /* LCD detection only for TMDS bridges */ |
| 2296 | if(!(ivideo->vbflags2 & VB2_SISTMDSBRIDGE)) | 2302 | if (!(ivideo->vbflags2 & VB2_SISTMDSBRIDGE)) |
| 2297 | return; | 2303 | return; |
| 2298 | if(ivideo->vbflags2 & VB2_30xBDH) | 2304 | if (ivideo->vbflags2 & VB2_30xBDH) |
| 2299 | return; | 2305 | return; |
| 2300 | 2306 | ||
| 2301 | /* If LCD already set up by BIOS, skip it */ | 2307 | /* If LCD already set up by BIOS, skip it */ |
| 2302 | reg = SiS_GetReg(SISCR, 0x32); | 2308 | reg = SiS_GetReg(SISCR, 0x32); |
| 2303 | if(reg & 0x08) | 2309 | if (reg & 0x08) |
| 2304 | return; | 2310 | return; |
| 2305 | 2311 | ||
| 2306 | realcrtno = 1; | 2312 | realcrtno = 1; |
| 2307 | if(ivideo->SiS_Pr.DDCPortMixup) | 2313 | if (ivideo->SiS_Pr.DDCPortMixup) |
| 2308 | realcrtno = 0; | 2314 | realcrtno = 0; |
| 2309 | 2315 | ||
| 2310 | /* Check DDC capabilities */ | 2316 | /* Check DDC capabilities */ |
| 2311 | temp = SiS_HandleDDC(&ivideo->SiS_Pr, ivideo->vbflags, ivideo->sisvga_engine, | 2317 | temp = SiS_HandleDDC(&ivideo->SiS_Pr, ivideo->vbflags, ivideo->sisvga_engine, |
| 2312 | realcrtno, 0, &buffer[0], ivideo->vbflags2); | 2318 | realcrtno, 0, &buffer[0], ivideo->vbflags2); |
| 2313 | 2319 | ||
| 2314 | if((!temp) || (temp == 0xffff) || (!(temp & 0x02))) | 2320 | if ((!temp) || (temp == 0xffff) || (!(temp & 0x02))) |
| 2315 | return; | 2321 | return; |
| 2316 | 2322 | ||
| 2317 | /* Read DDC data */ | 2323 | /* Read DDC data */ |
| @@ -2320,17 +2326,17 @@ static void SiS_SenseLCD(struct sis_video_info *ivideo) · 2 unmodified lines | |||
| 2320 | temp = SiS_HandleDDC(&ivideo->SiS_Pr, ivideo->vbflags, | 2326 | temp = SiS_HandleDDC(&ivideo->SiS_Pr, ivideo->vbflags, |
| 2321 | ivideo->sisvga_engine, realcrtno, 1, | 2327 | ivideo->sisvga_engine, realcrtno, 1, |
| 2322 | &buffer[0], ivideo->vbflags2); | 2328 | &buffer[0], ivideo->vbflags2); |
| 2323 | } while((temp) && i--); | 2329 | } while ((temp) && i--); |
| 2324 | 2330 | ||
| 2325 | if(temp) | 2331 | if (temp) |
| 2326 | return; | 2332 | return; |
| 2327 | 2333 | ||
| 2328 | /* No digital device */ | 2334 | /* No digital device */ |
| 2329 | if(!(buffer[0x14] & 0x80)) | 2335 | if (!(buffer[0x14] & 0x80)) |
| 2330 | return; | 2336 | return; |
| 2331 | 2337 | ||
| 2332 | /* First detailed timing preferred timing? */ | 2338 | /* First detailed timing preferred timing? */ |
| 2333 | if(!(buffer[0x18] & 0x02)) | 2339 | if (!(buffer[0x18] & 0x02)) |
| 2334 | return; | 2340 | return; |
| 2335 | 2341 | ||
| 2336 | xres = buffer[0x38] | ((buffer[0x3a] & 0xf0) << 4); | 2342 | xres = buffer[0x38] | ((buffer[0x3a] & 0xf0) << 4); |
| @@ -2338,26 +2344,26 @@ static void SiS_SenseLCD(struct sis_video_info *ivideo) · 1 unmodified line | |||
| 2338 | 2344 | ||
| 2339 | switch(xres) { | 2345 | switch(xres) { |
| 2340 | case 1024: | 2346 | case 1024: |
| 2341 | if(yres == 768) | 2347 | if (yres == 768) |
| 2342 | paneltype = 0x02; | 2348 | paneltype = 0x02; |
| 2343 | break; | 2349 | break; |
| 2344 | case 1280: | 2350 | case 1280: |
| 2345 | if(yres == 1024) | 2351 | if (yres == 1024) |
| 2346 | paneltype = 0x03; | 2352 | paneltype = 0x03; |
| 2347 | break; | 2353 | break; |
| 2348 | case 1600: | 2354 | case 1600: |
| 2349 | if((yres == 1200) && (ivideo->vbflags2 & VB2_30xC)) | 2355 | if ((yres == 1200) && (ivideo->vbflags2 & VB2_30xC)) |
| 2350 | paneltype = 0x0b; | 2356 | paneltype = 0x0b; |
| 2351 | break; | 2357 | break; |
| 2352 | } | 2358 | } |
| 2353 | 2359 | ||
| 2354 | if(!paneltype) | 2360 | if (!paneltype) |
| 2355 | return; | 2361 | return; |
| 2356 | 2362 | ||
| 2357 | if(buffer[0x23]) | 2363 | if (buffer[0x23]) |
| 2358 | cr37 |= 0x10; | 2364 | cr37 |= 0x10; |
| 2359 | 2365 | ||
| 2360 | if((buffer[0x47] & 0x18) == 0x18) | 2366 | if ((buffer[0x47] & 0x18) == 0x18) |
| 2361 | cr37 |= ((((buffer[0x47] & 0x06) ^ 0x06) << 5) | 0x20); | 2367 | cr37 |= ((((buffer[0x47] & 0x06) ^ 0x06) << 5) | 0x20); |
| 2362 | else | 2368 | else |
| 2363 | cr37 |= 0xc0; | 2369 | cr37 |= 0xc0; |
| @@ -2372,31 +2378,34 @@ static void SiS_SenseLCD(struct sis_video_info *ivideo) · 8 unmodified lines | |||
| 2372 | 2378 | ||
| 2373 | static int SISDoSense(struct sis_video_info *ivideo, u16 type, u16 test) | 2379 | static int SISDoSense(struct sis_video_info *ivideo, u16 type, u16 test) |
| 2374 | { | 2380 | { |
| 2375 | int temp, mytest, result, i, j; | 2381 | int temp, mytest, result, i, j; |
| 2376 | 2382 | ||
| 2377 | for(j = 0; j < 10; j++) { | 2383 | for (j = 0; j < 10; j++) { |
| 2378 | result = 0; | 2384 | result = 0; |
| 2379 | for(i = 0; i < 3; i++) { | 2385 | for (i = 0; i < 3; i++) { |
| 2380 | mytest = test; | 2386 | mytest = test; |
| 2381 | SiS_SetReg(SISPART4, 0x11, (type & 0x00ff)); | 2387 | SiS_SetReg(SISPART4, 0x11, (type & 0x00ff)); |
| 2382 | temp = (type >> 8) | (mytest & 0x00ff); | 2388 | temp = (type >> 8) | (mytest & 0x00ff); |
| 2383 | SiS_SetRegANDOR(SISPART4, 0x10, 0xe0, temp); | 2389 | SiS_SetRegANDOR(SISPART4, 0x10, 0xe0, temp); |
| 2384 | SiS_DDC2Delay(&ivideo->SiS_Pr, 0x1500); | 2390 | SiS_DDC2Delay(&ivideo->SiS_Pr, 0x1500); |
| 2385 | mytest >>= 8; | 2391 | mytest >>= 8; |
| 2386 | mytest &= 0x7f; | 2392 | mytest &= 0x7f; |
| 2387 | temp = SiS_GetReg(SISPART4, 0x03); | 2393 | temp = SiS_GetReg(SISPART4, 0x03); |
| 2388 | temp ^= 0x0e; | 2394 | temp ^= 0x0e; |
| 2389 | temp &= mytest; | 2395 | temp &= mytest; |
| 2390 | if(temp == mytest) result++; | 2396 | if (temp == mytest) |
| 2397 | result++; | ||
| 2391 | #if 1 | 2398 | #if 1 |
| 2392 | SiS_SetReg(SISPART4, 0x11, 0x00); | 2399 | SiS_SetReg(SISPART4, 0x11, 0x00); |
| 2393 | SiS_SetRegAND(SISPART4, 0x10, 0xe0); | 2400 | SiS_SetRegAND(SISPART4, 0x10, 0xe0); |
| 2394 | SiS_DDC2Delay(&ivideo->SiS_Pr, 0x1000); | 2401 | SiS_DDC2Delay(&ivideo->SiS_Pr, 0x1000); |
| 2395 | #endif | 2402 | #endif |
| 2396 | } | 2403 | } |
| 2397 | if((result == 0) || (result >= 2)) break; | 2404 | |
| 2398 | } | 2405 | if ((result == 0) || (result >= 2)) |
| 2399 | return result; | 2406 | break; |
| 2407 | } | ||
| 2408 | return result; | ||
| 2400 | } | 2409 | } |
| 2401 | 2410 | ||
| 2402 | static void SiS_Sense30x(struct sis_video_info *ivideo) | 2411 | static void SiS_Sense30x(struct sis_video_info *ivideo) |
| @@ -4262,18 +4271,17 @@ static int sisfb_post_300_rwtest(struct sis_video_info *ivideo, int iteration, · 1859 unmodified lines | |||
| 4262 | unsigned int k, RankCapacity, PageCapacity, BankNumHigh, BankNumMid; | 4271 | unsigned int k, RankCapacity, PageCapacity, BankNumHigh, BankNumMid; |
| 4263 | unsigned int PhysicalAdrOtherPage, PhysicalAdrHigh, PhysicalAdrHalfPage; | 4272 | unsigned int PhysicalAdrOtherPage, PhysicalAdrHigh, PhysicalAdrHalfPage; |
| 4264 | 4273 | ||
| 4265 | for(k = 0; k < ARRAY_SIZE(SiS_DRAMType); k++) { | 4274 | for (k = 0; k < ARRAY_SIZE(SiS_DRAMType); k++) { |
| 4266 | |||
| 4267 | RankCapacity = buswidth * SiS_DRAMType[k][3]; | 4275 | RankCapacity = buswidth * SiS_DRAMType[k][3]; |
| 4268 | 4276 | ||
| 4269 | if(RankCapacity != PseudoRankCapacity) | 4277 | if (RankCapacity != PseudoRankCapacity) |
| 4270 | continue; | 4278 | continue; |
| 4271 | 4279 | ||
| 4272 | if((SiS_DRAMType[k][2] + SiS_DRAMType[k][0]) > PseudoAdrPinCount) | 4280 | if ((SiS_DRAMType[k][2] + SiS_DRAMType[k][0]) > PseudoAdrPinCount) |
| 4273 | continue; | 4281 | continue; |
| 4274 | 4282 | ||
| 4275 | BankNumHigh = RankCapacity * 16 * iteration - 1; | 4283 | BankNumHigh = RankCapacity * 16 * iteration - 1; |
| 4276 | if(iteration == 3) { /* Rank No */ | 4284 | if (iteration == 3) { /* Rank No */ |
| 4277 | BankNumMid = RankCapacity * 16 - 1; | 4285 | BankNumMid = RankCapacity * 16 - 1; |
| 4278 | } else { | 4286 | } else { |
| 4279 | BankNumMid = RankCapacity * 16 * iteration / 2 - 1; | 4287 | BankNumMid = RankCapacity * 16 * iteration / 2 - 1; |
| @@ -4287,18 +4295,22 @@ static int sisfb_post_300_rwtest(struct sis_video_info *ivideo, int iteration, · 7 unmodified lines | |||
| 4287 | SiS_SetRegAND(SISSR, 0x15, 0xFB); /* Test */ | 4295 | SiS_SetRegAND(SISSR, 0x15, 0xFB); /* Test */ |
| 4288 | SiS_SetRegOR(SISSR, 0x15, 0x04); /* Test */ | 4296 | SiS_SetRegOR(SISSR, 0x15, 0x04); /* Test */ |
| 4289 | sr14 = (SiS_DRAMType[k][3] * buswidth) - 1; | 4297 | sr14 = (SiS_DRAMType[k][3] * buswidth) - 1; |
| 4290 | if(buswidth == 4) sr14 |= 0x80; | 4298 | |
| 4291 | else if(buswidth == 2) sr14 |= 0x40; | 4299 | if (buswidth == 4) |
| 4300 | sr14 |= 0x80; | ||
| 4301 | else if (buswidth == 2) | ||
| 4302 | sr14 |= 0x40; | ||
| 4303 | |||
| 4292 | SiS_SetReg(SISSR, 0x13, SiS_DRAMType[k][4]); | 4304 | SiS_SetReg(SISSR, 0x13, SiS_DRAMType[k][4]); |
| 4293 | SiS_SetReg(SISSR, 0x14, sr14); | 4305 | SiS_SetReg(SISSR, 0x14, sr14); |
| 4294 | 4306 | ||
| 4295 | BankNumHigh <<= 16; | 4307 | BankNumHigh <<= 16; |
| 4296 | BankNumMid <<= 16; | 4308 | BankNumMid <<= 16; |
| 4297 | 4309 | ||
| 4298 | if((BankNumHigh + PhysicalAdrHigh >= mapsize) || | 4310 | if ((BankNumHigh + PhysicalAdrHigh >= mapsize) || |
| 4299 | (BankNumMid + PhysicalAdrHigh >= mapsize) || | 4311 | (BankNumMid + PhysicalAdrHigh >= mapsize) || |
| 4300 | (BankNumHigh + PhysicalAdrHalfPage >= mapsize) || | 4312 | (BankNumHigh + PhysicalAdrHalfPage >= mapsize) || |
| 4301 | (BankNumHigh + PhysicalAdrOtherPage >= mapsize)) | 4313 | (BankNumHigh + PhysicalAdrOtherPage >= mapsize)) |
| 4302 | continue; | 4314 | continue; |
| 4303 | 4315 | ||
| 4304 | /* Write data */ | 4316 | /* Write data */ |
| @@ -4312,7 +4324,7 @@ static int sisfb_post_300_rwtest(struct sis_video_info *ivideo, int iteration, · 7 unmodified lines | |||
| 4312 | (FBAddr + BankNumHigh + PhysicalAdrOtherPage)); | 4324 | (FBAddr + BankNumHigh + PhysicalAdrOtherPage)); |
| 4313 | 4325 | ||
| 4314 | /* Read data */ | 4326 | /* Read data */ |
| 4315 | if(readw(FBAddr + BankNumHigh + PhysicalAdrHigh) == PhysicalAdrHigh) | 4327 | if (readw(FBAddr + BankNumHigh + PhysicalAdrHigh) == PhysicalAdrHigh) |
| 4316 | return 1; | 4328 | return 1; |
| 4317 | } | 4329 | } |
| 4318 | 4330 | ||
| @@ -5867,7 +5879,7 @@ static int sisfb_probe(struct pci_dev *pdev, const struct pci_device_id *ent) · 1548 unmodified lines | |||
| 5867 | ivideo->cardnumber++; | 5879 | ivideo->cardnumber++; |
| 5868 | } | 5880 | } |
| 5869 | 5881 | ||
| 5870 | strlcpy(ivideo->myid, chipinfo->chip_name, sizeof(ivideo->myid)); | 5882 | strscpy(ivideo->myid, chipinfo->chip_name, sizeof(ivideo->myid)); |
| 5871 | 5883 | ||
| 5872 | ivideo->warncount = 0; | 5884 | ivideo->warncount = 0; |
| 5873 | ivideo->chip_id = pdev->device; | 5885 | ivideo->chip_id = pdev->device; |
| @@ -6150,24 +6162,20 @@ static int sisfb_probe(struct pci_dev *pdev, const struct pci_device_id *ent) · 276 unmodified lines | |||
| 6150 | #endif | 6162 | #endif |
| 6151 | 6163 | ||
| 6152 | #ifdef CONFIG_FB_SIS_315 | 6164 | #ifdef CONFIG_FB_SIS_315 |
| 6153 | if(ivideo->sisvga_engine == SIS_315_VGA) { | 6165 | if (ivideo->sisvga_engine == SIS_315_VGA) { |
| 6154 | int result = 1; | 6166 | int result = 1; |
| 6155 | /* if((ivideo->chip == SIS_315H) || | 6167 | |
| 6156 | (ivideo->chip == SIS_315) || | 6168 | if (ivideo->chip == XGI_20) { |
| 6157 | (ivideo->chip == SIS_315PRO) || | ||
| 6158 | (ivideo->chip == SIS_330)) { | ||
| 6159 | sisfb_post_sis315330(pdev); | ||
| 6160 | } else */ if(ivideo->chip == XGI_20) { | ||
| 6161 | result = sisfb_post_xgi(pdev); | 6169 | result = sisfb_post_xgi(pdev); |
| 6162 | ivideo->sisfb_can_post = 1; | 6170 | ivideo->sisfb_can_post = 1; |
| 6163 | } else if((ivideo->chip == XGI_40) && ivideo->haveXGIROM) { | 6171 | } else if ((ivideo->chip == XGI_40) && ivideo->haveXGIROM) { |
| 6164 | result = sisfb_post_xgi(pdev); | 6172 | result = sisfb_post_xgi(pdev); |
| 6165 | ivideo->sisfb_can_post = 1; | 6173 | ivideo->sisfb_can_post = 1; |
| 6166 | } else { | 6174 | } else { |
| 6167 | printk(KERN_INFO "sisfb: Card is not " | 6175 | printk(KERN_INFO "sisfb: Card is not " |
| 6168 | "POSTed and sisfb can't do this either.\n"); | 6176 | "POSTed and sisfb can't do this either.\n"); |
| 6169 | } | 6177 | } |
| 6170 | if(!result) { | 6178 | if (!result) { |
| 6171 | printk(KERN_ERR "sisfb: Failed to POST card\n"); | 6179 | printk(KERN_ERR "sisfb: Failed to POST card\n"); |
| 6172 | ret = -ENODEV; | 6180 | ret = -ENODEV; |
| 6173 | goto error_3; | 6181 | goto error_3; |
| @@ -1719,7 +1719,7 @@ static int sm501fb_init_fb(struct fb_info *fb, enum sm501_controller head, · 1718 unmodified lines | |||
| 1719 | enable = 0; | 1719 | enable = 0; |
| 1720 | } | 1720 | } |
| 1721 | 1721 | ||
| 1722 | strlcpy(fb->fix.id, fbname, sizeof(fb->fix.id)); | 1722 | strscpy(fb->fix.id, fbname, sizeof(fb->fix.id)); |
| 1723 | 1723 | ||
| 1724 | memcpy(&par->ops, | 1724 | memcpy(&par->ops, |
| 1725 | (head == HEAD_CRT) ? &sm501fb_ops_crt : &sm501fb_ops_pnl, | 1725 | (head == HEAD_CRT) ? &sm501fb_ops_crt : &sm501fb_ops_pnl, |
| @@ -450,7 +450,7 @@ static int ssd1307fb_init(struct ssd1307fb_par *par) · 449 unmodified lines | |||
| 450 | if (ret < 0) | 450 | if (ret < 0) |
| 451 | return ret; | 451 | return ret; |
| 452 | 452 | ||
| 453 | /* Set Set Area Color Mode ON/OFF & Low Power Display Mode */ | 453 | /* Set Area Color Mode ON/OFF & Low Power Display Mode */ |
| 454 | if (par->area_color_enable || par->low_power) { | 454 | if (par->area_color_enable || par->low_power) { |
| 455 | u32 mode; | 455 | u32 mode; |
| 456 | 456 | ||
| @@ -1382,7 +1382,7 @@ static int sstfb_probe(struct pci_dev *pdev, const struct pci_device_id *id) · 1381 unmodified lines | |||
| 1382 | goto fail; | 1382 | goto fail; |
| 1383 | } | 1383 | } |
| 1384 | sst_get_memsize(info, &fix->smem_len); | 1384 | sst_get_memsize(info, &fix->smem_len); |
| 1385 | strlcpy(fix->id, spec->name, sizeof(fix->id)); | 1385 | strscpy(fix->id, spec->name, sizeof(fix->id)); |
| 1386 | 1386 | ||
| 1387 | printk(KERN_INFO "%s (revision %d) with %s dac\n", | 1387 | printk(KERN_INFO "%s (revision %d) with %s dac\n", |
| 1388 | fix->id, par->revision, par->dac_sw.name); | 1388 | fix->id, par->revision, par->dac_sw.name); |
| @@ -80,7 +80,7 @@ static int gfb_set_fbinfo(struct gfb_info *gp) · 79 unmodified lines | |||
| 80 | info->pseudo_palette = gp->pseudo_palette; | 80 | info->pseudo_palette = gp->pseudo_palette; |
| 81 | 81 | ||
| 82 | /* Fill fix common fields */ | 82 | /* Fill fix common fields */ |
| 83 | strlcpy(info->fix.id, "gfb", sizeof(info->fix.id)); | 83 | strscpy(info->fix.id, "gfb", sizeof(info->fix.id)); |
| 84 | info->fix.smem_start = gp->fb_base_phys; | 84 | info->fix.smem_start = gp->fb_base_phys; |
| 85 | info->fix.smem_len = gp->fb_size; | 85 | info->fix.smem_len = gp->fb_size; |
| 86 | info->fix.type = FB_TYPE_PACKED_PIXELS; | 86 | info->fix.type = FB_TYPE_PACKED_PIXELS; |
| @@ -84,7 +84,7 @@ static int s3d_set_fbinfo(struct s3d_info *sp) · 83 unmodified lines | |||
| 84 | info->pseudo_palette = sp->pseudo_palette; | 84 | info->pseudo_palette = sp->pseudo_palette; |
| 85 | 85 | ||
| 86 | /* Fill fix common fields */ | 86 | /* Fill fix common fields */ |
| 87 | strlcpy(info->fix.id, "s3d", sizeof(info->fix.id)); | 87 | strscpy(info->fix.id, "s3d", sizeof(info->fix.id)); |
| 88 | info->fix.smem_start = sp->fb_base_phys; | 88 | info->fix.smem_start = sp->fb_base_phys; |
| 89 | info->fix.smem_len = sp->fb_size; | 89 | info->fix.smem_len = sp->fb_size; |
| 90 | info->fix.type = FB_TYPE_PACKED_PIXELS; | 90 | info->fix.type = FB_TYPE_PACKED_PIXELS; |
| @@ -207,7 +207,7 @@ static int e3d_set_fbinfo(struct e3d_info *ep) · 206 unmodified lines | |||
| 207 | info->pseudo_palette = ep->pseudo_palette; | 207 | info->pseudo_palette = ep->pseudo_palette; |
| 208 | 208 | ||
| 209 | /* Fill fix common fields */ | 209 | /* Fill fix common fields */ |
| 210 | strlcpy(info->fix.id, "e3d", sizeof(info->fix.id)); | 210 | strscpy(info->fix.id, "e3d", sizeof(info->fix.id)); |
| 211 | info->fix.smem_start = ep->fb_base_phys; | 211 | info->fix.smem_start = ep->fb_base_phys; |
| 212 | info->fix.smem_len = ep->fb_size; | 212 | info->fix.smem_len = ep->fb_size; |
| 213 | info->fix.type = FB_TYPE_PACKED_PIXELS; | 213 | info->fix.type = FB_TYPE_PACKED_PIXELS; |
| @@ -333,7 +333,7 @@ tcx_init_fix(struct fb_info *info, int linebytes) · 332 unmodified lines | |||
| 333 | else | 333 | else |
| 334 | tcx_name = "TCX24"; | 334 | tcx_name = "TCX24"; |
| 335 | 335 | ||
| 336 | strlcpy(info->fix.id, tcx_name, sizeof(info->fix.id)); | 336 | strscpy(info->fix.id, tcx_name, sizeof(info->fix.id)); |
| 337 | 337 | ||
| 338 | info->fix.type = FB_TYPE_PACKED_PIXELS; | 338 | info->fix.type = FB_TYPE_PACKED_PIXELS; |
| 339 | info->fix.visual = FB_VISUAL_PSEUDOCOLOR; | 339 | info->fix.visual = FB_VISUAL_PSEUDOCOLOR; |
| @@ -1264,7 +1264,7 @@ static int tdfxfb_setup_ddc_bus(struct tdfxfb_i2c_chan *chan, const char *name, · 1263 unmodified lines | |||
| 1264 | { | 1264 | { |
| 1265 | int rc; | 1265 | int rc; |
| 1266 | 1266 | ||
| 1267 | strlcpy(chan->adapter.name, name, sizeof(chan->adapter.name)); | 1267 | strscpy(chan->adapter.name, name, sizeof(chan->adapter.name)); |
| 1268 | chan->adapter.owner = THIS_MODULE; | 1268 | chan->adapter.owner = THIS_MODULE; |
| 1269 | chan->adapter.class = I2C_CLASS_DDC; | 1269 | chan->adapter.class = I2C_CLASS_DDC; |
| 1270 | chan->adapter.algo_data = &chan->algo; | 1270 | chan->adapter.algo_data = &chan->algo; |
| @@ -1293,7 +1293,7 @@ static int tdfxfb_setup_i2c_bus(struct tdfxfb_i2c_chan *chan, const char *name, · 22 unmodified lines | |||
| 1293 | { | 1293 | { |
| 1294 | int rc; | 1294 | int rc; |
| 1295 | 1295 | ||
| 1296 | strlcpy(chan->adapter.name, name, sizeof(chan->adapter.name)); | 1296 | strscpy(chan->adapter.name, name, sizeof(chan->adapter.name)); |
| 1297 | chan->adapter.owner = THIS_MODULE; | 1297 | chan->adapter.owner = THIS_MODULE; |
| 1298 | chan->adapter.algo_data = &chan->algo; | 1298 | chan->adapter.algo_data = &chan->algo; |
| 1299 | chan->adapter.dev.parent = dev; | 1299 | chan->adapter.dev.parent = dev; |
| @@ -1344,7 +1344,7 @@ tgafb_init_fix(struct fb_info *info) · 1343 unmodified lines | |||
| 1344 | memory_size = 16777216; | 1344 | memory_size = 16777216; |
| 1345 | } | 1345 | } |
| 1346 | 1346 | ||
| 1347 | strlcpy(info->fix.id, tga_type_name, sizeof(info->fix.id)); | 1347 | strscpy(info->fix.id, tga_type_name, sizeof(info->fix.id)); |
| 1348 | 1348 | ||
| 1349 | info->fix.type = FB_TYPE_PACKED_PIXELS; | 1349 | info->fix.type = FB_TYPE_PACKED_PIXELS; |
| 1350 | info->fix.type_aux = 0; | 1350 | info->fix.type_aux = 0; |
| @@ -270,7 +270,7 @@ static int tridentfb_setup_ddc_bus(struct fb_info *info) · 269 unmodified lines | |||
| 270 | { | 270 | { |
| 271 | struct tridentfb_par *par = info->par; | 271 | struct tridentfb_par *par = info->par; |
| 272 | 272 | ||
| 273 | strlcpy(par->ddc_adapter.name, info->fix.id, | 273 | strscpy(par->ddc_adapter.name, info->fix.id, |
| 274 | sizeof(par->ddc_adapter.name)); | 274 | sizeof(par->ddc_adapter.name)); |
| 275 | par->ddc_adapter.owner = THIS_MODULE; | 275 | par->ddc_adapter.owner = THIS_MODULE; |
| 276 | par->ddc_adapter.class = I2C_CLASS_DDC; | 276 | par->ddc_adapter.class = I2C_CLASS_DDC; |