Skip to content

Commit

Permalink
fbdev: Convert to using %pOFn instead of device_node.name
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Rob Herring authored and Bartlomiej Zolnierkiewicz committed Oct 8, 2018
1 parent 60e5e48 commit 5c63e40
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 14 deletions.
4 changes: 1 addition & 3 deletions drivers/video/fbdev/cg14.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion drivers/video/fbdev/cg3.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions drivers/video/fbdev/core/fbmon.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion drivers/video/fbdev/imsttfb.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");

Expand Down
2 changes: 1 addition & 1 deletion drivers/video/fbdev/leo.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
12 changes: 8 additions & 4 deletions drivers/video/fbdev/offb.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/video/fbdev/p9100.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion drivers/video/of_display_timing.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 5c63e40

Please sign in to comment.