Skip to content

Commit 5c63e40

Browse files
robherringbzolnier
authored andcommitted
fbdev: Convert to using %pOFn instead of device_node.name
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>
1 parent 60e5e48 commit 5c63e40

File tree

8 files changed

+16
-14
lines changed

8 files changed

+16
-14
lines changed

drivers/video/fbdev/cg14.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -355,9 +355,7 @@ static int cg14_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg)
355355
static void cg14_init_fix(struct fb_info *info, int linebytes,
356356
struct device_node *dp)
357357
{
358-
const char *name = dp->name;
359-
360-
strlcpy(info->fix.id, name, sizeof(info->fix.id));
358+
snprintf(info->fix.id, sizeof(info->fix.id), "%pOFn", dp);
361359

362360
info->fix.type = FB_TYPE_PACKED_PIXELS;
363361
info->fix.visual = FB_VISUAL_PSEUDOCOLOR;

drivers/video/fbdev/cg3.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ static int cg3_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg)
246246
static void cg3_init_fix(struct fb_info *info, int linebytes,
247247
struct device_node *dp)
248248
{
249-
strlcpy(info->fix.id, dp->name, sizeof(info->fix.id));
249+
snprintf(info->fix.id, sizeof(info->fix.id), "%pOFn", dp);
250250

251251
info->fix.type = FB_TYPE_PACKED_PIXELS;
252252
info->fix.visual = FB_VISUAL_PSEUDOCOLOR;

drivers/video/fbdev/core/fbmon.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1480,8 +1480,8 @@ int of_get_fb_videomode(struct device_node *np, struct fb_videomode *fb,
14801480
if (ret)
14811481
return ret;
14821482

1483-
pr_debug("%pOF: got %dx%d display mode from %s\n",
1484-
np, vm.hactive, vm.vactive, np->name);
1483+
pr_debug("%pOF: got %dx%d display mode\n",
1484+
np, vm.hactive, vm.vactive);
14851485
dump_fb_videomode(fb);
14861486

14871487
return 0;

drivers/video/fbdev/imsttfb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1473,7 +1473,7 @@ static int imsttfb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
14731473

14741474
dp = pci_device_to_OF_node(pdev);
14751475
if(dp)
1476-
printk(KERN_INFO "%s: OF name %s\n",__func__, dp->name);
1476+
printk(KERN_INFO "%s: OF name %pOFn\n",__func__, dp);
14771477
else if (IS_ENABLED(CONFIG_OF))
14781478
printk(KERN_ERR "imsttfb: no OF node for pci device\n");
14791479

drivers/video/fbdev/leo.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@ static int leo_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg)
434434
static void
435435
leo_init_fix(struct fb_info *info, struct device_node *dp)
436436
{
437-
strlcpy(info->fix.id, dp->name, sizeof(info->fix.id));
437+
snprintf(info->fix.id, sizeof(info->fix.id), "%pOFn", dp);
438438

439439
info->fix.type = FB_TYPE_PACKED_PIXELS;
440440
info->fix.visual = FB_VISUAL_TRUECOLOR;

drivers/video/fbdev/offb.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -419,9 +419,13 @@ static void __init offb_init_fb(const char *name,
419419
var = &info->var;
420420
info->par = par;
421421

422-
strcpy(fix->id, "OFfb ");
423-
strncat(fix->id, name, sizeof(fix->id) - sizeof("OFfb "));
424-
fix->id[sizeof(fix->id) - 1] = '\0';
422+
if (name) {
423+
strcpy(fix->id, "OFfb ");
424+
strncat(fix->id, name, sizeof(fix->id) - sizeof("OFfb "));
425+
fix->id[sizeof(fix->id) - 1] = '\0';
426+
} else
427+
snprintf(fix->id, sizeof(fix->id), "OFfb %pOFn", dp);
428+
425429

426430
var->xres = var->xres_virtual = width;
427431
var->yres = var->yres_virtual = height;
@@ -644,7 +648,7 @@ static void __init offb_init_nodriver(struct device_node *dp, int no_real_node)
644648
/* kludge for valkyrie */
645649
if (strcmp(dp->name, "valkyrie") == 0)
646650
address += 0x1000;
647-
offb_init_fb(no_real_node ? "bootx" : dp->name,
651+
offb_init_fb(no_real_node ? "bootx" : NULL,
648652
width, height, depth, pitch, address,
649653
foreign_endian, no_real_node ? NULL : dp);
650654
}

drivers/video/fbdev/p9100.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ static int p9100_ioctl(struct fb_info *info, unsigned int cmd,
239239

240240
static void p9100_init_fix(struct fb_info *info, int linebytes, struct device_node *dp)
241241
{
242-
strlcpy(info->fix.id, dp->name, sizeof(info->fix.id));
242+
snprintf(info->fix.id, sizeof(info->fix.id), "%pOFn", dp);
243243

244244
info->fix.type = FB_TYPE_PACKED_PIXELS;
245245
info->fix.visual = FB_VISUAL_PSEUDOCOLOR;

drivers/video/of_display_timing.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ struct display_timings *of_get_display_timings(const struct device_node *np)
170170
goto entryfail;
171171
}
172172

173-
pr_debug("%pOF: using %s as default timing\n", np, entry->name);
173+
pr_debug("%pOF: using %pOFn as default timing\n", np, entry);
174174

175175
native_mode = entry;
176176

0 commit comments

Comments
 (0)