summaryrefslogtreecommitdiffstats
path: root/common/console.c
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2014-12-17 15:08:01 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2014-12-17 15:08:04 +0100
commit2e1a6c9bcec588d8e3b4dade5fbf4be7265530e8 (patch)
tree7a5cca07a96118d9209622973c74aa086fc599b5 /common/console.c
parent631be8e6cbe003f469a7e6b54046a743b710d989 (diff)
downloadbarebox-2e1a6c9bcec588d8e3b4dade5fbf4be7265530e8.tar.gz
barebox-2e1a6c9bcec588d8e3b4dade5fbf4be7265530e8.tar.xz
console: Add set_active callback
The netconsole needs to be able to deny activation when the network has not been enabled. Add an optional callback to the console for this. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'common/console.c')
-rw-r--r--common/console.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/common/console.c b/common/console.c
index e5f4267cbd..c092621aa1 100644
--- a/common/console.c
+++ b/common/console.c
@@ -64,6 +64,7 @@ static int console_std_set(struct device_d *dev, struct param_d *param,
struct console_device *cdev = to_console_dev(dev);
char active[4];
unsigned int flag = 0, i = 0;
+ int ret;
if (val) {
if (strchr(val, 'i') && cdev->getc) {
@@ -90,6 +91,12 @@ static int console_std_set(struct device_d *dev, struct param_d *param,
cdev->setbrg(cdev, cdev->baudrate);
}
+ if (cdev->set_active) {
+ ret = cdev->set_active(cdev, flag);
+ if (ret)
+ return ret;
+ }
+
active[i] = 0;
cdev->f_active = flag;