Skip to content

Commit 93b22a4

Browse files
i-shihaohdeller
authored andcommitted
fbdev: i810: use appopriate log interface dev_info
There were many printk log interfaces which do no had any KERN_INFO with them and they can be replaced with dev_info which will allow better log level handling making messages clear and manageable. No functional changes to the driver behavior are introduced. Only the logging method has been replaced as per modern kernel coding guidelines. Signed-off-by: Shi Hao <i.shihao.999@gmail.com> Signed-off-by: Helge Deller <deller@gmx.de>
1 parent af0fa9b commit 93b22a4

1 file changed

Lines changed: 23 additions & 23 deletions

File tree

drivers/video/fbdev/i810/i810_main.c

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1012,7 +1012,7 @@ static int i810_check_params(struct fb_var_screeninfo *var,
10121012
var->bits_per_pixel);
10131013
vidmem = line_length * info->var.yres;
10141014
if (vxres < var->xres) {
1015-
printk("i810fb: required video memory, "
1015+
dev_info(&par->dev->dev, "required video memory, "
10161016
"%d bytes, for %dx%d-%d (virtual) "
10171017
"is out of range\n",
10181018
vidmem, vxres, vyres,
@@ -1067,9 +1067,9 @@ static int i810_check_params(struct fb_var_screeninfo *var,
10671067
|(info->monspecs.hfmax-HFMAX)
10681068
|(info->monspecs.vfmin-VFMIN)
10691069
|(info->monspecs.vfmax-VFMAX);
1070-
printk("i810fb: invalid video mode%s\n",
1071-
default_sync ? "" : ". Specifying "
1072-
"vsyncN/hsyncN parameters may help");
1070+
dev_err(&par->dev->dev, "invalid video mode%s\n",
1071+
default_sync ? "" : ". Specifying "
1072+
"vsyncN/hsyncN parameters may help");
10731073
retval = -EINVAL;
10741074
}
10751075
}
@@ -1674,34 +1674,34 @@ static int i810_alloc_agp_mem(struct fb_info *info)
16741674
size = par->fb.size + par->iring.size;
16751675

16761676
if (!(bridge = agp_backend_acquire(par->dev))) {
1677-
printk("i810fb_alloc_fbmem: cannot acquire agpgart\n");
1677+
dev_warn(&par->dev->dev, "cannot acquire agpgart\n");
16781678
return -ENODEV;
16791679
}
16801680
if (!(par->i810_gtt.i810_fb_memory =
16811681
agp_allocate_memory(bridge, size >> 12, AGP_NORMAL_MEMORY))) {
1682-
printk("i810fb_alloc_fbmem: can't allocate framebuffer "
1682+
dev_warn(&par->dev->dev, "can't allocate framebuffer "
16831683
"memory\n");
16841684
agp_backend_release(bridge);
16851685
return -ENOMEM;
16861686
}
16871687
if (agp_bind_memory(par->i810_gtt.i810_fb_memory,
16881688
par->fb.offset)) {
1689-
printk("i810fb_alloc_fbmem: can't bind framebuffer memory\n");
1689+
dev_warn(&par->dev->dev, "can't bind framebuffer memory\n");
16901690
agp_backend_release(bridge);
16911691
return -EBUSY;
16921692
}
16931693

16941694
if (!(par->i810_gtt.i810_cursor_memory =
16951695
agp_allocate_memory(bridge, par->cursor_heap.size >> 12,
16961696
AGP_PHYSICAL_MEMORY))) {
1697-
printk("i810fb_alloc_cursormem: can't allocate "
1697+
dev_warn(&par->dev->dev, "can't allocate "
16981698
"cursor memory\n");
16991699
agp_backend_release(bridge);
17001700
return -ENOMEM;
17011701
}
17021702
if (agp_bind_memory(par->i810_gtt.i810_cursor_memory,
17031703
par->cursor_heap.offset)) {
1704-
printk("i810fb_alloc_cursormem: cannot bind cursor memory\n");
1704+
dev_warn(&par->dev->dev, "cannot bind cursor memory\n");
17051705
agp_backend_release(bridge);
17061706
return -EBUSY;
17071707
}
@@ -1844,7 +1844,7 @@ static int i810_allocate_pci_resource(struct i810fb_par *par,
18441844
int err;
18451845

18461846
if ((err = pci_enable_device(par->dev))) {
1847-
printk("i810fb_init: cannot enable device\n");
1847+
dev_err(&par->dev->dev, "cannot enable device\n");
18481848
return err;
18491849
}
18501850
par->res_flags |= PCI_DEVICE_ENABLED;
@@ -1859,37 +1859,37 @@ static int i810_allocate_pci_resource(struct i810fb_par *par,
18591859
par->mmio_start_phys = pci_resource_start(par->dev, 0);
18601860
}
18611861
if (!par->aperture.size) {
1862-
printk("i810fb_init: device is disabled\n");
1862+
dev_warn(&par->dev->dev, "device is disabled\n");
18631863
return -ENOMEM;
18641864
}
18651865

18661866
if (!request_mem_region(par->aperture.physical,
18671867
par->aperture.size,
18681868
i810_pci_list[entry->driver_data])) {
1869-
printk("i810fb_init: cannot request framebuffer region\n");
1869+
dev_warn(&par->dev->dev, "cannot request framebuffer region\n");
18701870
return -ENODEV;
18711871
}
18721872
par->res_flags |= FRAMEBUFFER_REQ;
18731873

18741874
par->aperture.virtual = ioremap_wc(par->aperture.physical,
18751875
par->aperture.size);
18761876
if (!par->aperture.virtual) {
1877-
printk("i810fb_init: cannot remap framebuffer region\n");
1877+
dev_warn(&par->dev->dev, "cannot remap framebuffer region\n");
18781878
return -ENODEV;
18791879
}
18801880

18811881
if (!request_mem_region(par->mmio_start_phys,
18821882
MMIO_SIZE,
18831883
i810_pci_list[entry->driver_data])) {
1884-
printk("i810fb_init: cannot request mmio region\n");
1884+
dev_warn(&par->dev->dev, "cannot request mmio region\n");
18851885
return -ENODEV;
18861886
}
18871887
par->res_flags |= MMIO_REQ;
18881888

18891889
par->mmio_start_virtual = ioremap(par->mmio_start_phys,
18901890
MMIO_SIZE);
18911891
if (!par->mmio_start_virtual) {
1892-
printk("i810fb_init: cannot remap mmio region\n");
1892+
dev_warn(&par->dev->dev, "cannot remap mmio region\n");
18931893
return -ENODEV;
18941894
}
18951895

@@ -1921,12 +1921,12 @@ static void i810fb_find_init_mode(struct fb_info *info)
19211921
}
19221922

19231923
if (!err)
1924-
printk("i810fb_init_pci: DDC probe successful\n");
1924+
dev_info(&par->dev->dev, "DDC probe successful\n");
19251925

19261926
fb_edid_to_monspecs(par->edid, specs);
19271927

19281928
if (specs->modedb == NULL)
1929-
printk("i810fb_init_pci: Unable to get Mode Database\n");
1929+
dev_info(&par->dev->dev, "Unable to get Mode Database\n");
19301930

19311931
fb_videomode_to_modelist(specs->modedb, specs->modedb_len,
19321932
&info->modelist);
@@ -2072,7 +2072,7 @@ static int i810fb_init_pci(struct pci_dev *dev,
20722072

20732073
if (err < 0) {
20742074
i810fb_release_resource(info, par);
2075-
printk("i810fb_init: cannot register framebuffer device\n");
2075+
dev_warn(&par->dev->dev, "cannot register framebuffer device\n");
20762076
return err;
20772077
}
20782078

@@ -2084,10 +2084,10 @@ static int i810fb_init_pci(struct pci_dev *dev,
20842084
vfreq = hfreq/(info->var.yres + info->var.upper_margin +
20852085
info->var.vsync_len + info->var.lower_margin);
20862086

2087-
printk("I810FB: fb%d : %s v%d.%d.%d%s\n"
2088-
"I810FB: Video RAM : %dK\n"
2089-
"I810FB: Monitor : H: %d-%d KHz V: %d-%d Hz\n"
2090-
"I810FB: Mode : %dx%d-%dbpp@%dHz\n",
2087+
dev_info(&par->dev->dev, "fb%d : %s v%d.%d.%d%s\n"
2088+
"Video RAM : %dK\n"
2089+
"Monitor : H: %d-%d KHz V: %d-%d Hz\n"
2090+
"Mode : %dx%d-%dbpp@%dHz\n",
20912091
info->node,
20922092
i810_pci_list[entry->driver_data],
20932093
VERSION_MAJOR, VERSION_MINOR, VERSION_TEENIE, BRANCH_VERSION,
@@ -2137,7 +2137,7 @@ static void i810fb_remove_pci(struct pci_dev *dev)
21372137

21382138
unregister_framebuffer(info);
21392139
i810fb_release_resource(info, par);
2140-
printk("cleanup_module: unloaded i810 framebuffer device\n");
2140+
dev_info(&par->dev->dev, "unloaded i810 framebuffer device\n");
21412141
}
21422142

21432143
#ifndef MODULE

0 commit comments

Comments
 (0)