diff mbox series

soc: aspeed: uart-routing: Use __sysfs_match_string

Message ID 20230810122941.231085-1-joel@jms.id.au (mailing list archive)
State Accepted
Commit e4ad279ae345413d900d791f2f618d0a1cd0d791
Headers show
Series soc: aspeed: uart-routing: Use __sysfs_match_string | expand

Commit Message

Joel Stanley Aug. 10, 2023, 12:29 p.m. UTC
From: Zev Weiss <zev@bewilderbeest.net>

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: Zev Weiss <zev@bewilderbeest.net>
Fixes: c6807970c3bc ("soc: aspeed: Add UART routing support")
Reviewed-by: Joel Stanley <joel@jms.id.au>
Link: https://lore.kernel.org/r/20230628083735.19946-2-zev@bewilderbeest.net
Signed-off-by: Joel Stanley <joel@jms.id.au>
---
Soc maintainers, can we please get this one applied as a fix for 6.5?

 drivers/soc/aspeed/aspeed-uart-routing.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

patchwork-bot+linux-soc@kernel.org Aug. 12, 2023, 10:20 a.m. UTC | #1
Hello:

This patch was applied to soc/soc.git (arm/fixes)
by Arnd Bergmann <arnd@arndb.de>:

On Thu, 10 Aug 2023 21:59:41 +0930 you wrote:
> From: Zev Weiss <zev@bewilderbeest.net>
> 
> 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.
> 
> [...]

Here is the summary with links:
  - soc: aspeed: uart-routing: Use __sysfs_match_string
    https://git.kernel.org/soc/soc/c/e4ad279ae345

You are awesome, thank you!
diff mbox series

Patch

diff --git a/drivers/soc/aspeed/aspeed-uart-routing.c b/drivers/soc/aspeed/aspeed-uart-routing.c
index ef8b24fd1851..59123e1f27ac 100644
--- a/drivers/soc/aspeed/aspeed-uart-routing.c
+++ b/drivers/soc/aspeed/aspeed-uart-routing.c
@@ -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;