From: Hans de Goede <hdegoede@redhat.com>
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v4 4/5] simplefb: add goto error path to probe
Date: Wed, 22 Oct 2014 16:45:10 +0000 [thread overview]
Message-ID: <1413996311-4287-5-git-send-email-hdegoede@redhat.com> (raw)
In-Reply-To: <1413996311-4287-1-git-send-email-hdegoede@redhat.com>
From: Luc Verhaegen <libv@skynet.be>
While at it update ioremap_wc error return from ENODEV to ENOMEM.
Signed-off-by: Luc Verhaegen <libv@skynet.be>
Acked-by: Stephen Warren <swarren@nvidia.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
Reviewed-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
---
drivers/video/fbdev/simplefb.c | 18 +++++++++++-------
1 file changed, 11 insertions(+), 7 deletions(-)
diff --git a/drivers/video/fbdev/simplefb.c b/drivers/video/fbdev/simplefb.c
index ec112c1..cdcf1fe 100644
--- a/drivers/video/fbdev/simplefb.c
+++ b/drivers/video/fbdev/simplefb.c
@@ -220,8 +220,8 @@ static int simplefb_probe(struct platform_device *pdev)
info->apertures = alloc_apertures(1);
if (!info->apertures) {
- framebuffer_release(info);
- return -ENOMEM;
+ ret = -ENOMEM;
+ goto error_fb_release;
}
info->apertures->ranges[0].base = info->fix.smem_start;
info->apertures->ranges[0].size = info->fix.smem_len;
@@ -231,8 +231,8 @@ static int simplefb_probe(struct platform_device *pdev)
info->screen_base = ioremap_wc(info->fix.smem_start,
info->fix.smem_len);
if (!info->screen_base) {
- framebuffer_release(info);
- return -ENODEV;
+ ret = -ENOMEM;
+ goto error_fb_release;
}
info->pseudo_palette = par->palette;
@@ -247,14 +247,18 @@ static int simplefb_probe(struct platform_device *pdev)
ret = register_framebuffer(info);
if (ret < 0) {
dev_err(&pdev->dev, "Unable to register simplefb: %d\n", ret);
- iounmap(info->screen_base);
- framebuffer_release(info);
- return ret;
+ goto error_unmap;
}
dev_info(&pdev->dev, "fb%d: simplefb registered!\n", info->node);
return 0;
+
+error_unmap:
+ iounmap(info->screen_base);
+error_fb_release:
+ framebuffer_release(info);
+ return ret;
}
static int simplefb_remove(struct platform_device *pdev)
--
2.1.0
next prev parent reply other threads:[~2014-10-22 16:45 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-22 16:45 [PATCH v4 0/5] simplefb: add clock handling code Hans de Goede
2014-10-22 16:45 ` [PATCH v4 1/5] simplefb: Add simplefb MAINTAINERS entry Hans de Goede
2014-11-11 16:27 ` Grant Likely
2014-10-22 16:45 ` [PATCH v4 2/5] dt-bindings: Add a clocks property to the simple-framebuffer binding Hans de Goede
2014-11-11 21:42 ` Grant Likely
[not found] ` <546373C6.4010001@redhat.com>
2014-11-12 14:56 ` Grant Likely
2014-11-12 15:27 ` Hans de Goede
[not found] ` <CACxGe6vBq5Y6HbogbpVUy9VLaocfrAsR_XRbio4zBB_vY5GRsw@mail.gmail.com>
2014-11-12 17:43 ` Rob Herring
2014-10-22 16:45 ` [PATCH v4 3/5] simplefb: formalize pseudo palette handling Hans de Goede
2014-11-11 16:34 ` Grant Likely
2014-10-22 16:45 ` Hans de Goede [this message]
2014-10-22 16:45 ` [PATCH v4 5/5] simplefb: add clock handling code Hans de Goede
2014-10-28 10:44 ` [PATCH v4 0/5] " Tomi Valkeinen
2014-10-28 11:08 ` Hans de Goede
2014-10-28 11:11 ` Rob Herring
2014-10-28 11:30 ` [linux-sunxi] " Hans de Goede
2014-10-29 11:08 ` Tomi Valkeinen
2014-10-31 20:47 ` Rob Herring
2014-11-02 14:39 ` Hans de Goede
2014-11-02 15:28 ` jonsmirl
2014-11-05 8:02 ` Luc Verhaegen
2014-11-11 21:49 ` [linux-sunxi] " Grant Likely
2014-11-12 8:34 ` Geert Uytterhoeven
2014-11-12 9:57 ` Grant Likely
2014-11-12 10:08 ` Geert Uytterhoeven
2014-11-12 10:28 ` Grant Likely
2014-10-31 8:15 ` Tomi Valkeinen
2014-10-31 9:00 ` [linux-sunxi] " Hans de Goede
2014-10-31 9:37 ` Javier Martinez Canillas
2014-10-31 9:51 ` Hans de Goede
2014-10-31 10:19 ` Javier Martinez Canillas
2014-11-06 14:18 ` Tomi Valkeinen
2014-11-06 15:05 ` [linux-sunxi] " Hans de Goede
2014-11-11 21:54 ` Grant Likely
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=1413996311-4287-5-git-send-email-hdegoede@redhat.com \
--to=hdegoede@redhat.com \
--cc=linux-arm-kernel@lists.infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).