summaryrefslogtreecommitdiff
path: root/common/console.c
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2021-02-11 17:09:41 +0200
committerTom Rini <trini@konsulko.com>2021-02-16 11:16:08 -0500
commitb672c1619bb9615aff3ebbe15c20083fd0f58f9b (patch)
treef53f556f1aefe4e1bc79d228188ed4a8b06ccef1 /common/console.c
parent658d6c583663ae4f37cb6a5e104b2bf864fbc497 (diff)
IOMUX: Split out iomux_match_device() helper
Deduplicate the code used in a few places by splitting out a common helper. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Diffstat (limited to 'common/console.c')
-rw-r--r--common/console.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/common/console.c b/common/console.c
index 7b6861f214..523fb45a99 100644
--- a/common/console.c
+++ b/common/console.c
@@ -252,15 +252,14 @@ static void console_devices_set(int file, struct stdio_dev *dev)
*/
static bool console_needs_start_stop(int file, struct stdio_dev *sdev)
{
- int i, j;
+ int i;
for (i = 0; i < ARRAY_SIZE(cd_count); i++) {
if (i == file)
continue;
- for (j = 0; j < cd_count[i]; j++)
- if (console_devices[i][j] == sdev)
- return false;
+ if (iomux_match_device(console_devices[i], cd_count[i], sdev) >= 0)
+ return false;
}
return true;
}