Skip to contentSkip to conversation

fbdev/vga16fb: Use dev_* fn's instead printk.

PATCH In review Javier Garcia 2 participants 3 messages Nov 10, 2025 – Nov 15, 2025 Framebuffer layer

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fbdev/vga16fb: Use dev_* fn's instead printk.

- Family dev_* fn's will show device name, giving extra info to logs.
- Delete the prefix vga16fb: from msg strings, not needed now.

[    1.037947] vga16fb vga-framebuffer.0: initializing
---
 drivers/video/fbdev/vga16fb.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/video/fbdev/vga16fb.c +6 -6
index 3b4c50d98ba6..432ba7c8164b 100644
@@ -1324,7 +1324,7 @@ static int vga16fb_probe(struct platform_device *dev)
 		dev_err(&dev->dev, "vga16b: cannot reserve video memory at 0x%lx\n",
 		       vga16fb_fix.smem_start);
 	}
-	printk(KERN_DEBUG "vga16fb: initializing\n");
+	dev_dbg(&dev->dev, "initializing\n");
 	info = framebuffer_alloc(sizeof(struct vga16fb_par), &dev->dev);
 
 	if (!info) {
@@ -1336,12 +1336,12 @@ static int vga16fb_probe(struct platform_device *dev)
 	info->screen_base = (void __iomem *)VGA_MAP_MEM(VGA_FB_PHYS_BASE, 0);
 
 	if (!info->screen_base) {
-		printk(KERN_ERR "vga16fb: unable to map device\n");
+		dev_err(&dev->dev, "unable to map device\n");
 		ret = -ENOMEM;
 		goto err_ioremap;
 	}
 
-	printk(KERN_INFO "vga16fb: mapped to 0x%p\n", info->screen_base);
+	dev_info(&dev->dev, "mapped to 0x%p\n", info->screen_base);
 	par = info->par;
 
 	par->isVGA = screen_info_video_type(si) == VIDEO_TYPE_VGAC;
@@ -1369,13 +1369,13 @@ static int vga16fb_probe(struct platform_device *dev)
 	i = (info->var.bits_per_pixel == 8) ? 256 : 16;
 	ret = fb_alloc_cmap(&info->cmap, i, 0);
 	if (ret) {
-		printk(KERN_ERR "vga16fb: unable to allocate colormap\n");
+		dev_err(&dev->dev, "unable to allocate colormap\n");
 		ret = -ENOMEM;
 		goto err_alloc_cmap;
 	}
 
 	if (vga16fb_check_var(&info->var, info)) {
-		printk(KERN_ERR "vga16fb: unable to validate variable\n");
+		dev_err(&dev->dev, "unable to validate variable\n");
 		ret = -EINVAL;
 		goto err_check_var;
 	}
@@ -1386,7 +1386,7 @@ static int vga16fb_probe(struct platform_device *dev)
 	if (ret)
 		goto err_check_var;
 	if (register_framebuffer(info) < 0) {
-		printk(KERN_ERR "vga16fb: unable to register framebuffer\n");
+		dev_err(&dev->dev, "unable to register framebuffer\n");
 		ret = -EINVAL;
 		goto err_check_var;
 	}
Signature · 1 line
2.50.1
#1 lore raw

Hi,

Helge Deller, any comment on this patch?

---

Javier Garcia

Quoted 67 lines · Javier Garcia

- Family dev_* fn's will show device name, giving extra info to logs.
- Delete the prefix vga16fb: from msg strings, not needed now.

[    1.037947] vga16fb vga-framebuffer.0: initializing
---
 drivers/video/fbdev/vga16fb.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/video/fbdev/vga16fb.c +6 -7
index 3b4c50d98ba6..432ba7c8164b 100644
@@ -1324,7 +1324,7 @@ static int vga16fb_probe(struct platform_device *dev)
                dev_err(&dev->dev, "vga16b: cannot reserve video memory at 0x%lx\n",
                       vga16fb_fix.smem_start);
        }
-       printk(KERN_DEBUG "vga16fb: initializing\n");
+       dev_dbg(&dev->dev, "initializing\n");
        info = framebuffer_alloc(sizeof(struct vga16fb_par), &dev->dev);
 
        if (!info) {
@@ -1336,12 +1336,12 @@ static int vga16fb_probe(struct platform_device *dev)
        info->screen_base = (void __iomem *)VGA_MAP_MEM(VGA_FB_PHYS_BASE, 0);
 
        if (!info->screen_base) {
-               printk(KERN_ERR "vga16fb: unable to map device\n");
+               dev_err(&dev->dev, "unable to map device\n");
                ret = -ENOMEM;
                goto err_ioremap;
        }
 
-       printk(KERN_INFO "vga16fb: mapped to 0x%p\n", info->screen_base);
+       dev_info(&dev->dev, "mapped to 0x%p\n", info->screen_base);
        par = info->par;
 
        par->isVGA = screen_info_video_type(si) == VIDEO_TYPE_VGAC;
@@ -1369,13 +1369,13 @@ static int vga16fb_probe(struct platform_device *dev)
        i = (info->var.bits_per_pixel == 8) ? 256 : 16;
        ret = fb_alloc_cmap(&info->cmap, i, 0);
        if (ret) {
-               printk(KERN_ERR "vga16fb: unable to allocate colormap\n");
+               dev_err(&dev->dev, "unable to allocate colormap\n");
                ret = -ENOMEM;
                goto err_alloc_cmap;
        }
 
        if (vga16fb_check_var(&info->var, info)) {
-               printk(KERN_ERR "vga16fb: unable to validate variable\n");
+               dev_err(&dev->dev, "unable to validate variable\n");
                ret = -EINVAL;
                goto err_check_var;
        }
@@ -1386,7 +1386,7 @@ static int vga16fb_probe(struct platform_device *dev)
        if (ret)
                goto err_check_var;
        if (register_framebuffer(info) < 0) {
-               printk(KERN_ERR "vga16fb: unable to register framebuffer\n");
+               dev_err(&dev->dev, "unable to register framebuffer\n");
                ret = -EINVAL;
                goto err_check_var;
        }
--

2.50.1

maintainer
#2 lore raw
Quoted 3 lines · Javier Garcia

Hi,

Helge Deller, any comment on this patch?

You're too late:
https://git.kernel.org/pub/scm/linux/kernel/git/deller/linux-fbdev.git/commit/?h=for-next&id=bcd13134470f81c97ba23b44514c93203261e742

Helge

Quoted 74 lines

---

Javier Garcia

Quoted 67 lines · Javier Garcia

- Family dev_* fn's will show device name, giving extra info to logs.
- Delete the prefix vga16fb: from msg strings, not needed now.

[    1.037947] vga16fb vga-framebuffer.0: initializing
---
  drivers/video/fbdev/vga16fb.c | 12 ++++++------
  1 file changed, 6 insertions(+), 6 deletions(-)
drivers/video/fbdev/vga16fb.c +6 -7
index 3b4c50d98ba6..432ba7c8164b 100644
@@ -1324,7 +1324,7 @@ static int vga16fb_probe(struct platform_device *dev)
                 dev_err(&dev->dev, "vga16b: cannot reserve video memory at 0x%lx\n",
                        vga16fb_fix.smem_start);
         }
-       printk(KERN_DEBUG "vga16fb: initializing\n");
+       dev_dbg(&dev->dev, "initializing\n");
         info = framebuffer_alloc(sizeof(struct vga16fb_par), &dev->dev);
 
         if (!info) {
@@ -1336,12 +1336,12 @@ static int vga16fb_probe(struct platform_device *dev)
         info->screen_base = (void __iomem *)VGA_MAP_MEM(VGA_FB_PHYS_BASE, 0);
 
         if (!info->screen_base) {
-               printk(KERN_ERR "vga16fb: unable to map device\n");
+               dev_err(&dev->dev, "unable to map device\n");
                 ret = -ENOMEM;
                 goto err_ioremap;
         }
 
-       printk(KERN_INFO "vga16fb: mapped to 0x%p\n", info->screen_base);
+       dev_info(&dev->dev, "mapped to 0x%p\n", info->screen_base);
         par = info->par;
 
         par->isVGA = screen_info_video_type(si) == VIDEO_TYPE_VGAC;
@@ -1369,13 +1369,13 @@ static int vga16fb_probe(struct platform_device *dev)
         i = (info->var.bits_per_pixel == 8) ? 256 : 16;
         ret = fb_alloc_cmap(&info->cmap, i, 0);
         if (ret) {
-               printk(KERN_ERR "vga16fb: unable to allocate colormap\n");
+               dev_err(&dev->dev, "unable to allocate colormap\n");
                 ret = -ENOMEM;
                 goto err_alloc_cmap;
         }
 
         if (vga16fb_check_var(&info->var, info)) {
-               printk(KERN_ERR "vga16fb: unable to validate variable\n");
+               dev_err(&dev->dev, "unable to validate variable\n");
                 ret = -EINVAL;
                 goto err_check_var;
         }
@@ -1386,7 +1386,7 @@ static int vga16fb_probe(struct platform_device *dev)
         if (ret)
                 goto err_check_var;
         if (register_framebuffer(info) < 0) {
-               printk(KERN_ERR "vga16fb: unable to register framebuffer\n");
+               dev_err(&dev->dev, "unable to register framebuffer\n");
                 ret = -EINVAL;
                 goto err_check_var;
         }
--

2.50.1