Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp1774167rdh; Tue, 26 Sep 2023 03:14:41 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHCR9L3v/HxjCFZSj9PFpqrxe871qg35J5NlfIYOe3UCwQZ6GHKL/8yaJFxjlOp8ZH1OLHK X-Received: by 2002:a25:cacd:0:b0:d71:6bc4:ac6d with SMTP id a196-20020a25cacd000000b00d716bc4ac6dmr8109081ybg.65.1695723281435; Tue, 26 Sep 2023 03:14:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695723281; cv=none; d=google.com; s=arc-20160816; b=HoZ3N7zD4XvadK6yChVlMidRSatohnIkoitGKnwLZtSzS9y2nKP7tpeMv/XVYy5fj2 pSRbruYpOKWStIoVppHeXOlF7Fo8022nsZ7U3p6+zWzN/wii8r3eQ0HNunJM3brB2Ykv b+6TCQZgG2fOeFF3efwcEsumGgTpSqraoNxlJhuz/cAsRCz9uMQYFPhkjfC4hyxuFTJp bIRRiffzxNennis8RbYoy6JbRjDUnzt3buFx3ldxcGLaR2FIlQYhO9UBS5Tgs/pAfe+R djfxB8OvhfMvIj5c3/hQCVu8IKOiAg4d3QN3K1vOQ5Jo2uW/C4GEQJsoXCHqdVQRrw/W 21uA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:autocrypt :from:references:cc:to:content-language:subject:user-agent :mime-version:date:message-id; bh=n96H8BEZHqJircVrfwEM99T3b49LOKirf10WQBBYnrM=; fh=igoXikDqyvz5/jYrKMrV24FYrPOR4b044HZRhmbk72A=; b=VfZjNSwcj3pOUxdg2dZxxXIem6Mgf+XB21wva2cxKseG2i7vKl6gR66IaCRm/EB9gE d5E6Tk+ToS9N3CZnwHQz71HFRAqQx+IYvJb/YvWDI/2H3b/LbVEAWvjm5menYHSdOJMN 3M+hpjYM5SSo0tpUFyBzVyg8CF4THecXVHTczB8ry1CtqVl+Q+Dbe4YdEh4v76YgiR66 MTUluzs+AxK/rWOFAOwhUvEbKolDgmv0IcHRtN7i1eMUxQ9YlFH+34yMBzkBXggETTMv WcZ1tvQkgszLbuk6h/ZdrIn/cOlFbv8O4kXabQYJQWmAO8ryxhebuQ6yJhA7IilPBLS7 We0g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id y7-20020a636407000000b005740b4723f9si12483336pgb.811.2023.09.26.03.14.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Sep 2023 03:14:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 0A8B481BC480; Tue, 26 Sep 2023 02:48:59 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234305AbjIZJtA (ORCPT + 99 others); Tue, 26 Sep 2023 05:49:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58278 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234304AbjIZJs6 (ORCPT ); Tue, 26 Sep 2023 05:48:58 -0400 Received: from mail-ej1-f48.google.com (mail-ej1-f48.google.com [209.85.218.48]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 035DBFC; Tue, 26 Sep 2023 02:48:49 -0700 (PDT) Received: by mail-ej1-f48.google.com with SMTP id a640c23a62f3a-9b281a2aa94so462152666b.2; Tue, 26 Sep 2023 02:48:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695721727; x=1696326527; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=n96H8BEZHqJircVrfwEM99T3b49LOKirf10WQBBYnrM=; b=F8Z9OjlIUf9vqSk54w3yVovlTnKXJ/Ko1AWfNIx5O/t0REBvpVlDrAQ6GU7vzMOlKc d6He7d2sOohrkvpuovZS+Kh8QQAGlUu5ChCNr4SHOqTu4Tp4XCs3JvpZ9ntqoCZs7ZIf 1X2mfN/yzYlE0V3/udC2MJAEkNO6iYD34qAlVV4d6VpIOOC+Q+kMqVTYKF7lXO2PzXcj hPKOauPm6EvtZ0wK9t40av7lHSr5SIJJlMcKtzQm8ywW0YkC4LF8NbbJzGHe/sXA8HrO FNFHMcCUqCi4ZA40SritB2ynksf02gRluStq3ovBcggqrpGAa1MRI6i9SxJgtef2O1Od 1dhA== X-Gm-Message-State: AOJu0YzMffiAE37VMFbsMc/J+pl6TrgMhL1P6KGoBxxp9WlxfhzUo0Dv eo2HA8492FlgA4MuEEaEkIs= X-Received: by 2002:a17:907:7789:b0:9a3:faf:7aaa with SMTP id ky9-20020a170907778900b009a30faf7aaamr7887313ejc.15.1695721727156; Tue, 26 Sep 2023 02:48:47 -0700 (PDT) Received: from ?IPV6:2a0b:e7c0:0:107::aaaa:59? ([2a0b:e7c0:0:107::aaaa:59]) by smtp.gmail.com with ESMTPSA id o16-20020a17090608d000b009a16975ee5asm7487692eje.169.2023.09.26.02.48.46 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 26 Sep 2023 02:48:46 -0700 (PDT) Message-ID: Date: Tue, 26 Sep 2023 11:48:45 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 1/2] tty: add new helper function tty_get_mget Content-Language: en-US To: Florian Eckert , Eckert.Florian@googlemail.com, gregkh@linuxfoundation.org, pavel@ucw.cz, lee@kernel.org, kabel@kernel.org, u.kleine-koenig@pengutronix.de Cc: linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, linux-leds@vger.kernel.org References: <20230926093607.59536-1-fe@dev.tdt.de> <20230926093607.59536-2-fe@dev.tdt.de> From: Jiri Slaby Autocrypt: addr=jirislaby@kernel.org; keydata= xsFNBE6S54YBEACzzjLwDUbU5elY4GTg/NdotjA0jyyJtYI86wdKraekbNE0bC4zV+ryvH4j rrcDwGs6tFVrAHvdHeIdI07s1iIx5R/ndcHwt4fvI8CL5PzPmn5J+h0WERR5rFprRh6axhOk rSD5CwQl19fm4AJCS6A9GJtOoiLpWn2/IbogPc71jQVrupZYYx51rAaHZ0D2KYK/uhfc6neJ i0WqPlbtIlIrpvWxckucNu6ZwXjFY0f3qIRg3Vqh5QxPkojGsq9tXVFVLEkSVz6FoqCHrUTx wr+aw6qqQVgvT/McQtsI0S66uIkQjzPUrgAEtWUv76rM4ekqL9stHyvTGw0Fjsualwb0Gwdx ReTZzMgheAyoy/umIOKrSEpWouVoBt5FFSZUyjuDdlPPYyPav+hpI6ggmCTld3u2hyiHji2H cDpcLM2LMhlHBipu80s9anNeZhCANDhbC5E+NZmuwgzHBcan8WC7xsPXPaiZSIm7TKaVoOcL 9tE5aN3jQmIlrT7ZUX52Ff/hSdx/JKDP3YMNtt4B0cH6ejIjtqTd+Ge8sSttsnNM0CQUkXps w98jwz+Lxw/bKMr3NSnnFpUZaxwji3BC9vYyxKMAwNelBCHEgS/OAa3EJoTfuYOK6wT6nadm YqYjwYbZE5V/SwzMbpWu7Jwl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zqzffzBLXZCujlYQ DFXpyMNVJ2ZwPmX2mWEoYuaBU0JN7wM+/zWgOf2zRwhEuD3A2cO2PxoiIfyUEfB9SSmffaK/ S4xXoB6wvGENZ85Hg37C7WDNdaAt6Xh2uQIly5grkgvWppkNy4ZHxE+jeNsU7tg= In-Reply-To: <20230926093607.59536-2-fe@dev.tdt.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Tue, 26 Sep 2023 02:48:59 -0700 (PDT) On 26. 09. 23, 11:36, Florian Eckert wrote: > The struct 'tty_struct' has a callback to read the status flags of the tty > if the tty driver provides them. So fare, the data is transferred directly > to userspace with the function 'tty_tiocmget'. This function cannot be > used to evaluate the status line of the tty interface in the ledtrig-tty > trigger. To make this possible, a new function must be added that does > not immediately pass the data on to userspace. > > The new function 'tty_get_mget' only returns the status register. > This information can then be processed further in the ledtrig-tty > trigger. > > Signed-off-by: Florian Eckert > --- > drivers/tty/tty_io.c | 29 +++++++++++++++++++++++------ > include/linux/tty.h | 1 + > 2 files changed, 24 insertions(+), 6 deletions(-) > > diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c > index 8a94e5a43c6d..8070ed0ce41f 100644 > --- a/drivers/tty/tty_io.c > +++ b/drivers/tty/tty_io.c > @@ -2494,6 +2494,25 @@ static int send_break(struct tty_struct *tty, unsigned int duration) > return retval; > } > > +/** > + * tty_get_mget - get modem status Heh, the naming is funny. It apparently comes from tiocmget. But that comes from: tty ioctl modem get (TIOCMGET) tty ioctl modem set (TIOCMSET) So you should name it like tty_get_modem() not get_mget(). Also those extra spaces around "-" caused some issues in the generated output and should be removed (everywhere). > + * @tty: tty device > + * > + * Obtain the modem status bits from the tty driver if the feature > + * is supported. > + * Superfluous empty line here. > + */ > +int tty_get_mget(struct tty_struct *tty) > +{ > + int retval = -ENOTTY; > + > + if (tty->ops->tiocmget) > + retval = tty->ops->tiocmget(tty); > + > + return retval; > +} > +EXPORT_SYMBOL_GPL(tty_get_mget); thanks, -- js suse labs