fbdev: Convert to using %pOFn instead of device_node.name
authorRob Herring <robh@kernel.org>
Mon, 8 Oct 2018 10:57:36 +0000 (12:57 +0200)
committerBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Mon, 8 Oct 2018 10:57:36 +0000 (12:57 +0200)
In preparation to remove the node name pointer from struct device_node,
convert printf users to use the %pOFn format specifier.

Signed-off-by: Rob Herring <robh@kernel.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
drivers/video/fbdev/cg14.c
drivers/video/fbdev/cg3.c
drivers/video/fbdev/core/fbmon.c
drivers/video/fbdev/imsttfb.c
drivers/video/fbdev/leo.c
drivers/video/fbdev/offb.c
drivers/video/fbdev/p9100.c
drivers/video/of_display_timing.c

index 8de88b129b62244c11e44092687020c2a7b0257f..9af54c2368fdb7252219329e9405a73ad4a2f479 100644 (file)
@@ -355,9 +355,7 @@ static int cg14_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg)
 static void cg14_init_fix(struct fb_info *info, int linebytes,
                          struct device_node *dp)
 {
-       const char *name = dp->name;
-
-       strlcpy(info->fix.id, name, sizeof(info->fix.id));
+       snprintf(info->fix.id, sizeof(info->fix.id), "%pOFn", dp);
 
        info->fix.type = FB_TYPE_PACKED_PIXELS;
        info->fix.visual = FB_VISUAL_PSEUDOCOLOR;
index 6c334260cf532faca8b36f9e8e05cb76d167fcf7..1bd95b02f3aa413463183503f0b29223ddf09822 100644 (file)
@@ -246,7 +246,7 @@ static int cg3_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg)
 static void cg3_init_fix(struct fb_info *info, int linebytes,
                         struct device_node *dp)
 {
-       strlcpy(info->fix.id, dp->name, sizeof(info->fix.id));
+       snprintf(info->fix.id, sizeof(info->fix.id), "%pOFn", dp);
 
        info->fix.type = FB_TYPE_PACKED_PIXELS;
        info->fix.visual = FB_VISUAL_PSEUDOCOLOR;
index 852d86c1c527ac26c3987d18d379108849f8060b..dd3128990776ef35670fbc4e3cab09bbf6b10ebe 100644 (file)
@@ -1480,8 +1480,8 @@ int of_get_fb_videomode(struct device_node *np, struct fb_videomode *fb,
        if (ret)
                return ret;
 
-       pr_debug("%pOF: got %dx%d display mode from %s\n",
-               np, vm.hactive, vm.vactive, np->name);
+       pr_debug("%pOF: got %dx%d display mode\n",
+               np, vm.hactive, vm.vactive);
        dump_fb_videomode(fb);
 
        return 0;
index ecdcf358ad5eac2d76f20439add5818625ff64e2..901ca4ed10e9c923c9e332d8b20523a121270b4f 100644 (file)
@@ -1473,7 +1473,7 @@ static int imsttfb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
        
        dp = pci_device_to_OF_node(pdev);
        if(dp)
-               printk(KERN_INFO "%s: OF name %s\n",__func__, dp->name);
+               printk(KERN_INFO "%s: OF name %pOFn\n",__func__, dp);
        else if (IS_ENABLED(CONFIG_OF))
                printk(KERN_ERR "imsttfb: no OF node for pci device\n");
 
index 71862188f5285953104c62744d3216bfb8a59d10..446ac3364bad21872398f75dec25a1cb0b194346 100644 (file)
@@ -434,7 +434,7 @@ static int leo_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg)
 static void
 leo_init_fix(struct fb_info *info, struct device_node *dp)
 {
-       strlcpy(info->fix.id, dp->name, sizeof(info->fix.id));
+       snprintf(info->fix.id, sizeof(info->fix.id), "%pOFn", dp);
 
        info->fix.type = FB_TYPE_PACKED_PIXELS;
        info->fix.visual = FB_VISUAL_TRUECOLOR;
index 77c0a2f45b3b949819030e90f252f1905e554843..31f769d67195b9d748fed8aafec7b43633dd1545 100644 (file)
@@ -419,9 +419,13 @@ static void __init offb_init_fb(const char *name,
        var = &info->var;
        info->par = par;
 
-       strcpy(fix->id, "OFfb ");
-       strncat(fix->id, name, sizeof(fix->id) - sizeof("OFfb "));
-       fix->id[sizeof(fix->id) - 1] = '\0';
+       if (name) {
+               strcpy(fix->id, "OFfb ");
+               strncat(fix->id, name, sizeof(fix->id) - sizeof("OFfb "));
+               fix->id[sizeof(fix->id) - 1] = '\0';
+       } else
+               snprintf(fix->id, sizeof(fix->id), "OFfb %pOFn", dp);
+
 
        var->xres = var->xres_virtual = width;
        var->yres = var->yres_virtual = height;
@@ -644,7 +648,7 @@ static void __init offb_init_nodriver(struct device_node *dp, int no_real_node)
                /* kludge for valkyrie */
                if (strcmp(dp->name, "valkyrie") == 0)
                        address += 0x1000;
-               offb_init_fb(no_real_node ? "bootx" : dp->name,
+               offb_init_fb(no_real_node ? "bootx" : NULL,
                             width, height, depth, pitch, address,
                             foreign_endian, no_real_node ? NULL : dp);
        }
index 64de5cda541ddd5e55c24a2f60079d962b5add8d..c4283e9e95afafe4f7230088f8f8dd60422d379e 100644 (file)
@@ -239,7 +239,7 @@ static int p9100_ioctl(struct fb_info *info, unsigned int cmd,
 
 static void p9100_init_fix(struct fb_info *info, int linebytes, struct device_node *dp)
 {
-       strlcpy(info->fix.id, dp->name, sizeof(info->fix.id));
+       snprintf(info->fix.id, sizeof(info->fix.id), "%pOFn", dp);
 
        info->fix.type = FB_TYPE_PACKED_PIXELS;
        info->fix.visual = FB_VISUAL_PSEUDOCOLOR;
index 5244e93ceafc5c0b520ad0f849dadf1d70e09dbb..c2e7aa103fa574c2a83ed1ea6eab1987ca294970 100644 (file)
@@ -170,7 +170,7 @@ struct display_timings *of_get_display_timings(const struct device_node *np)
                goto entryfail;
        }
 
-       pr_debug("%pOF: using %s as default timing\n", np, entry->name);
+       pr_debug("%pOF: using %pOFn as default timing\n", np, entry);
 
        native_mode = entry;