[PATCH 2/2] console: fix console without CONFIG_PARAMETER
Jan Luebbe
jlu at pengutronix.de
Mon Apr 15 12:17:30 EDT 2013
If CONFIG_PARAMETER is not set, dev_set_param() does not call the setter
function. Call it directly instead in this case.
Signed-off-by: Jan Luebbe <jlu at pengutronix.de>
---
common/console.c | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/common/console.c b/common/console.c
index beb37bd..e4b0275 100644
--- a/common/console.c
+++ b/common/console.c
@@ -156,7 +156,10 @@ int console_register(struct console_device *newcdev)
if (newcdev->setbrg) {
dev_add_param(dev, "baudrate", console_baudrate_set, NULL, 0);
- dev_set_param(dev, "baudrate", __stringify(CONFIG_BAUDRATE));
+ if (IS_ENABLED(CONFIG_PARAMETER))
+ dev_set_param(dev, "baudrate", __stringify(CONFIG_BAUDRATE));
+ else
+ console_baudrate_set(dev, NULL, __stringify(CONFIG_BAUDRATE));
}
dev_add_param(dev, "active", console_std_set, NULL, 0);
@@ -173,8 +176,12 @@ int console_register(struct console_device *newcdev)
list_add_tail(&newcdev->list, &console_list);
- if (activate)
- dev_set_param(dev, "active", "ioe");
+ if (activate) {
+ if (IS_ENABLED(CONFIG_PARAMETER))
+ dev_set_param(dev, "active", "ioe");
+ else
+ console_std_set(dev, NULL, "ioe");
+ }
return 0;
}
--
1.8.2.rc2
More information about the barebox
mailing list