From: Ladislav Michl <ladis@linux-mips.org>
To: linux-fbdev@vger.kernel.org
Subject: [PATCH 4/6] video: udlfb: Delete error messages for failed allocations
Date: Mon, 11 Dec 2017 21:41:56 +0000 [thread overview]
Message-ID: <20171211214156.GE29173@lenoch> (raw)
Omit extra messages for an allocation failures, as those
are already reported by failed functions.
Signed-off-by: Ladislav Michl <ladis@linux-mips.org>
---
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);
--
2.15.1
reply other threads:[~2017-12-11 21:41 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20171211214156.GE29173@lenoch \
--to=ladis@linux-mips.org \
--cc=linux-fbdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.