From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andy Shevchenko Date: Thu, 11 Feb 2021 17:09:40 +0200 Subject: [PATCH v1 07/11] IOMUX: Switch to use stdio_file_to_flags() In-Reply-To: <20210211150944.73252-1-andriy.shevchenko@linux.intel.com> References: <20210211150944.73252-1-andriy.shevchenko@linux.intel.com> Message-ID: <20210211150944.73252-7-andriy.shevchenko@linux.intel.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Deduplicate code by replacing with stdio_file_to_flags() helper. Signed-off-by: Andy Shevchenko --- common/iomux.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/common/iomux.c b/common/iomux.c index 15bf53388559..5d027561bb6f 100644 --- a/common/iomux.c +++ b/common/iomux.c @@ -75,15 +75,8 @@ int iomux_doenv(const int console, const char *arg) return 1; } - switch (console) { - case stdin: - io_flag = DEV_FLAGS_INPUT; - break; - case stdout: - case stderr: - io_flag = DEV_FLAGS_OUTPUT; - break; - default: + io_flag = stdio_file_to_flags(console); + if (io_flag < 0) { free(start); free(console_args); free(cons_set); -- 2.30.0