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>
This commit is contained in:
Bartlomiej Zolnierkiewicz
2019-06-28 12:30:08 +02:00
parent 5f0e6ce18e
commit 0adcdbcb17
42 changed files with 40 additions and 123 deletions
+1 -3
View File
@@ -512,10 +512,8 @@ int picolcd_init_framebuffer(struct picolcd_data *data)
sizeof(struct fb_deferred_io) +
sizeof(struct picolcd_fb_data) +
PICOLCDFB_SIZE, dev);
if (info == NULL) {
dev_err(dev, "failed to allocate a framebuffer\n");
if (!info)
goto err_nomem;
}
info->fbdefio = info->par;
*info->fbdefio = picolcd_fb_defio;
+1 -3
View File
@@ -3554,10 +3554,8 @@ static int __init amifb_probe(struct platform_device *pdev)
custom.dmacon = DMAF_ALL | DMAF_MASTER;
info = framebuffer_alloc(sizeof(struct amifb_par), &pdev->dev);
if (!info) {
dev_err(&pdev->dev, "framebuffer_alloc failed\n");
if (!info)
return -ENOMEM;
}
strcpy(info->fix.id, "Amiga ");
info->fix.visual = FB_VISUAL_PSEUDOCOLOR;
+1 -3
View File
@@ -954,10 +954,8 @@ static int ark_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
/* Allocate and fill driver data structure */
info = framebuffer_alloc(sizeof(struct arkfb_info), &(dev->dev));
if (! info) {
dev_err(&(dev->dev), "cannot allocate memory\n");
if (!info)
return -ENOMEM;
}
par = info->par;
mutex_init(&par->open_lock);
+1 -3
View File
@@ -1053,10 +1053,8 @@ static int __init atmel_lcdfb_probe(struct platform_device *pdev)
ret = -ENOMEM;
info = framebuffer_alloc(sizeof(struct atmel_lcdfb_info), dev);
if (!info) {
dev_err(dev, "cannot allocate memory\n");
if (!info)
goto out;
}
sinfo = info->par;
sinfo->pdev = pdev;
+2 -3
View File
@@ -2103,10 +2103,9 @@ static int aty128_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
/* We have the resources. Now virtualize them */
info = framebuffer_alloc(sizeof(struct aty128fb_par), &pdev->dev);
if (info == NULL) {
printk(KERN_ERR "aty128fb: can't alloc fb_info_aty128\n");
if (!info)
goto err_free_mmio;
}
par = info->par;
info->pseudo_palette = par->pseudo_palette;
+4 -6
View File
@@ -3550,10 +3550,9 @@ static int atyfb_pci_probe(struct pci_dev *pdev,
/* Allocate framebuffer */
info = framebuffer_alloc(sizeof(struct atyfb_par), &pdev->dev);
if (!info) {
PRINTKE("atyfb_pci_probe() can't alloc fb_info\n");
if (!info)
return -ENOMEM;
}
par = info->par;
par->bus_type = PCI;
info->fix = atyfb_fix;
@@ -3643,10 +3642,9 @@ static int __init atyfb_atari_probe(void)
}
info = framebuffer_alloc(sizeof(struct atyfb_par), NULL);
if (!info) {
PRINTKE("atyfb_atari_probe() can't alloc fb_info\n");
if (!info)
return -ENOMEM;
}
par = info->par;
info->fix = atyfb_fix;
-2
View File
@@ -2294,8 +2294,6 @@ static int radeonfb_pci_register(struct pci_dev *pdev,
info = framebuffer_alloc(sizeof(struct radeonfb_info), &pdev->dev);
if (!info) {
printk (KERN_ERR "radeonfb (%s): could not allocate memory\n",
pci_name(pdev));
ret = -ENOMEM;
goto err_disable;
}
-1
View File
@@ -366,7 +366,6 @@ static int chipsfb_pci_init(struct pci_dev *dp, const struct pci_device_id *ent)
p = framebuffer_alloc(0, &dp->dev);
if (p == NULL) {
dev_err(&dp->dev, "Cannot allocate framebuffer structure\n");
rc = -ENOMEM;
goto err_disable;
}
+1 -4
View File
@@ -2093,7 +2093,6 @@ static int cirrusfb_pci_register(struct pci_dev *pdev,
info = framebuffer_alloc(sizeof(struct cirrusfb_info), &pdev->dev);
if (!info) {
printk(KERN_ERR "cirrusfb: could not allocate memory\n");
ret = -ENOMEM;
goto err_out;
}
@@ -2206,10 +2205,8 @@ static int cirrusfb_zorro_register(struct zorro_dev *z,
struct cirrusfb_info *cinfo;
info = framebuffer_alloc(sizeof(struct cirrusfb_info), &z->dev);
if (!info) {
printk(KERN_ERR "cirrusfb: could not allocate memory\n");
if (!info)
return -ENOMEM;
}
zcl = (const struct zorrocl *)ent->driver_data;
btype = zcl->type;
-1
View File
@@ -1387,7 +1387,6 @@ static int fb_probe(struct platform_device *device)
da8xx_fb_info = framebuffer_alloc(sizeof(struct da8xx_fb_par),
&device->dev);
if (!da8xx_fb_info) {
dev_dbg(&device->dev, "Memory allocation failed for fb_info\n");
ret = -ENOMEM;
goto err_pm_runtime_disable;
}
-1
View File
@@ -453,7 +453,6 @@ static int efifb_probe(struct platform_device *dev)
info = framebuffer_alloc(sizeof(u32) * 16, &dev->dev);
if (!info) {
pr_err("efifb: cannot allocate framebuffer\n");
err = -ENOMEM;
goto err_release_mem;
}
+1 -3
View File
@@ -336,10 +336,8 @@ static int grvga_probe(struct platform_device *dev)
char *options = NULL, *mode_opt = NULL;
info = framebuffer_alloc(sizeof(struct grvga_par), &dev->dev);
if (!info) {
dev_err(&dev->dev, "framebuffer_alloc failed\n");
if (!info)
return -ENOMEM;
}
/* Expecting: "grvga: modestring, [addr:<framebuffer physical address>], [size:<framebuffer size>]
*
+2 -3
View File
@@ -643,10 +643,9 @@ static int gxt4500_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
}
info = framebuffer_alloc(sizeof(struct gxt4500_par), &pdev->dev);
if (!info) {
dev_err(&pdev->dev, "gxt4500: cannot alloc FB info record\n");
if (!info)
goto err_free_fb;
}
par = info->par;
cardtype = ent->driver_data;
par->refclk_ps = cardinfo[cardtype].refclk_ps;
+1 -3
View File
@@ -762,10 +762,8 @@ static int hvfb_probe(struct hv_device *hdev,
int ret;
info = framebuffer_alloc(sizeof(struct hvfb_par), &hdev->device);
if (!info) {
pr_err("No memory for framebuffer info\n");
if (!info)
return -ENOMEM;
}
par = info->par;
par->info = info;
+1 -3
View File
@@ -1006,10 +1006,8 @@ static int i740fb_probe(struct pci_dev *dev, const struct pci_device_id *ent)
u8 *edid;
info = framebuffer_alloc(sizeof(struct i740fb_par), &(dev->dev));
if (!info) {
dev_err(&(dev->dev), "cannot allocate framebuffer\n");
if (!info)
return -ENOMEM;
}
par = info->par;
mutex_init(&par->open_lock);
+1 -4
View File
@@ -1477,11 +1477,8 @@ static int imsttfb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
printk(KERN_ERR "imsttfb: no OF node for pci device\n");
info = framebuffer_alloc(sizeof(struct imstt_par), &pdev->dev);
if (!info) {
printk(KERN_ERR "imsttfb: Can't allocate memory\n");
if (!info)
return -ENOMEM;
}
par = info->par;
+2 -3
View File
@@ -491,10 +491,9 @@ static int intelfb_pci_register(struct pci_dev *pdev,
}
info = framebuffer_alloc(sizeof(struct intelfb_info), &pdev->dev);
if (!info) {
ERR_MSG("Could not allocate memory for intelfb_info.\n");
if (!info)
return -ENOMEM;
}
if (fb_alloc_cmap(&info->cmap, 256, 1) < 0) {
ERR_MSG("Could not allocate cmap for intelfb_info.\n");
goto err_out_cmap;
+1 -3
View File
@@ -528,10 +528,8 @@ static int jzfb_probe(struct platform_device *pdev)
}
fb = framebuffer_alloc(sizeof(struct jzfb), &pdev->dev);
if (!fb) {
dev_err(&pdev->dev, "Failed to allocate framebuffer device\n");
if (!fb)
return -ENOMEM;
}
fb->fbops = &jzfb_ops;
fb->flags = FBINFO_DEFAULT;
+1 -4
View File
@@ -684,10 +684,8 @@ static int of_platform_mb862xx_probe(struct platform_device *ofdev)
}
info = framebuffer_alloc(sizeof(struct mb862xxfb_par), dev);
if (info == NULL) {
dev_err(dev, "cannot allocate framebuffer\n");
if (!info)
return -ENOMEM;
}
par = info->par;
par->info = info;
@@ -1009,7 +1007,6 @@ static int mb862xx_pci_probe(struct pci_dev *pdev,
info = framebuffer_alloc(sizeof(struct mb862xxfb_par), dev);
if (!info) {
dev_err(dev, "framebuffer alloc failed\n");
ret = -ENOMEM;
goto dis_dev;
}
+1 -3
View File
@@ -899,10 +899,8 @@ static int mbxfb_probe(struct platform_device *dev)
}
fbi = framebuffer_alloc(sizeof(struct mbxfb_info), &dev->dev);
if (fbi == NULL) {
dev_err(&dev->dev, "framebuffer_alloc failed\n");
if (!fbi)
return -ENOMEM;
}
mfbi = fbi->par;
fbi->pseudo_palette = mfbi->pseudo_palette;

Some files were not shown because too many files have changed in this diff Show More