diff options
author | Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> | 2013-09-20 05:31:29 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2013-09-21 09:59:16 +0200 |
commit | e62d4255172540805a77fee1c58382103f43bb2f (patch) | |
tree | 0ddacc55738ce750d1164501cfd30ed1b6ab7120 /drivers/serial/linux_console.c | |
parent | fe4117357f8f304a08b957eded8ede9db8dafdcf (diff) | |
download | barebox-e62d4255172540805a77fee1c58382103f43bb2f.tar.gz barebox-e62d4255172540805a77fee1c58382103f43bb2f.tar.xz |
console: drop f_caps and check the function pointer getc/putc instead
None of the driver make the difference between STDOUT and STDERR.
So we just need to check if putc or getc are filled in the console_device
save 32 bytes on versatilepb
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/serial/linux_console.c')
-rw-r--r-- | drivers/serial/linux_console.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/serial/linux_console.c b/drivers/serial/linux_console.c index 7ded091790..760b3b81fe 100644 --- a/drivers/serial/linux_console.c +++ b/drivers/serial/linux_console.c @@ -64,10 +64,12 @@ static int linux_console_probe(struct device_d *dev) cdev = xzalloc(sizeof(struct console_device)); cdev->dev = dev; - cdev->f_caps = data->flags; - cdev->tstc = linux_console_tstc; - cdev->putc = linux_console_putc; - cdev->getc = linux_console_getc; + if (data->stdinfd >= 0) { + cdev->tstc = linux_console_tstc; + cdev->getc = linux_console_getc; + } + if (data->stdoutfd >= 0) + cdev->putc = linux_console_putc; console_register(cdev); |