Merge tag 'fbdev-4.3' of git://git.kernel.org/pub/scm/linux/kernel/git/tomba/linux
authorLinus Torvalds <torvalds@linux-foundation.org>
Tue, 8 Sep 2015 23:42:55 +0000 (16:42 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 8 Sep 2015 23:42:55 +0000 (16:42 -0700)
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

13 files changed:
drivers/video/console/Kconfig
drivers/video/fbdev/Kconfig
drivers/video/fbdev/atmel_lcdfb.c
drivers/video/fbdev/core/fbmon.c
drivers/video/fbdev/core/fbsysfs.c
drivers/video/fbdev/core/modedb.c
drivers/video/fbdev/omap2/displays-new/encoder-opa362.c
drivers/video/fbdev/pxa168fb.c
drivers/video/fbdev/s3c-fb.c
drivers/video/fbdev/ssd1307fb.c
drivers/video/fbdev/udlfb.c
drivers/video/fbdev/vfb.c
include/linux/fb.h

index 0712806..38da6e2 100644 (file)
@@ -9,7 +9,7 @@ config VGA_CONSOLE
        depends on !4xx && !8xx && !SPARC && !M68K && !PARISC && !FRV && \
                !SUPERH && !BLACKFIN && !AVR32 && !MN10300 && !CRIS && \
                (!ARM || ARCH_FOOTBRIDGE || ARCH_INTEGRATOR || ARCH_NETWINDER) && \
-               !ARM64 && !ARC
+               !ARM64 && !ARC && !MICROBLAZE
        default y
        help
          Saying Y here will allow you to use Linux in text mode through a
index 811acfc..8b1d371 100644 (file)
@@ -2464,7 +2464,7 @@ config FB_SSD1307
        tristate "Solomon SSD1307 framebuffer support"
        depends on FB && I2C
        depends on OF
-       depends on GPIOLIB
+       depends on GPIOLIB || COMPILE_TEST
        select FB_SYS_FOPS
        select FB_SYS_FILLRECT
        select FB_SYS_COPYAREA
index abadc49..19eb42b 100644 (file)
@@ -19,7 +19,6 @@
 #include <linux/backlight.h>
 #include <linux/gfp.h>
 #include <linux/module.h>
-#include <linux/platform_data/atmel.h>
 #include <linux/of.h>
 #include <linux/of_device.h>
 #include <linux/of_gpio.h>
@@ -999,7 +998,7 @@ static const char *atmel_lcdfb_wiring_modes[] = {
        [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;
        int err, i;
index d787533..47c3191 100644 (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++) {
                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);
-               } 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);
                } else {
                        memcpy(&m[i], cea_modes + idx, sizeof(m[i]));
index 60c3f0a..15755ce 100644 (file)
@@ -485,7 +485,7 @@ static ssize_t show_bl_curve(struct device *device,
 
        mutex_lock(&fb_info->bl_curve_mutex);
        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);
        mutex_unlock(&fb_info->bl_curve_mutex);
 
index 7d07cf8..2510fa7 100644 (file)
@@ -289,7 +289,7 @@ static const struct fb_videomode modedb[] = {
 };
 
 #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] = {
                NULL, 60, 640, 480, 39722, 48, 16, 33, 10, 96, 2, 0,
index a14d993..8c246c2 100644 (file)
@@ -266,7 +266,6 @@ static struct platform_driver opa362_driver = {
        .remove = __exit_p(opa362_remove),
        .driver = {
                .name   = "amplifier-opa362",
-               .owner  = THIS_MODULE,
                .of_match_table = opa362_of_match,
                .suppress_bind_attrs = true,
        },
index e209b03..efb57c0 100644 (file)
@@ -615,7 +615,7 @@ static int pxa168fb_probe(struct platform_device *pdev)
                return -EINVAL;
        }
 
-       clk = clk_get(&pdev->dev, "LCDCLK");
+       clk = devm_clk_get(&pdev->dev, "LCDCLK");
        if (IS_ERR(clk)) {
                dev_err(&pdev->dev, "unable to get LCDCLK");
                return PTR_ERR(clk);
@@ -624,21 +624,18 @@ static int pxa168fb_probe(struct platform_device *pdev)
        res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
        if (res == NULL) {
                dev_err(&pdev->dev, "no IO memory defined\n");
-               ret = -ENOENT;
-               goto failed_put_clk;
+               return -ENOENT;
        }
 
        irq = platform_get_irq(pdev, 0);
        if (irq < 0) {
                dev_err(&pdev->dev, "no IRQ defined\n");
-               ret = -ENOENT;
-               goto failed_put_clk;
+               return -ENOENT;
        }
 
        info = framebuffer_alloc(sizeof(struct pxa168fb_info), &pdev->dev);
        if (info == NULL) {
-               ret = -ENOMEM;
-               goto failed_put_clk;
+               return -ENOMEM;
        }
 
        /* Initialize private data */
@@ -776,8 +773,6 @@ failed_free_fbmem:
                        info->screen_base, fbi->fb_start_dma);
 failed_free_info:
        kfree(info);
-failed_put_clk:
-       clk_put(clk);
 
        dev_err(&pdev->dev, "frame buffer device init failed with %d\n", ret);
        return ret;
@@ -813,7 +808,6 @@ static int pxa168fb_remove(struct platform_device *pdev)
                                info->screen_base, info->fix.smem_start);
 
        clk_disable(fbi->clk);
-       clk_put(fbi->clk);
 
        framebuffer_release(info);
 
index 7e3a05f..f72dd12 100644 (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",
                .driver_data    = (unsigned long)&s3c_fb_data_64xx,
index 3e153c0..93f4c90 100644 (file)
@@ -656,8 +656,9 @@ static int ssd1307fb_probe(struct i2c_client *client,
        bl = backlight_device_register(bl_name, &client->dev, par,
                                       &ssd1307fb_bl_ops, NULL);
        if (IS_ERR(bl)) {
-               dev_err(&client->dev, "unable to register backlight device: %ld\n",
-                       PTR_ERR(bl));
+               ret = PTR_ERR(bl);
+               dev_err(&client->dev, "unable to register backlight device: %d\n",
+                       ret);
                goto bl_init_error;
        }
 
@@ -719,7 +720,6 @@ static struct i2c_driver ssd1307fb_driver = {
        .driver = {
                .name = "ssd1307fb",
                .of_match_table = ssd1307fb_of_match,
-               .owner = THIS_MODULE,
        },
 };
 
index ff2b873..e9c2f7b 100644 (file)
@@ -279,7 +279,7 @@ static int dlfb_set_video_mode(struct dlfb_data *dev,
 {
        char *buf;
        char *wrptr;
-       int retval = 0;
+       int retval;
        int writesize;
        struct urb *urb;
 
@@ -1505,8 +1505,7 @@ static int dlfb_parse_vendor_descriptor(struct dlfb_data *dev,
        char *desc;
        char *buf;
        char *desc_end;
-
-       int total_len = 0;
+       int total_len;
 
        buf = kzalloc(MAX_VENDOR_DESCRIPTOR_SIZE, GFP_KERNEL);
        if (!buf)
@@ -1582,7 +1581,7 @@ static int dlfb_usb_probe(struct usb_interface *interface,
                        const struct usb_device_id *id)
 {
        struct usb_device *usbdev;
-       struct dlfb_data *dev = NULL;
+       struct dlfb_data *dev;
        int retval = -ENOMEM;
 
        /* usb initialization */
@@ -1665,7 +1664,6 @@ static void dlfb_init_framebuffer_work(struct work_struct *work)
        /* allocates framebuffer driver structure, not framebuffer memory */
        info = framebuffer_alloc(0, dev->gdev);
        if (!info) {
-               retval = -ENOMEM;
                pr_err("framebuffer_alloc failed\n");
                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)
 {
-       int ret = 0;
+       int ret;
        struct list_head *entry;
        struct urb_node *unode;
        struct urb *urb = NULL;
index 70a897b..b9c2f81 100644 (file)
@@ -51,7 +51,14 @@ static void *rvmalloc(unsigned long size)
        if (!mem)
                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;
        while (size > 0) {
                SetPageReserved(vmalloc_to_page((void *)adr));
@@ -490,14 +497,6 @@ static int vfb_probe(struct platform_device *dev)
        if (!(videomemory = rvmalloc(videomemorysize)))
                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);
        if (!info)
                goto err;
index 043f328..bc9afa7 100644 (file)
@@ -788,7 +788,7 @@ struct dmt_videomode {
 
 extern const char *fb_mode_option;
 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[];
 
 struct fb_modelist {