From patchwork Mon Dec 11 21:41:56 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ladislav Michl X-Patchwork-Id: 10105821 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 62FE960751 for ; Mon, 11 Dec 2017 21:41:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5FC61298F9 for ; Mon, 11 Dec 2017 21:41:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 54AB629919; Mon, 11 Dec 2017 21:41:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A5701298F9 for ; Mon, 11 Dec 2017 21:41:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751512AbdLKVl6 (ORCPT ); Mon, 11 Dec 2017 16:41:58 -0500 Received: from eddie.linux-mips.org ([148.251.95.138]:41764 "EHLO cvs.linux-mips.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750886AbdLKVl5 (ORCPT ); Mon, 11 Dec 2017 16:41:57 -0500 Received: (from localhost user: 'ladis' uid#1021 fake: STDIN (ladis@eddie.linux-mips.org)) by eddie.linux-mips.org id S23990793AbdLKVl45u-7p (ORCPT ); Mon, 11 Dec 2017 22:41:56 +0100 Date: Mon, 11 Dec 2017 22:41:56 +0100 From: Ladislav Michl To: linux-fbdev@vger.kernel.org Cc: Bernie Thompson , Bartlomiej Zolnierkiewicz Subject: [PATCH 4/6] video: udlfb: Delete error messages for failed allocations Message-ID: <20171211214156.GE29173@lenoch> References: <20171211213948.GA29173@lenoch> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20171211213948.GA29173@lenoch> User-Agent: Mutt/1.9.1 (2017-09-22) Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Omit extra messages for an allocation failures, as those are already reported by failed functions. Signed-off-by: Ladislav Michl --- drivers/video/fbdev/udlfb.c | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/drivers/video/fbdev/udlfb.c b/drivers/video/fbdev/udlfb.c index f74facaed8cc..3d757b10a73c 100644 --- a/drivers/video/fbdev/udlfb.c +++ b/drivers/video/fbdev/udlfb.c @@ -1173,10 +1173,8 @@ static int dlfb_realloc_framebuffer(struct dlfb_data *dlfb, struct fb_info *info * Alloc system memory for virtual framebuffer */ new_fb = vmalloc(new_len); - if (!new_fb) { - pr_err("Virtual framebuffer alloc failed\n"); + if (!new_fb) goto error; - } if (info->screen_base) { memcpy(new_fb, old_fb, old_len); @@ -1597,10 +1595,8 @@ static int dlfb_usb_probe(struct usb_interface *interface, usbdev = interface_to_usbdev(interface); dlfb = kzalloc(sizeof(*dlfb), GFP_KERNEL); - if (dlfb == NULL) { - dev_err(&interface->dev, "dlfb_usb_probe: failed alloc of dev struct\n"); + if (!dlfb) goto error; - } kref_init(&dlfb->kref); /* matching kref_put in usb .disconnect fn */ @@ -1635,7 +1631,6 @@ static int dlfb_usb_probe(struct usb_interface *interface, if (!dlfb_alloc_urb_list(dlfb, WRITES_IN_FLIGHT, MAX_TRANSFER)) { retval = -ENOMEM; - pr_err("dlfb_alloc_urb_list failed\n"); goto error; } @@ -1671,10 +1666,8 @@ static void dlfb_init_framebuffer_work(struct work_struct *work) /* allocates framebuffer driver structure, not framebuffer memory */ info = framebuffer_alloc(0, dlfb->gdev); - if (!info) { - pr_err("framebuffer_alloc failed\n"); + if (!info) goto error; - } dlfb->info = info; info->par = dlfb; @@ -1682,10 +1675,8 @@ static void dlfb_init_framebuffer_work(struct work_struct *work) info->fbops = &dlfb_ops; retval = fb_alloc_cmap(&info->cmap, 256, 0); - if (retval < 0) { - pr_err("fb_alloc_cmap failed %x\n", retval); + if (retval < 0) goto error; - } INIT_DELAYED_WORK(&dlfb->free_framebuffer_work, dlfb_free_framebuffer_work);