From e62d4255172540805a77fee1c58382103f43bb2f Mon Sep 17 00:00:00 2001 From: Jean-Christophe PLAGNIOL-VILLARD Date: Fri, 20 Sep 2013 05:31:29 +0200 Subject: 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 Signed-off-by: Sascha Hauer --- common/console.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'common/console.c') diff --git a/common/console.c b/common/console.c index 6ca94e2a02..4ca5f1809f 100644 --- a/common/console.c +++ b/common/console.c @@ -63,19 +63,21 @@ static int console_std_set(struct device_d *dev, struct param_d *param, unsigned int flag = 0, i = 0; if (val) { - if (strchr(val, 'i') && cdev->f_caps & CONSOLE_STDIN) { + if (strchr(val, 'i') && cdev->getc) { active[i++] = 'i'; flag |= CONSOLE_STDIN; } - if (strchr(val, 'o') && cdev->f_caps & CONSOLE_STDOUT) { - active[i++] = 'o'; - flag |= CONSOLE_STDOUT; - } + if (cdev->putc) { + if (strchr(val, 'o')) { + active[i++] = 'o'; + flag |= CONSOLE_STDOUT; + } - if (strchr(val, 'e') && cdev->f_caps & CONSOLE_STDERR) { - active[i++] = 'e'; - flag |= CONSOLE_STDERR; + if (strchr(val, 'e')) { + active[i++] = 'e'; + flag |= CONSOLE_STDERR; + } } } -- cgit v1.2.3