summaryrefslogtreecommitdiffstats
path: root/drivers/video/fbconsole.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/video/fbconsole.c')
-rw-r--r--drivers/video/fbconsole.c28
1 files changed, 18 insertions, 10 deletions
diff --git a/drivers/video/fbconsole.c b/drivers/video/fbconsole.c
index b5e608e1e4..3b5637b2ba 100644
--- a/drivers/video/fbconsole.c
+++ b/drivers/video/fbconsole.c
@@ -413,21 +413,13 @@ static int setup_font(struct fbc_priv *priv)
return 0;
}
-static int fbc_set_active(struct console_device *cdev, unsigned flags)
+static int fbc_open(struct console_device *cdev)
{
struct fbc_priv *priv = container_of(cdev,
struct fbc_priv, cdev);
struct fb_info *fb = priv->fb;
int ret;
- if (priv->active) {
- fb_close(priv->sc);
- priv->active = false;
- }
-
- if (!(flags & (CONSOLE_STDOUT | CONSOLE_STDERR)))
- return 0;
-
ret = setup_font(priv);
if (ret)
return ret;
@@ -448,6 +440,21 @@ static int fbc_set_active(struct console_device *cdev, unsigned flags)
return 0;
}
+static int fbc_close(struct console_device *cdev)
+{
+ struct fbc_priv *priv = container_of(cdev,
+ struct fbc_priv, cdev);
+
+ if (priv->active) {
+ fb_close(priv->sc);
+ priv->active = false;
+
+ return 0;
+ }
+
+ return -EINVAL;
+}
+
static int set_font(struct param_d *p, void *vpriv)
{
struct fbc_priv *priv = vpriv;
@@ -482,7 +489,8 @@ int register_fbconsole(struct fb_info *fb)
cdev->getc = fbc_getc;
cdev->devname = "fbconsole";
cdev->devid = DEVICE_ID_DYNAMIC;
- cdev->set_active = fbc_set_active;
+ cdev->open = fbc_open;
+ cdev->close = fbc_close;
ret = console_register(cdev);
if (ret) {