public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: u-boot@lists.denx.de
Subject: [PATCH v3 4/9] console: rename search_device() to console_search_dev()
Date: Mon, 21 Dec 2020 14:30:03 +0200	[thread overview]
Message-ID: <20201221123008.9930-4-andriy.shevchenko@linux.intel.com> (raw)
In-Reply-To: <20201221123008.9930-1-andriy.shevchenko@linux.intel.com>

Rename search_device() to console_search_dev() since it's in console.h.

Suggested-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
v3: new patch
 common/console.c  | 18 +++++++++---------
 common/iomux.c    |  4 ++--
 common/stdio.c    |  4 ++--
 include/console.h |  2 +-
 4 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/common/console.c b/common/console.c
index e5fd214ae86f..a7ab50afa29f 100644
--- a/common/console.c
+++ b/common/console.c
@@ -778,7 +778,7 @@ void clear_ctrlc(void)
 
 /** U-Boot INIT FUNCTIONS *************************************************/
 
-struct stdio_dev *search_device(int flags, const char *name)
+struct stdio_dev *console_search_dev(int flags, const char *name)
 {
 	struct stdio_dev *dev;
 
@@ -814,7 +814,7 @@ int console_assign(int file, const char *devname)
 
 	/* Check for valid device name */
 
-	dev = search_device(flag, devname);
+	dev = console_search_dev(flag, devname);
 
 	if (dev)
 		return console_setfile(file, dev);
@@ -924,9 +924,9 @@ int console_init_r(void)
 	stderrname = env_get("stderr");
 
 	if (OVERWRITE_CONSOLE == 0) {	/* if not overwritten by config switch */
-		inputdev  = search_device(DEV_FLAGS_INPUT,  stdinname);
-		outputdev = search_device(DEV_FLAGS_OUTPUT, stdoutname);
-		errdev    = search_device(DEV_FLAGS_OUTPUT, stderrname);
+		inputdev  = console_search_dev(DEV_FLAGS_INPUT,  stdinname);
+		outputdev = console_search_dev(DEV_FLAGS_OUTPUT, stdoutname);
+		errdev    = console_search_dev(DEV_FLAGS_OUTPUT, stderrname);
 #if CONFIG_IS_ENABLED(CONSOLE_MUX)
 		iomux_err = iomux_doenv(stdin, stdinname);
 		iomux_err += iomux_doenv(stdout, stdoutname);
@@ -938,13 +938,13 @@ int console_init_r(void)
 	}
 	/* if the devices are overwritten or not found, use default device */
 	if (inputdev == NULL) {
-		inputdev  = search_device(DEV_FLAGS_INPUT,  "serial");
+		inputdev  = console_search_dev(DEV_FLAGS_INPUT,  "serial");
 	}
 	if (outputdev == NULL) {
-		outputdev = search_device(DEV_FLAGS_OUTPUT, "serial");
+		outputdev = console_search_dev(DEV_FLAGS_OUTPUT, "serial");
 	}
 	if (errdev == NULL) {
-		errdev    = search_device(DEV_FLAGS_OUTPUT, "serial");
+		errdev    = console_search_dev(DEV_FLAGS_OUTPUT, "serial");
 	}
 	/* Initializes output console first */
 	if (outputdev != NULL) {
@@ -1018,7 +1018,7 @@ int console_init_r(void)
 	 */
 	if (env_get("splashimage") != NULL) {
 		if (!(gd->flags & GD_FLG_SILENT))
-			outputdev = search_device (DEV_FLAGS_OUTPUT, "serial");
+			outputdev = console_search_dev (DEV_FLAGS_OUTPUT, "serial");
 	}
 #endif
 
diff --git a/common/iomux.c b/common/iomux.c
index 7cfd9f2e9162..e1bd1b48cd03 100644
--- a/common/iomux.c
+++ b/common/iomux.c
@@ -95,10 +95,10 @@ int iomux_doenv(const int console, const char *arg)
 	for (j = 0; j < i; j++) {
 		/*
 		 * Check whether the device exists and is valid.
-		 * console_assign() also calls search_device(),
+		 * console_assign() also calls console_search_dev(),
 		 * but I need the pointer to the device.
 		 */
-		dev = search_device(io_flag, start[j]);
+		dev = console_search_dev(io_flag, start[j]);
 		if (dev == NULL)
 			continue;
 		/*
diff --git a/common/stdio.c b/common/stdio.c
index a15f30804bf5..abf9b1e91588 100644
--- a/common/stdio.c
+++ b/common/stdio.c
@@ -181,7 +181,7 @@ struct stdio_dev *stdio_get_by_name(const char *name)
 		 * 'stdout', which may include a list of devices separate by
 		 * commas. Obviously this is not going to work, so we ignore
 		 * that case. The call path in that case is
-		 * console_init_r() -> search_device() -> stdio_get_by_name()
+		 * console_init_r() -> console_search_dev() -> stdio_get_by_name()
 		 */
 		if (!strncmp(name, "vidconsole", 10) && !strchr(name, ',') &&
 		    !stdio_probe_device(name, UCLASS_VIDEO, &sdev))
@@ -332,7 +332,7 @@ int stdio_add_devices(void)
 		/*
 		 * If the console setting is not in environment variables then
 		 * console_init_r() will not be calling iomux_doenv() (which
-		 * calls search_device()). So we will not dynamically add
+		 * calls console_search_dev()). So we will not dynamically add
 		 * devices by calling stdio_probe_device().
 		 *
 		 * So just probe all video devices now so that whichever one is
diff --git a/include/console.h b/include/console.h
index 4e06b13736c3..bb186e7be04d 100644
--- a/include/console.h
+++ b/include/console.h
@@ -25,7 +25,7 @@ void clear_ctrlc(void);	/* clear the Control-C condition */
 int disable_ctrlc(int);	/* 1 to disable, 0 to enable Control-C detect */
 int confirm_yesno(void);        /*  1 if input is "y", "Y", "yes" or "YES" */
 
-struct stdio_dev *search_device(int flags, const char *name);
+struct stdio_dev *console_search_dev(int flags, const char *name);
 
 #ifdef CONFIG_CONSOLE_RECORD
 /**
-- 
2.29.2

  parent reply	other threads:[~2020-12-21 12:30 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-21 12:30 [PATCH v3 1/9] console: Introduce console_start() and console_stop() Andy Shevchenko
2020-12-21 12:30 ` [PATCH v3 2/9] console: Keep ->start() and ->stop() balanced Andy Shevchenko
2020-12-21 16:47   ` Simon Glass
2021-01-16 16:24   ` Tom Rini
2020-12-21 12:30 ` [PATCH v3 3/9] console: move search_device() from iomux.h to console.h Andy Shevchenko
2021-01-16 16:24   ` Tom Rini
2020-12-21 12:30 ` Andy Shevchenko [this message]
2020-12-21 16:47   ` [PATCH v3 4/9] console: rename search_device() to console_search_dev() Simon Glass
2021-01-16 16:24   ` Tom Rini
2020-12-21 12:30 ` [PATCH v3 5/9] console: Provide a documentation for console_search_dev() Andy Shevchenko
2021-01-16 16:24   ` Tom Rini
2020-12-21 12:30 ` [PATCH v3 6/9] IOMUX: Preserve console list if realloc() fails Andy Shevchenko
2021-01-16 16:25   ` Tom Rini
2020-12-21 12:30 ` [PATCH v3 7/9] IOMUX: Refactor iomux_doenv() in order to increase readability Andy Shevchenko
2021-01-16 16:25   ` Tom Rini
2020-12-21 12:30 ` [PATCH v3 8/9] IOMUX: Drop indentation level by removing redundant 'else' Andy Shevchenko
2021-01-16 16:25   ` Tom Rini
2020-12-21 12:30 ` [PATCH v3 9/9] IOMUX: Stop dropped consoles Andy Shevchenko
2021-01-16 16:25   ` Tom Rini
2021-01-16 16:24 ` [PATCH v3 1/9] console: Introduce console_start() and console_stop() Tom Rini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201221123008.9930-4-andriy.shevchenko@linux.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox