From 0adcdbcb179624d7b3677264f2cd228e7d89eea9 Mon Sep 17 00:00:00 2001 From: Bartlomiej Zolnierkiewicz Date: Fri, 28 Jun 2019 12:30:08 +0200 Subject: video: fbdev: don't print error message on framebuffer_alloc() failure MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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" Cc: Jiri Kosina Cc: Benjamin Tissoires Signed-off-by: Bartlomiej Zolnierkiewicz --- drivers/video/fbdev/via/viafbdev.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'drivers/video/fbdev/via/viafbdev.c') diff --git a/drivers/video/fbdev/via/viafbdev.c b/drivers/video/fbdev/via/viafbdev.c index 8db5de13e2b7..f815f98190bc 100644 --- a/drivers/video/fbdev/via/viafbdev.c +++ b/drivers/video/fbdev/via/viafbdev.c @@ -1742,10 +1742,8 @@ int via_fb_pci_probe(struct viafb_dev *vdev) 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"); + if (!viafbinfo) return -ENOMEM; - } viaparinfo = (struct viafb_par *)viafbinfo->par; viaparinfo->shared = viafbinfo->par + viafb_par_length; @@ -1820,8 +1818,6 @@ int via_fb_pci_probe(struct viafb_dev *vdev) 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; } -- cgit v1.2.3