@@ -166,6 +166,18 @@ struct stdio_dev* stdio_clone(struct stdio_dev *dev)
return _dev;
}
+const char *stdio_fd_to_name(int ioe)
+{
+ switch (ioe) {
+ case stdin:
+ case stdout:
+ case stderr:
+ return stdio_names[ioe];
+ default:
+ return NULL;
+ }
+}
+
int stdio_register (struct stdio_dev * dev)
{
struct stdio_dev *_dev;
@@ -98,6 +98,7 @@ struct list_head* stdio_get_list(void);
struct stdio_dev* stdio_get_by_name(const char* name);
struct stdio_dev *stdio_get_fd(int ioe);
int stdio_set_fd(int ioe, struct stdio_dev *dev);
+const char *stdio_fd_to_name(int ioe);
struct stdio_dev* stdio_clone(struct stdio_dev *dev);
#ifdef CONFIG_ARM_DCC_MULTI
Add stdio_fd_to_name() function, which convers the STDIO FD number to a proper name. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Wolfgang Denk <wd@denx.de> --- common/stdio.c | 12 ++++++++++++ include/stdio_dev.h | 1 + 2 files changed, 13 insertions(+)