diff options
author | Aleksander Morgado <aleksander@aleksander.es> | 2018-02-24 16:01:15 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2018-03-01 09:39:42 +0100 |
commit | 4cf99a772cf2494db74ff6872fae5bd2d2a03afa (patch) | |
tree | 3da4b269d0b9aa48f7fcd64e164b002887acfb46 /common/ratp | |
parent | d876f2ec0890688a0235c052f6f5b500e92d35a2 (diff) | |
download | barebox-4cf99a772cf2494db74ff6872fae5bd2d2a03afa.tar.gz barebox-4cf99a772cf2494db74ff6872fae5bd2d2a03afa.tar.xz |
ratp: allow building without full console support
Make CONFIG_RATP a selectable config option, so that the user can
enable RATP support without explicitly needing to enable the full
console support over RATP (e.g. only for RATP FS or built-in command
support).
The full console can still be explicitly enabled with
CONFIG_CONSOLE_RATP.
Signed-off-by: Aleksander Morgado <aleksander@aleksander.es>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'common/ratp')
-rw-r--r-- | common/ratp/ratp.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/common/ratp/ratp.c b/common/ratp/ratp.c index b051fdee42..7c8a2f6f58 100644 --- a/common/ratp/ratp.c +++ b/common/ratp/ratp.c @@ -260,7 +260,7 @@ static int ratp_bb_dispatch(struct ratp_ctx *ctx, const void *buf, int len) switch (type) { case BB_RATP_TYPE_COMMAND: - if (ratp_command) + if (!IS_ENABLED(CONFIG_CONSOLE_RATP) || ratp_command) return 0; ratp_command = xmemdup_add_zero(&rbb->data, dlen); @@ -274,6 +274,8 @@ static int ratp_bb_dispatch(struct ratp_ctx *ctx, const void *buf, int len) break; case BB_RATP_TYPE_CONSOLEMSG: + if (!IS_ENABLED(CONFIG_CONSOLE_RATP)) + return 0; kfifo_put(ctx->console_recv_fifo, rbb->data, dlen); break; @@ -420,7 +422,8 @@ static void ratp_poller(struct poller_struct *poller) size_t len; void *buf; - ratp_queue_console_tx(ctx); + if (IS_ENABLED(CONFIG_CONSOLE_RATP)) + ratp_queue_console_tx(ctx); ret = ratp_poll(&ctx->ratp); if (ret == -EINTR) |