summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2010-06-22 16:26:35 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2010-06-24 11:37:40 +0200
commit112d65d3d2bde37529e61d6ad3011c39a1f65589 (patch)
treed36d4d67411a1902663cb0f3cec293783628a537
parentf2f02d5ba93eb38c0ce1f1eca8824b0bbd1148c6 (diff)
downloadbarebox-112d65d3d2bde37529e61d6ad3011c39a1f65589.tar.gz
barebox-112d65d3d2bde37529e61d6ad3011c39a1f65589.tar.xz
fb: add a usage counter to prevent double enable/disable
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--drivers/video/fb.c5
-rw-r--r--include/fb.h4
2 files changed, 8 insertions, 1 deletions
diff --git a/drivers/video/fb.c b/drivers/video/fb.c
index 841c3afe9e..f9a425efac 100644
--- a/drivers/video/fb.c
+++ b/drivers/video/fb.c
@@ -39,6 +39,9 @@ static int fb_enable_set(struct device_d *dev, struct param_d *param,
enable = simple_strtoul(val, NULL, 0);
+ if (info->enabled == !!enable)
+ return 0;
+
if (enable) {
info->fbops->fb_enable(info);
new = "1";
@@ -49,6 +52,8 @@ static int fb_enable_set(struct device_d *dev, struct param_d *param,
dev_param_set_generic(dev, param, new);
+ info->enabled = !!enable;
+
return 0;
}
diff --git a/include/fb.h b/include/fb.h
index 218500b985..379f931e9c 100644
--- a/include/fb.h
+++ b/include/fb.h
@@ -96,7 +96,9 @@ struct fb_info {
struct fb_bitfield red; /* bitfield in fb mem if true color, */
struct fb_bitfield green; /* else only length is significant */
struct fb_bitfield blue;
- struct fb_bitfield transp; /* transparency */
+ struct fb_bitfield transp; /* transparency */
+
+ int enabled;
};
int register_framebuffer(struct fb_info *info);