From patchwork Wed Jun 28 08:37:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zev Weiss X-Patchwork-Id: 13295383 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1CBB5EB64D7 for ; Wed, 28 Jun 2023 08:38:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=Ly1DHe0eW7ZVPwC1M9yET/Onwp+JjxsTU7tWbsZrBLQ=; b=2ObruMOygjbkBI gaZeDVUW6Ieqdom9qIwRLzzUABZZMBnG6wLE/W4aOAiIUwnYkXWOTFQixMt0R3GkYx4xaLksRuYt1 O6qQMIDGbXDhCAs1xQ4X7CsRxN9DVZs80QHeMnZFUFeZYI+VuIbfyGuhcJwfGgfC7kfC0v3bH051C j7FS8T0nb6R6bXBxRT4hNEi/1KNTLBDga1BqiX3/oBVxzaoufsX0wyBekTdgLKysE4usK68qUiNjk I/WmyG9GarAZzbQVcXAFNJBaCsiyS/SHNoAePeEhAizf6VEtSez2/m1EcwnOmJYFxH0IyI/0g+t48 ZY/31OxlpuOOCV/WWL+Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qEQga-00FB87-02; Wed, 28 Jun 2023 08:38:00 +0000 Received: from thorn.bewilderbeest.net ([2605:2700:0:5::4713:9cab]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qEQgX-00FB7X-0W for linux-arm-kernel@lists.infradead.org; Wed, 28 Jun 2023 08:37:58 +0000 Received: from hatter.bewilderbeest.net (174-21-172-149.tukw.qwest.net [174.21.172.149]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: zev) by thorn.bewilderbeest.net (Postfix) with ESMTPSA id 44A4B31E; Wed, 28 Jun 2023 01:37:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bewilderbeest.net; s=thorn; t=1687941472; bh=rOzvsgROD/f26mzOAzvMUcVNNF4sR/rHxdezjOWfqto=; h=From:To:Cc:Subject:Date:From; b=Y9TP19DNIpS58C1xU+PXyja7lpGsJHv/rWufUqAu1Dy5pWUE0Cx8FhMUMIb9uM9z4 gG3VdzvIgNFNW053bC2RVxS3b5BpZM9aAhA1W+f0ovQ7M2UB4O/Tw0uRl97/5Y9CMb s2xjM0PkvW+JSP4XxtYyKQgSHq2PHFjQ5kQ7lkYg= From: Zev Weiss To: Andrew Jeffery , Joel Stanley , linux-aspeed@lists.ozlabs.org Cc: Zev Weiss , Chia-Wei Wang , Oskar Senft , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, openbmc@lists.ozlabs.org Subject: [PATCH] soc: aspeed: uart-routing: Use __sysfs_match_string Date: Wed, 28 Jun 2023 01:37:36 -0700 Message-ID: <20230628083735.19946-2-zev@bewilderbeest.net> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230628_013757_229568_923BBC21 X-CRM114-Status: GOOD ( 10.39 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 Reviewed-by: Joel Stanley --- drivers/soc/aspeed/aspeed-uart-routing.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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;