Skip to content

Commit 0adcdbc

Browse files
committed
video: fbdev: don't print error message on framebuffer_alloc() failure
framebuffer_alloc() can fail only on kzalloc() memory allocation failure and since kzalloc() will print error message in such case we can omit printing extra error message in drivers (which BTW is what the majority of framebuffer_alloc() users is doing already). Cc: "Bruno Prémont" <bonbons@linux-vserver.org> Cc: Jiri Kosina <jikos@kernel.org> Cc: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
1 parent 5f0e6ce commit 0adcdbc

42 files changed

Lines changed: 40 additions & 123 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎drivers/hid/hid-picolcd_fb.c‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -512,10 +512,8 @@ int picolcd_init_framebuffer(struct picolcd_data *data)
512512
sizeof(struct fb_deferred_io) +
513513
sizeof(struct picolcd_fb_data) +
514514
PICOLCDFB_SIZE, dev);
515-
if (info == NULL) {
516-
dev_err(dev, "failed to allocate a framebuffer\n");
515+
if (!info)
517516
goto err_nomem;
518-
}
519517

520518
info->fbdefio = info->par;
521519
*info->fbdefio = picolcd_fb_defio;

‎drivers/video/fbdev/amifb.c‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3554,10 +3554,8 @@ static int __init amifb_probe(struct platform_device *pdev)
35543554
custom.dmacon = DMAF_ALL | DMAF_MASTER;
35553555

35563556
info = framebuffer_alloc(sizeof(struct amifb_par), &pdev->dev);
3557-
if (!info) {
3558-
dev_err(&pdev->dev, "framebuffer_alloc failed\n");
3557+
if (!info)
35593558
return -ENOMEM;
3560-
}
35613559

35623560
strcpy(info->fix.id, "Amiga ");
35633561
info->fix.visual = FB_VISUAL_PSEUDOCOLOR;

‎drivers/video/fbdev/arkfb.c‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -954,10 +954,8 @@ static int ark_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
954954

955955
/* Allocate and fill driver data structure */
956956
info = framebuffer_alloc(sizeof(struct arkfb_info), &(dev->dev));
957-
if (! info) {
958-
dev_err(&(dev->dev), "cannot allocate memory\n");
957+
if (!info)
959958
return -ENOMEM;
960-
}
961959

962960
par = info->par;
963961
mutex_init(&par->open_lock);

‎drivers/video/fbdev/atmel_lcdfb.c‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1053,10 +1053,8 @@ static int __init atmel_lcdfb_probe(struct platform_device *pdev)
10531053

10541054
ret = -ENOMEM;
10551055
info = framebuffer_alloc(sizeof(struct atmel_lcdfb_info), dev);
1056-
if (!info) {
1057-
dev_err(dev, "cannot allocate memory\n");
1056+
if (!info)
10581057
goto out;
1059-
}
10601058

10611059
sinfo = info->par;
10621060
sinfo->pdev = pdev;

‎drivers/video/fbdev/aty/aty128fb.c‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2103,10 +2103,9 @@ static int aty128_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
21032103

21042104
/* We have the resources. Now virtualize them */
21052105
info = framebuffer_alloc(sizeof(struct aty128fb_par), &pdev->dev);
2106-
if (info == NULL) {
2107-
printk(KERN_ERR "aty128fb: can't alloc fb_info_aty128\n");
2106+
if (!info)
21082107
goto err_free_mmio;
2109-
}
2108+
21102109
par = info->par;
21112110

21122111
info->pseudo_palette = par->pseudo_palette;

‎drivers/video/fbdev/aty/atyfb_base.c‎

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3550,10 +3550,9 @@ static int atyfb_pci_probe(struct pci_dev *pdev,
35503550

35513551
/* Allocate framebuffer */
35523552
info = framebuffer_alloc(sizeof(struct atyfb_par), &pdev->dev);
3553-
if (!info) {
3554-
PRINTKE("atyfb_pci_probe() can't alloc fb_info\n");
3553+
if (!info)
35553554
return -ENOMEM;
3556-
}
3555+
35573556
par = info->par;
35583557
par->bus_type = PCI;
35593558
info->fix = atyfb_fix;
@@ -3643,10 +3642,9 @@ static int __init atyfb_atari_probe(void)
36433642
}
36443643

36453644
info = framebuffer_alloc(sizeof(struct atyfb_par), NULL);
3646-
if (!info) {
3647-
PRINTKE("atyfb_atari_probe() can't alloc fb_info\n");
3645+
if (!info)
36483646
return -ENOMEM;
3649-
}
3647+
36503648
par = info->par;
36513649

36523650
info->fix = atyfb_fix;

‎drivers/video/fbdev/aty/radeon_base.c‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2294,8 +2294,6 @@ static int radeonfb_pci_register(struct pci_dev *pdev,
22942294

22952295
info = framebuffer_alloc(sizeof(struct radeonfb_info), &pdev->dev);
22962296
if (!info) {
2297-
printk (KERN_ERR "radeonfb (%s): could not allocate memory\n",
2298-
pci_name(pdev));
22992297
ret = -ENOMEM;
23002298
goto err_disable;
23012299
}

‎drivers/video/fbdev/chipsfb.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,6 @@ static int chipsfb_pci_init(struct pci_dev *dp, const struct pci_device_id *ent)
366366

367367
p = framebuffer_alloc(0, &dp->dev);
368368
if (p == NULL) {
369-
dev_err(&dp->dev, "Cannot allocate framebuffer structure\n");
370369
rc = -ENOMEM;
371370
goto err_disable;
372371
}

‎drivers/video/fbdev/cirrusfb.c‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2093,7 +2093,6 @@ static int cirrusfb_pci_register(struct pci_dev *pdev,
20932093

20942094
info = framebuffer_alloc(sizeof(struct cirrusfb_info), &pdev->dev);
20952095
if (!info) {
2096-
printk(KERN_ERR "cirrusfb: could not allocate memory\n");
20972096
ret = -ENOMEM;
20982097
goto err_out;
20992098
}
@@ -2206,10 +2205,8 @@ static int cirrusfb_zorro_register(struct zorro_dev *z,
22062205
struct cirrusfb_info *cinfo;
22072206

22082207
info = framebuffer_alloc(sizeof(struct cirrusfb_info), &z->dev);
2209-
if (!info) {
2210-
printk(KERN_ERR "cirrusfb: could not allocate memory\n");
2208+
if (!info)
22112209
return -ENOMEM;
2212-
}
22132210

22142211
zcl = (const struct zorrocl *)ent->driver_data;
22152212
btype = zcl->type;

‎drivers/video/fbdev/da8xx-fb.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1387,7 +1387,6 @@ static int fb_probe(struct platform_device *device)
13871387
da8xx_fb_info = framebuffer_alloc(sizeof(struct da8xx_fb_par),
13881388
&device->dev);
13891389
if (!da8xx_fb_info) {
1390-
dev_dbg(&device->dev, "Memory allocation failed for fb_info\n");
13911390
ret = -ENOMEM;
13921391
goto err_pm_runtime_disable;
13931392
}

0 commit comments

Comments
 (0)