fbdev changes for 4.3

* Minor fixes and cleanups
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJV7X+aAAoJEPo9qoy8lh71yvAP/3WoFdOzodSI973iBJbnXtBz
 LXFY2MaA5dIaAUsGGd8vLNiUQQRdX3QDT50sEoRhr2yXt2S0GRIEhYtjhy6/cueA
 fMVCL25FHJfZ/g2+rCwTBquD28Xw8eCWyXZtecNxoeqyvuoUvaCcvugCOoYzAbWc
 jH8e0iAmvIy9KdcnIXPvlzU3Jjef7Ci6S0Eh4m62X5sL+4x53c7LM8UPEVbeoj8l
 lwu63nJq9K9G9XtG8PPLzTVag9ST93YIU/G3dQYhF+pPSwJcsz7Cc/cLw1DuJKRI
 9N00fWxEgNnqGA5TKq7kwi7N25kxgjZeVmCYG1C4uYLjeL4H4QJ75qXrXZSbkB6H
 oqklJrlMN5XKgMyI5hgHuhEw6olpz97B62/L+c/0ilpR0lzFtuJLH6Uj6UvWcQE2
 MZj9WuEAKLUE5fDH4voeOqwykq5FJlEzwuyWs9w140pCkHI0MT+ZC0bRXAotETyV
 qwjKOXuUDjiqCBaDWJ5BB0amfMf7r6s0RK/robkgWYCnT1tf5BFDODjuIHvSG0oj
 tKtiRa8c5Ca5zsPBTEW9Jyl5wyzKKrvNjSDZWl3BLxJMBY0+eWFCokDt3c48nlYV
 2X8GW6fCx6lT/PU7uTimMS8hq7U2m/PCFRi/NveWLf8iCXzyCQBmJJY32CqbnOGZ
 r/8RAfVnWusV8R4OBVAZ
 =j9Sz
 -----END PGP SIGNATURE-----

Merge tag 'fbdev-4.3' of git://git.kernel.org/pub/scm/linux/kernel/git/tomba/linux

Pull fbdev updates from Tomi Valkeinen:
 "Minor fixes and cleanups"

* tag 'fbdev-4.3' of git://git.kernel.org/pub/scm/linux/kernel/git/tomba/linux:
  video: fbdev: atmel_lcdfb: remove useless include
  video: fbdev: pxa168fb: Use devm_clk_get
  fbdev: ssd1307fb: fix error return code
  fbdev: fix snprintf() limit in show_bl_curve()
  video: fbdev: s3c-fb: Constify platform_device_id
  video: fbdev: atmel: fix warning for const return value
  video: fbdev: Drop owner assignment from platform_driver
  video: fbdev: Drop owner assignment from i2c_driver
  fbdev: remove unnecessary memset in vfb
  framebuffer: disable vgacon on microblaze arch
  fbdev: udlfb: remove unneeded initialization in few places
  fbdev: Allow compile test of GPIO consumers if !GPIOLIB
  fbdev: fix cea_modes array size
This commit is contained in:
Linus Torvalds 2015-09-08 16:42:55 -07:00
commit fa815580fb
13 changed files with 28 additions and 39 deletions

View file

@ -9,7 +9,7 @@ config VGA_CONSOLE
depends on !4xx && !8xx && !SPARC && !M68K && !PARISC && !FRV && \ depends on !4xx && !8xx && !SPARC && !M68K && !PARISC && !FRV && \
!SUPERH && !BLACKFIN && !AVR32 && !MN10300 && !CRIS && \ !SUPERH && !BLACKFIN && !AVR32 && !MN10300 && !CRIS && \
(!ARM || ARCH_FOOTBRIDGE || ARCH_INTEGRATOR || ARCH_NETWINDER) && \ (!ARM || ARCH_FOOTBRIDGE || ARCH_INTEGRATOR || ARCH_NETWINDER) && \
!ARM64 && !ARC !ARM64 && !ARC && !MICROBLAZE
default y default y
help help
Saying Y here will allow you to use Linux in text mode through a Saying Y here will allow you to use Linux in text mode through a

View file

@ -2464,7 +2464,7 @@ config FB_SSD1307
tristate "Solomon SSD1307 framebuffer support" tristate "Solomon SSD1307 framebuffer support"
depends on FB && I2C depends on FB && I2C
depends on OF depends on OF
depends on GPIOLIB depends on GPIOLIB || COMPILE_TEST
select FB_SYS_FOPS select FB_SYS_FOPS
select FB_SYS_FILLRECT select FB_SYS_FILLRECT
select FB_SYS_COPYAREA select FB_SYS_COPYAREA

View file

@ -19,7 +19,6 @@
#include <linux/backlight.h> #include <linux/backlight.h>
#include <linux/gfp.h> #include <linux/gfp.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/platform_data/atmel.h>
#include <linux/of.h> #include <linux/of.h>
#include <linux/of_device.h> #include <linux/of_device.h>
#include <linux/of_gpio.h> #include <linux/of_gpio.h>
@ -999,7 +998,7 @@ static const char *atmel_lcdfb_wiring_modes[] = {
[ATMEL_LCDC_WIRING_RGB] = "RGB", [ATMEL_LCDC_WIRING_RGB] = "RGB",
}; };
const int atmel_lcdfb_get_of_wiring_modes(struct device_node *np) static int atmel_lcdfb_get_of_wiring_modes(struct device_node *np)
{ {
const char *mode; const char *mode;
int err, i; int err, i;

View file

@ -1072,9 +1072,9 @@ void fb_edid_add_monspecs(unsigned char *edid, struct fb_monspecs *specs)
for (i = specs->modedb_len + num; i < specs->modedb_len + num + svd_n; i++) { for (i = specs->modedb_len + num; i < specs->modedb_len + num + svd_n; i++) {
int idx = svd[i - specs->modedb_len - num]; int idx = svd[i - specs->modedb_len - num];
if (!idx || idx > 63) { if (!idx || idx >= ARRAY_SIZE(cea_modes)) {
pr_warning("Reserved SVD code %d\n", idx); pr_warning("Reserved SVD code %d\n", idx);
} else if (idx > ARRAY_SIZE(cea_modes) || !cea_modes[idx].xres) { } else if (!cea_modes[idx].xres) {
pr_warning("Unimplemented SVD code %d\n", idx); pr_warning("Unimplemented SVD code %d\n", idx);
} else { } else {
memcpy(&m[i], cea_modes + idx, sizeof(m[i])); memcpy(&m[i], cea_modes + idx, sizeof(m[i]));

View file

@ -485,7 +485,7 @@ static ssize_t show_bl_curve(struct device *device,
mutex_lock(&fb_info->bl_curve_mutex); mutex_lock(&fb_info->bl_curve_mutex);
for (i = 0; i < FB_BACKLIGHT_LEVELS; i += 8) for (i = 0; i < FB_BACKLIGHT_LEVELS; i += 8)
len += snprintf(&buf[len], PAGE_SIZE, "%8ph\n", len += scnprintf(&buf[len], PAGE_SIZE - len, "%8ph\n",
fb_info->bl_curve + i); fb_info->bl_curve + i);
mutex_unlock(&fb_info->bl_curve_mutex); mutex_unlock(&fb_info->bl_curve_mutex);

View file

@ -289,7 +289,7 @@ static const struct fb_videomode modedb[] = {
}; };
#ifdef CONFIG_FB_MODE_HELPERS #ifdef CONFIG_FB_MODE_HELPERS
const struct fb_videomode cea_modes[64] = { const struct fb_videomode cea_modes[65] = {
/* #1: 640x480p@59.94/60Hz */ /* #1: 640x480p@59.94/60Hz */
[1] = { [1] = {
NULL, 60, 640, 480, 39722, 48, 16, 33, 10, 96, 2, 0, NULL, 60, 640, 480, 39722, 48, 16, 33, 10, 96, 2, 0,

View file

@ -266,7 +266,6 @@ static struct platform_driver opa362_driver = {
.remove = __exit_p(opa362_remove), .remove = __exit_p(opa362_remove),
.driver = { .driver = {
.name = "amplifier-opa362", .name = "amplifier-opa362",
.owner = THIS_MODULE,
.of_match_table = opa362_of_match, .of_match_table = opa362_of_match,
.suppress_bind_attrs = true, .suppress_bind_attrs = true,
}, },

View file

@ -615,7 +615,7 @@ static int pxa168fb_probe(struct platform_device *pdev)
return -EINVAL; return -EINVAL;
} }
clk = clk_get(&pdev->dev, "LCDCLK"); clk = devm_clk_get(&pdev->dev, "LCDCLK");
if (IS_ERR(clk)) { if (IS_ERR(clk)) {
dev_err(&pdev->dev, "unable to get LCDCLK"); dev_err(&pdev->dev, "unable to get LCDCLK");
return PTR_ERR(clk); return PTR_ERR(clk);
@ -624,21 +624,18 @@ static int pxa168fb_probe(struct platform_device *pdev)
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (res == NULL) { if (res == NULL) {
dev_err(&pdev->dev, "no IO memory defined\n"); dev_err(&pdev->dev, "no IO memory defined\n");
ret = -ENOENT; return -ENOENT;
goto failed_put_clk;
} }
irq = platform_get_irq(pdev, 0); irq = platform_get_irq(pdev, 0);
if (irq < 0) { if (irq < 0) {
dev_err(&pdev->dev, "no IRQ defined\n"); dev_err(&pdev->dev, "no IRQ defined\n");
ret = -ENOENT; return -ENOENT;
goto failed_put_clk;
} }
info = framebuffer_alloc(sizeof(struct pxa168fb_info), &pdev->dev); info = framebuffer_alloc(sizeof(struct pxa168fb_info), &pdev->dev);
if (info == NULL) { if (info == NULL) {
ret = -ENOMEM; return -ENOMEM;
goto failed_put_clk;
} }
/* Initialize private data */ /* Initialize private data */
@ -776,8 +773,6 @@ failed_free_fbmem:
info->screen_base, fbi->fb_start_dma); info->screen_base, fbi->fb_start_dma);
failed_free_info: failed_free_info:
kfree(info); kfree(info);
failed_put_clk:
clk_put(clk);
dev_err(&pdev->dev, "frame buffer device init failed with %d\n", ret); dev_err(&pdev->dev, "frame buffer device init failed with %d\n", ret);
return ret; return ret;
@ -813,7 +808,6 @@ static int pxa168fb_remove(struct platform_device *pdev)
info->screen_base, info->fix.smem_start); info->screen_base, info->fix.smem_start);
clk_disable(fbi->clk); clk_disable(fbi->clk);
clk_put(fbi->clk);
framebuffer_release(info); framebuffer_release(info);

View file

@ -1938,7 +1938,7 @@ static struct s3c_fb_driverdata s3c_fb_data_s3c2443 = {
}, },
}; };
static struct platform_device_id s3c_fb_driver_ids[] = { static const struct platform_device_id s3c_fb_driver_ids[] = {
{ {
.name = "s3c-fb", .name = "s3c-fb",
.driver_data = (unsigned long)&s3c_fb_data_64xx, .driver_data = (unsigned long)&s3c_fb_data_64xx,

View file

@ -656,8 +656,9 @@ static int ssd1307fb_probe(struct i2c_client *client,
bl = backlight_device_register(bl_name, &client->dev, par, bl = backlight_device_register(bl_name, &client->dev, par,
&ssd1307fb_bl_ops, NULL); &ssd1307fb_bl_ops, NULL);
if (IS_ERR(bl)) { if (IS_ERR(bl)) {
dev_err(&client->dev, "unable to register backlight device: %ld\n", ret = PTR_ERR(bl);
PTR_ERR(bl)); dev_err(&client->dev, "unable to register backlight device: %d\n",
ret);
goto bl_init_error; goto bl_init_error;
} }
@ -719,7 +720,6 @@ static struct i2c_driver ssd1307fb_driver = {
.driver = { .driver = {
.name = "ssd1307fb", .name = "ssd1307fb",
.of_match_table = ssd1307fb_of_match, .of_match_table = ssd1307fb_of_match,
.owner = THIS_MODULE,
}, },
}; };

View file

@ -279,7 +279,7 @@ static int dlfb_set_video_mode(struct dlfb_data *dev,
{ {
char *buf; char *buf;
char *wrptr; char *wrptr;
int retval = 0; int retval;
int writesize; int writesize;
struct urb *urb; struct urb *urb;
@ -1505,8 +1505,7 @@ static int dlfb_parse_vendor_descriptor(struct dlfb_data *dev,
char *desc; char *desc;
char *buf; char *buf;
char *desc_end; char *desc_end;
int total_len;
int total_len = 0;
buf = kzalloc(MAX_VENDOR_DESCRIPTOR_SIZE, GFP_KERNEL); buf = kzalloc(MAX_VENDOR_DESCRIPTOR_SIZE, GFP_KERNEL);
if (!buf) if (!buf)
@ -1582,7 +1581,7 @@ static int dlfb_usb_probe(struct usb_interface *interface,
const struct usb_device_id *id) const struct usb_device_id *id)
{ {
struct usb_device *usbdev; struct usb_device *usbdev;
struct dlfb_data *dev = NULL; struct dlfb_data *dev;
int retval = -ENOMEM; int retval = -ENOMEM;
/* usb initialization */ /* usb initialization */
@ -1665,7 +1664,6 @@ static void dlfb_init_framebuffer_work(struct work_struct *work)
/* allocates framebuffer driver structure, not framebuffer memory */ /* allocates framebuffer driver structure, not framebuffer memory */
info = framebuffer_alloc(0, dev->gdev); info = framebuffer_alloc(0, dev->gdev);
if (!info) { if (!info) {
retval = -ENOMEM;
pr_err("framebuffer_alloc failed\n"); pr_err("framebuffer_alloc failed\n");
goto error; goto error;
} }
@ -1912,7 +1910,7 @@ static int dlfb_alloc_urb_list(struct dlfb_data *dev, int count, size_t size)
static struct urb *dlfb_get_urb(struct dlfb_data *dev) static struct urb *dlfb_get_urb(struct dlfb_data *dev)
{ {
int ret = 0; int ret;
struct list_head *entry; struct list_head *entry;
struct urb_node *unode; struct urb_node *unode;
struct urb *urb = NULL; struct urb *urb = NULL;

View file

@ -51,7 +51,14 @@ static void *rvmalloc(unsigned long size)
if (!mem) if (!mem)
return NULL; return NULL;
memset(mem, 0, size); /* Clear the ram out, no junk to the user */ /*
* VFB must clear memory to prevent kernel info
* leakage into userspace
* VGA-based drivers MUST NOT clear memory if
* they want to be able to take over vgacon
*/
memset(mem, 0, size);
adr = (unsigned long) mem; adr = (unsigned long) mem;
while (size > 0) { while (size > 0) {
SetPageReserved(vmalloc_to_page((void *)adr)); SetPageReserved(vmalloc_to_page((void *)adr));
@ -490,14 +497,6 @@ static int vfb_probe(struct platform_device *dev)
if (!(videomemory = rvmalloc(videomemorysize))) if (!(videomemory = rvmalloc(videomemorysize)))
return retval; return retval;
/*
* VFB must clear memory to prevent kernel info
* leakage into userspace
* VGA-based drivers MUST NOT clear memory if
* they want to be able to take over vgacon
*/
memset(videomemory, 0, videomemorysize);
info = framebuffer_alloc(sizeof(u32) * 256, &dev->dev); info = framebuffer_alloc(sizeof(u32) * 256, &dev->dev);
if (!info) if (!info)
goto err; goto err;

View file

@ -788,7 +788,7 @@ struct dmt_videomode {
extern const char *fb_mode_option; extern const char *fb_mode_option;
extern const struct fb_videomode vesa_modes[]; extern const struct fb_videomode vesa_modes[];
extern const struct fb_videomode cea_modes[64]; extern const struct fb_videomode cea_modes[65];
extern const struct dmt_videomode dmt_modes[]; extern const struct dmt_videomode dmt_modes[];
struct fb_modelist { struct fb_modelist {