Message ID | 557953D9.6080202@denx.de (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On Thu, Jun 11, 2015 at 11:24:41AM +0200, Heiko Schocher wrote: > static struct fb_videomode sm501_default_mode = { > @@ -1963,6 +1965,11 @@ static int sm501fb_probe(struct platform_device *pdev) > if (info->edid_data) > found = 1; > } > + } else { > + if (fb_mode_cmdline) > + strcpy(fb_mode, fb_mode_cmdline); Could you make this a strncpy()? These days strlcpy() is unfashionable... It's sort of pedantic and it goes over the 80 char limit but the my static checker will complain if we don't. strncpy(fb_mod, fb_mode_cmdline, sizeof(fb_mod) - 1); > + else > + strcpy(fb_mode, fb_default_mode); regards, dan carpenter -- To unsubscribe from this list: send the line "unsubscribe linux-fbdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/drivers/video/fbdev/sm501fb.c b/drivers/video/fbdev/sm501fb.c index 9e74e8f..2e57f2e 100644 --- a/drivers/video/fbdev/sm501fb.c +++ b/drivers/video/fbdev/sm501fb.c @@ -43,7 +43,9 @@ #include "edid.h" -static char *fb_mode = "640x480-16@60"; +static char *fb_default_mode = "640x480-16@60"; +static char fb_mode[20]; +static char *fb_mode_cmdline; static unsigned long default_bpp = 16; static struct fb_videomode sm501_default_mode = { @@ -1963,6 +1965,11 @@ static int sm501fb_probe(struct platform_device *pdev) if (info->edid_data) found = 1; } + } else { + if (fb_mode_cmdline) + strcpy(fb_mode, fb_mode_cmdline); + else + strcpy(fb_mode, fb_default_mode); } #endif if (!found) { @@ -2230,7 +2237,7 @@ static struct platform_driver sm501fb_driver = { module_platform_driver(sm501fb_driver); -module_param_named(mode, fb_mode, charp, 0); +module_param_named(mode, fb_mode_cmdline, charp, 0); MODULE_PARM_DESC(mode, "Specify resolution as \"<xres>x<yres>[-<bpp>][@<refresh>]\" "); module_param_named(bpp, default_bpp, ulong, 0);