summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
5f0e6ce)
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>
42 files changed:
sizeof(struct fb_deferred_io) +
sizeof(struct picolcd_fb_data) +
PICOLCDFB_SIZE, dev);
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");
info->fbdefio = info->par;
*info->fbdefio = picolcd_fb_defio;
info->fbdefio = info->par;
*info->fbdefio = picolcd_fb_defio;
custom.dmacon = DMAF_ALL | DMAF_MASTER;
info = framebuffer_alloc(sizeof(struct amifb_par), &pdev->dev);
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");
strcpy(info->fix.id, "Amiga ");
info->fix.visual = FB_VISUAL_PSEUDOCOLOR;
strcpy(info->fix.id, "Amiga ");
info->fix.visual = FB_VISUAL_PSEUDOCOLOR;
/* Allocate and fill driver data structure */
info = framebuffer_alloc(sizeof(struct arkfb_info), &(dev->dev));
/* 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");
par = info->par;
mutex_init(&par->open_lock);
par = info->par;
mutex_init(&par->open_lock);
ret = -ENOMEM;
info = framebuffer_alloc(sizeof(struct atmel_lcdfb_info), dev);
ret = -ENOMEM;
info = framebuffer_alloc(sizeof(struct atmel_lcdfb_info), dev);
- if (!info) {
- dev_err(dev, "cannot allocate memory\n");
sinfo = info->par;
sinfo->pdev = pdev;
sinfo = info->par;
sinfo->pdev = pdev;
/* We have the resources. Now virtualize them */
info = framebuffer_alloc(sizeof(struct aty128fb_par), &pdev->dev);
/* 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");
par = info->par;
info->pseudo_palette = par->pseudo_palette;
par = info->par;
info->pseudo_palette = par->pseudo_palette;
/* Allocate framebuffer */
info = framebuffer_alloc(sizeof(struct atyfb_par), &pdev->dev);
/* Allocate framebuffer */
info = framebuffer_alloc(sizeof(struct atyfb_par), &pdev->dev);
- if (!info) {
- PRINTKE("atyfb_pci_probe() can't alloc fb_info\n");
par = info->par;
par->bus_type = PCI;
info->fix = atyfb_fix;
par = info->par;
par->bus_type = PCI;
info->fix = atyfb_fix;
}
info = framebuffer_alloc(sizeof(struct atyfb_par), NULL);
}
info = framebuffer_alloc(sizeof(struct atyfb_par), NULL);
- if (!info) {
- PRINTKE("atyfb_atari_probe() can't alloc fb_info\n");
par = info->par;
info->fix = atyfb_fix;
par = info->par;
info->fix = atyfb_fix;
info = framebuffer_alloc(sizeof(struct radeonfb_info), &pdev->dev);
if (!info) {
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;
}
ret = -ENOMEM;
goto err_disable;
}
p = framebuffer_alloc(0, &dp->dev);
if (p == NULL) {
p = framebuffer_alloc(0, &dp->dev);
if (p == NULL) {
- dev_err(&dp->dev, "Cannot allocate framebuffer structure\n");
rc = -ENOMEM;
goto err_disable;
}
rc = -ENOMEM;
goto err_disable;
}
info = framebuffer_alloc(sizeof(struct cirrusfb_info), &pdev->dev);
if (!info) {
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;
}
ret = -ENOMEM;
goto err_out;
}
struct cirrusfb_info *cinfo;
info = framebuffer_alloc(sizeof(struct cirrusfb_info), &z->dev);
struct cirrusfb_info *cinfo;
info = framebuffer_alloc(sizeof(struct cirrusfb_info), &z->dev);
- if (!info) {
- printk(KERN_ERR "cirrusfb: could not allocate memory\n");
zcl = (const struct zorrocl *)ent->driver_data;
btype = zcl->type;
zcl = (const struct zorrocl *)ent->driver_data;
btype = zcl->type;
da8xx_fb_info = framebuffer_alloc(sizeof(struct da8xx_fb_par),
&device->dev);
if (!da8xx_fb_info) {
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;
}
ret = -ENOMEM;
goto err_pm_runtime_disable;
}
info = framebuffer_alloc(sizeof(u32) * 16, &dev->dev);
if (!info) {
info = framebuffer_alloc(sizeof(u32) * 16, &dev->dev);
if (!info) {
- pr_err("efifb: cannot allocate framebuffer\n");
err = -ENOMEM;
goto err_release_mem;
}
err = -ENOMEM;
goto err_release_mem;
}
char *options = NULL, *mode_opt = NULL;
info = framebuffer_alloc(sizeof(struct grvga_par), &dev->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");
/* Expecting: "grvga: modestring, [addr:<framebuffer physical address>], [size:<framebuffer size>]
*
/* Expecting: "grvga: modestring, [addr:<framebuffer physical address>], [size:<framebuffer size>]
*
}
info = framebuffer_alloc(sizeof(struct gxt4500_par), &pdev->dev);
}
info = framebuffer_alloc(sizeof(struct gxt4500_par), &pdev->dev);
- if (!info) {
- dev_err(&pdev->dev, "gxt4500: cannot alloc FB info record\n");
par = info->par;
cardtype = ent->driver_data;
par->refclk_ps = cardinfo[cardtype].refclk_ps;
par = info->par;
cardtype = ent->driver_data;
par->refclk_ps = cardinfo[cardtype].refclk_ps;
int ret;
info = framebuffer_alloc(sizeof(struct hvfb_par), &hdev->device);
int ret;
info = framebuffer_alloc(sizeof(struct hvfb_par), &hdev->device);
- if (!info) {
- pr_err("No memory for framebuffer info\n");
par = info->par;
par->info = info;
par = info->par;
par->info = info;
u8 *edid;
info = framebuffer_alloc(sizeof(struct i740fb_par), &(dev->dev));
u8 *edid;
info = framebuffer_alloc(sizeof(struct i740fb_par), &(dev->dev));
- if (!info) {
- dev_err(&(dev->dev), "cannot allocate framebuffer\n");
par = info->par;
mutex_init(&par->open_lock);
par = info->par;
mutex_init(&par->open_lock);
printk(KERN_ERR "imsttfb: no OF node for pci device\n");
info = framebuffer_alloc(sizeof(struct imstt_par), &pdev->dev);
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");
}
info = framebuffer_alloc(sizeof(struct intelfb_info), &pdev->dev);
}
info = framebuffer_alloc(sizeof(struct intelfb_info), &pdev->dev);
- if (!info) {
- ERR_MSG("Could not allocate memory for intelfb_info.\n");
if (fb_alloc_cmap(&info->cmap, 256, 1) < 0) {
ERR_MSG("Could not allocate cmap for intelfb_info.\n");
goto err_out_cmap;
if (fb_alloc_cmap(&info->cmap, 256, 1) < 0) {
ERR_MSG("Could not allocate cmap for intelfb_info.\n");
goto err_out_cmap;
}
fb = framebuffer_alloc(sizeof(struct jzfb), &pdev->dev);
}
fb = framebuffer_alloc(sizeof(struct jzfb), &pdev->dev);
- if (!fb) {
- dev_err(&pdev->dev, "Failed to allocate framebuffer device\n");
fb->fbops = &jzfb_ops;
fb->flags = FBINFO_DEFAULT;
fb->fbops = &jzfb_ops;
fb->flags = FBINFO_DEFAULT;
}
info = framebuffer_alloc(sizeof(struct mb862xxfb_par), dev);
}
info = framebuffer_alloc(sizeof(struct mb862xxfb_par), dev);
- if (info == NULL) {
- dev_err(dev, "cannot allocate framebuffer\n");
par = info->par;
par->info = info;
par = info->par;
par->info = info;
info = framebuffer_alloc(sizeof(struct mb862xxfb_par), dev);
if (!info) {
info = framebuffer_alloc(sizeof(struct mb862xxfb_par), dev);
if (!info) {
- dev_err(dev, "framebuffer alloc failed\n");
ret = -ENOMEM;
goto dis_dev;
}
ret = -ENOMEM;
goto dis_dev;
}
}
fbi = framebuffer_alloc(sizeof(struct mbxfb_info), &dev->dev);
}
fbi = framebuffer_alloc(sizeof(struct mbxfb_info), &dev->dev);
- if (fbi == NULL) {
- dev_err(&dev->dev, "framebuffer_alloc failed\n");
mfbi = fbi->par;
fbi->pseudo_palette = mfbi->pseudo_palette;
mfbi = fbi->par;
fbi->pseudo_palette = mfbi->pseudo_palette;
fbi = framebuffer_alloc(sizeof(struct omapfb_plane_struct),
fbdev->dev);
if (fbi == NULL) {
fbi = framebuffer_alloc(sizeof(struct omapfb_plane_struct),
fbdev->dev);
if (fbi == NULL) {
- dev_err(fbdev->dev,
- "unable to allocate memory for plane info\n");
planes_cleanup(fbdev);
return -ENOMEM;
}
planes_cleanup(fbdev);
return -ENOMEM;
}
fbi = framebuffer_alloc(sizeof(struct omapfb_info),
fbdev->dev);
fbi = framebuffer_alloc(sizeof(struct omapfb_info),
fbdev->dev);
-
- if (fbi == NULL) {
- dev_err(fbdev->dev,
- "unable to allocate memory for plane info\n");
dev_info(&odev->dev, "Found Apple Platinum video hardware\n");
info = framebuffer_alloc(sizeof(*pinfo), &odev->dev);
dev_info(&odev->dev, "Found Apple Platinum video hardware\n");
info = framebuffer_alloc(sizeof(*pinfo), &odev->dev);
- if (info == NULL) {
- dev_err(&odev->dev, "Failed to allocate fbdev !\n");
pinfo = info->par;
if (of_address_to_resource(dp, 0, &pinfo->rsrc_reg) ||
pinfo = info->par;
if (of_address_to_resource(dp, 0, &pinfo->rsrc_reg) ||
int err;
info = framebuffer_alloc(sizeof(struct aafb_par), dev);
int err;
info = framebuffer_alloc(sizeof(struct aafb_par), dev);
- if (!info) {
- printk(KERN_ERR "%s: Cannot allocate memory\n", dev_name(dev));
par = info->par;
dev_set_drvdata(dev, info);
par = info->par;
dev_set_drvdata(dev, info);
int err;
info = framebuffer_alloc(sizeof(struct pmagbafb_par), dev);
int err;
info = framebuffer_alloc(sizeof(struct pmagbafb_par), dev);
- if (!info) {
- printk(KERN_ERR "%s: Cannot allocate memory\n", dev_name(dev));
par = info->par;
dev_set_drvdata(dev, info);
par = info->par;
dev_set_drvdata(dev, info);
int err;
info = framebuffer_alloc(sizeof(struct pmagbbfb_par), dev);
int err;
info = framebuffer_alloc(sizeof(struct pmagbbfb_par), dev);
- if (!info) {
- printk(KERN_ERR "%s: Cannot allocate memory\n", dev_name(dev));
par = info->par;
dev_set_drvdata(dev, info);
par = info->par;
dev_set_drvdata(dev, info);
#endif
fb_info = framebuffer_alloc(sizeof(struct pvr2fb_par), NULL);
#endif
fb_info = framebuffer_alloc(sizeof(struct pvr2fb_par), NULL);
-
- if (!fb_info) {
- printk(KERN_ERR "Failed to allocate memory for fb_info\n");
currentpar = fb_info->par;
currentpar = fb_info->par;
info = framebuffer_alloc(sizeof(struct riva_par), &pd->dev);
if (!info) {
info = framebuffer_alloc(sizeof(struct riva_par), &pd->dev);
if (!info) {
- printk (KERN_ERR PFX "could not allocate memory\n");
ret = -ENOMEM;
goto err_ret;
}
ret = -ENOMEM;
goto err_ret;
}
fbinfo = framebuffer_alloc(sizeof(struct s3c_fb_win) +
palette_size * sizeof(u32), sfb->dev);
fbinfo = framebuffer_alloc(sizeof(struct s3c_fb_win) +
palette_size * sizeof(u32), sfb->dev);
- if (!fbinfo) {
- dev_err(sfb->dev, "failed to allocate framebuffer\n");
windata = sfb->pdata->win[win_no];
initmode = *sfb->pdata->vtiming;
windata = sfb->pdata->win[win_no];
initmode = *sfb->pdata->vtiming;
/* Allocate and fill driver data structure */
info = framebuffer_alloc(sizeof(struct s3fb_info), &(dev->dev));
/* Allocate and fill driver data structure */
info = framebuffer_alloc(sizeof(struct s3fb_info), &(dev->dev));
- if (!info) {
- dev_err(&(dev->dev), "cannot allocate memory\n");
par = info->par;
mutex_init(&par->open_lock);
par = info->par;
mutex_init(&par->open_lock);
/* Allocate and initialize the frame buffer device. */
info = framebuffer_alloc(0, priv->dev);
/* Allocate and initialize the frame buffer device. */
info = framebuffer_alloc(0, priv->dev);
- if (info == NULL) {
- dev_err(priv->dev, "unable to allocate fb_info\n");
* list and allocate the color map.
*/
info = framebuffer_alloc(0, priv->dev);
* list and allocate the color map.
*/
info = framebuffer_alloc(0, priv->dev);
- if (info == NULL) {
- dev_err(priv->dev, "unable to allocate fb_info\n");
}
fbi = framebuffer_alloc(sizeof(struct sm501fb_par), info->dev);
}
fbi = framebuffer_alloc(sizeof(struct sm501fb_par), info->dev);
- if (fbi == NULL) {
- dev_err(info->dev, "cannot allocate %s framebuffer\n", name);
par = fbi->par;
par->info = info;
par = fbi->par;
par->info = info;
info = framebuffer_alloc(sizeof(*sfb), &pdev->dev);
if (!info) {
info = framebuffer_alloc(sizeof(*sfb), &pdev->dev);
if (!info) {
- dev_err(&pdev->dev, "framebuffer_alloc failed\n");
err = -ENOMEM;
goto failed_free;
}
err = -ENOMEM;
goto failed_free;
}
/* allocates framebuffer driver structure, not framebuffer memory */
info = framebuffer_alloc(0, &usbdev->dev);
/* allocates framebuffer driver structure, not framebuffer memory */
info = framebuffer_alloc(0, &usbdev->dev);
- if (!info) {
- dev_err(dev->gdev, "framebuffer_alloc failed\n");
dev->info = info;
info->par = dev;
dev->info = info;
info->par = dev;
}
info = framebuffer_alloc(sizeof(struct ssd1307fb_par), &client->dev);
}
info = framebuffer_alloc(sizeof(struct ssd1307fb_par), &client->dev);
- if (!info) {
- dev_err(&client->dev, "Couldn't allocate framebuffer.\n");
par = info->par;
par->info = info;
par = info->par;
par->info = info;
info = framebuffer_alloc(sizeof(struct gfb_info), &op->dev);
if (!info) {
info = framebuffer_alloc(sizeof(struct gfb_info), &op->dev);
if (!info) {
- printk(KERN_ERR "gfb: Cannot allocate fb_info\n");
err = -ENOMEM;
goto err_out;
}
err = -ENOMEM;
goto err_out;
}
info = framebuffer_alloc(sizeof(struct s3d_info), &pdev->dev);
if (!info) {
info = framebuffer_alloc(sizeof(struct s3d_info), &pdev->dev);
if (!info) {
- printk(KERN_ERR "s3d: Cannot allocate fb_info\n");
err = -ENOMEM;
goto err_disable;
}
err = -ENOMEM;
goto err_disable;
}
info = framebuffer_alloc(sizeof(struct e3d_info), &pdev->dev);
if (!info) {
info = framebuffer_alloc(sizeof(struct e3d_info), &pdev->dev);
if (!info) {
- printk(KERN_ERR "e3d: Cannot allocate fb_info\n");
err = -ENOMEM;
goto err_disable;
}
err = -ENOMEM;
goto err_disable;
}
/* Allocate the fb and par structures. */
info = framebuffer_alloc(sizeof(struct tga_par), dev);
/* Allocate the fb and par structures. */
info = framebuffer_alloc(sizeof(struct tga_par), dev);
- if (!info) {
- printk(KERN_ERR "tgafb: Cannot allocate memory\n");
par = info->par;
dev_set_drvdata(dev, info);
par = info->par;
dev_set_drvdata(dev, info);
/* allocates framebuffer driver structure, not framebuffer memory */
info = framebuffer_alloc(0, &dlfb->udev->dev);
/* allocates framebuffer driver structure, not framebuffer memory */
info = framebuffer_alloc(0, &dlfb->udev->dev);
- if (!info) {
- dev_err(&dlfb->udev->dev, "framebuffer_alloc failed\n");
dlfb->info = info;
info->par = dlfb;
dlfb->info = info;
info->par = dlfb;
viafbinfo = framebuffer_alloc(viafb_par_length +
ALIGN(sizeof(struct viafb_shared), BITS_PER_LONG/8),
&vdev->pdev->dev);
viafbinfo = framebuffer_alloc(viafb_par_length +
ALIGN(sizeof(struct viafb_shared), BITS_PER_LONG/8),
&vdev->pdev->dev);
- if (!viafbinfo) {
- printk(KERN_ERR"Could not allocate memory for viafb_info.\n");
viaparinfo = (struct viafb_par *)viafbinfo->par;
viaparinfo->shared = viafbinfo->par + viafb_par_length;
viaparinfo = (struct viafb_par *)viafbinfo->par;
viaparinfo->shared = viafbinfo->par + viafb_par_length;
viafbinfo1 = framebuffer_alloc(viafb_par_length,
&vdev->pdev->dev);
if (!viafbinfo1) {
viafbinfo1 = framebuffer_alloc(viafb_par_length,
&vdev->pdev->dev);
if (!viafbinfo1) {
- printk(KERN_ERR
- "allocate the second framebuffer struct error\n");
rc = -ENOMEM;
goto out_fb_release;
}
rc = -ENOMEM;
goto out_fb_release;
}
/* Allocate and fill driver data structure */
info = framebuffer_alloc(sizeof(struct vt8623fb_info), &(dev->dev));
/* Allocate and fill driver data structure */
info = framebuffer_alloc(sizeof(struct vt8623fb_info), &(dev->dev));
- if (! info) {
- dev_err(&(dev->dev), "cannot allocate memory\n");
par = info->par;
mutex_init(&par->open_lock);
par = info->par;
mutex_init(&par->open_lock);