Unverified Commit e4ad279a authored by Zev Weiss's avatar Zev Weiss Committed by Arnd Bergmann
Browse files

soc: aspeed: uart-routing: Use __sysfs_match_string



The existing use of match_string() caused it to reject 'echo foo' due
to the implicitly appended newline, which was somewhat ergonomically
awkward and inconsistent with typical sysfs behavior.  Using the
__sysfs_* variant instead provides more convenient and consistent
linefeed-agnostic behavior.

Signed-off-by: default avatarZev Weiss <zev@bewilderbeest.net>
Fixes: c6807970 ("soc: aspeed: Add UART routing support")
Reviewed-by: default avatarJoel Stanley <joel@jms.id.au>
Link: https://lore.kernel.org/r/20230628083735.19946-2-zev@bewilderbeest.net


Signed-off-by: default avatarJoel Stanley <joel@jms.id.au>
Link: https://lore.kernel.org/r/20230810122941.231085-1-joel@jms.id.au


Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
parent 42ff49a1
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -524,7 +524,7 @@ static ssize_t aspeed_uart_routing_store(struct device *dev,
	struct aspeed_uart_routing_selector *sel = to_routing_selector(attr);
	int val;

	val = match_string(sel->options, -1, buf);
	val = __sysfs_match_string(sel->options, -1, buf);
	if (val < 0) {
		dev_err(dev, "invalid value \"%s\"\n", buf);
		return -EINVAL;