From mboxrd@z Thu Jan 1 00:00:00 1970 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 AF1F7C001E0 for ; Sat, 21 Oct 2023 16:15:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231770AbjJUQPc (ORCPT ); Sat, 21 Oct 2023 12:15:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56552 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231777AbjJUQPb (ORCPT ); Sat, 21 Oct 2023 12:15:31 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A9FFB1A8; Sat, 21 Oct 2023 09:15:26 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A6404C433C8; Sat, 21 Oct 2023 16:15:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1697904926; bh=SHOy2rMtReYiFTxDJT1AME1BMS7WvUye36eUPs7PVdE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=mlg+wTlhHgYcLmcjz6kx2/83Mrg84TXk9muSAlCjmS1G6Ip8FPzdTVIRQQB/O9cRI iTDSJ4Ws8RW/Pvx0qzZeHX3BP10NqnPV4KsIYKW0EKK1cQhQOfcym1ZLAKMxseud88 OgcKhARRp6EtWP8Zx0u8BP7rj9IjOqeflF1Pl308= Date: Sat, 21 Oct 2023 18:15:23 +0200 From: Greg KH To: Florian Eckert Cc: Eckert.Florian@googlemail.com, jirislaby@kernel.org, pavel@ucw.cz, lee@kernel.org, kabel@kernel.org, u.kleine-koenig@pengutronix.de, ansuelsmth@gmail.com, m.brock@vanmierlo.com, linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, linux-leds@vger.kernel.org Subject: Re: [PATCH v4 2/3] tty: add new helper function tty_get_tiocm Message-ID: <2023102115-stock-scrambled-f7d5@gregkh> References: <20231019112809.881730-1-fe@dev.tdt.de> <20231019112809.881730-3-fe@dev.tdt.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231019112809.881730-3-fe@dev.tdt.de> Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org On Thu, Oct 19, 2023 at 01:28:08PM +0200, 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_tiocm' only returns the status register. > This information can then be processed further in the ledtrig-tty > trigger. Writing changelogs are hard. You are including a lot of information in here that really doesn't need to be, as you are focusing on your specific use case, which is fine, but you are creating a generic function. This can be simpler, how about something like this: There is no in-kernel function to get the status register of a tty device like the TIOCMGET ioctl returns to userspace. Create a new function, tty_get_tiocm(), to obtain the status register that other portions of the kernel can call if they need this information, and move the existing internal tty_tiocmget() function to use this interface. Sound good? The code portion looks fine to me, thanks for doing this. greg k-h