From patchwork Sun Jun 4 12:35:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 13266601 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 68B73C7EE23 for ; Sun, 4 Jun 2023 12:35:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230411AbjFDMe7 (ORCPT ); Sun, 4 Jun 2023 08:34:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51302 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229903AbjFDMe5 (ORCPT ); Sun, 4 Jun 2023 08:34:57 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D41CDD2; Sun, 4 Jun 2023 05:34:56 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 551126168A; Sun, 4 Jun 2023 12:34:56 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A627CC433A1; Sun, 4 Jun 2023 12:34:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1685882095; bh=uSiepLtWjVhXcCAJfRm0oQIqf205bq5k7/+2TYyI62A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HVm95rU2CTfgP+eezc4CeuRqfmOHm6twlNyd3vAM8q5LESTSzBYDIvxXsck9a+yNT JZiMgMyRIlSLkKvEnel+7t8TlVDgiiCIRsSJPB4MLV05UaKDNaFi5SSqhiVq1KzMl8 +p6oP78Teup6GcxJkkZQfcJ2u5mhg5L0KoTw/tP3q1qYKNyaQ8eIjK6STeHM3lEWpk PhLenYtZ9xYevvkneySJ1f8A8hF6gAuuAbHfJG25Qw+7+oGmbFUxFwWD0uT7JGFSBG cvlKjsYi+5B2qst2qMY53xFS3wwXY/8rwmUGFTz4/b/LWVm1NMICDxEZqZ/sLfFaDy k7GGJUSglGmyg== Received: from johan by xi.lan with local (Exim 4.94.2) (envelope-from ) id 1q5mww-0001DZ-Ou; Sun, 04 Jun 2023 14:35:10 +0200 From: Johan Hovold To: Johan Hovold Cc: Greg Kroah-Hartman , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Corey Minyard Subject: [PATCH v2 3/3] USB: serial: report unsupported break signalling Date: Sun, 4 Jun 2023 14:35:05 +0200 Message-Id: <20230604123505.4661-4-johan@kernel.org> X-Mailer: git-send-email 2.39.3 In-Reply-To: <20230604123505.4661-1-johan@kernel.org> References: <20230604123505.4661-1-johan@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org Instead of returning success when a driver does not support break signalling, return an error to let user space know and to avoid waiting when break is not supported. Signed-off-by: Johan Hovold --- drivers/usb/serial/usb-serial.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c index 470634444af7..7b4805c1004d 100644 --- a/drivers/usb/serial/usb-serial.c +++ b/drivers/usb/serial/usb-serial.c @@ -541,7 +541,7 @@ static int serial_break(struct tty_struct *tty, int break_state) if (port->serial->type->break_ctl) return port->serial->type->break_ctl(tty, break_state); - return 0; + return -ENOTTY; } static int serial_proc_show(struct seq_file *m, void *v)