mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Barebox List <barebox@lists.infradead.org>
Subject: [PATCH 2/8] fb: return original fb_info in FBIOGET_SCREENINFO
Date: Fri,  7 Aug 2015 15:45:35 +0200	[thread overview]
Message-ID: <1438955141-8850-3-git-send-email-s.hauer@pengutronix.de> (raw)
In-Reply-To: <1438955141-8850-1-git-send-email-s.hauer@pengutronix.de>

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 drivers/video/fb.c      | 4 +++-
 lib/gui/graphic_utils.c | 6 ++----
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/video/fb.c b/drivers/video/fb.c
index 29b4c71..dbda8d4 100644
--- a/drivers/video/fb.c
+++ b/drivers/video/fb.c
@@ -11,10 +11,12 @@
 static int fb_ioctl(struct cdev* cdev, int req, void *data)
 {
 	struct fb_info *info = cdev->priv;
+	struct fb_info **fb;
 
 	switch (req) {
 	case FBIOGET_SCREENINFO:
-		memcpy(data, info, sizeof(*info));
+		fb = data;
+		*fb = info;
 		break;
 	case FBIO_ENABLE:
 		info->fbops->fb_enable(info);
diff --git a/lib/gui/graphic_utils.c b/lib/gui/graphic_utils.c
index 47003a0..f928ee1 100644
--- a/lib/gui/graphic_utils.c
+++ b/lib/gui/graphic_utils.c
@@ -281,7 +281,7 @@ struct screen *fb_open(const char * fbdev, bool offscreen)
 
 	info = xzalloc(sizeof(*info));
 
-	ret = ioctl(fd, FBIOGET_SCREENINFO, info);
+	ret = ioctl(fd, FBIOGET_SCREENINFO, &info);
 	if (ret) {
 		goto failed_screeninfo;
 	}
@@ -310,10 +310,8 @@ void fb_close(struct screen *sc)
 {
 	free(sc->offscreenbuf);
 
-	if (sc->fd > 0) {
+	if (sc->fd > 0)
 		close(sc->fd);
-		free(sc->info);
-	}
 
 	free(sc);
 }
-- 
2.4.6


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  parent reply	other threads:[~2015-08-07 13:46 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-07 13:45 [PATCH] fbconsole updates Sascha Hauer
2015-08-07 13:45 ` [PATCH 1/8] video: fbconsole: do not enter when we are already in fbconsole Sascha Hauer
2015-08-07 13:45 ` Sascha Hauer [this message]
2015-08-07 13:45 ` [PATCH 3/8] fb: Add shadowfb support Sascha Hauer
2015-08-07 13:45 ` [PATCH 4/8] splash command: simplify offscreen rendering Sascha Hauer
2015-08-07 13:45 ` [PATCH 5/8] gui: Use fb provided shadowfb for " Sascha Hauer
2015-08-07 13:45 ` [PATCH 6/8] gui: implement blitting screen areas Sascha Hauer
2015-08-07 13:45 ` [PATCH 7/8] fb: fbconsole: print cursor after clearing the screen Sascha Hauer
2015-08-07 13:45 ` [PATCH 8/8] fb: fbconsole: Add missing blits Sascha Hauer

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=1438955141-8850-3-git-send-email-s.hauer@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@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