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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 45A8FC433EF for ; Tue, 9 Nov 2021 22:48:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2C94D610CB for ; Tue, 9 Nov 2021 22:48:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241500AbhKIWup (ORCPT ); Tue, 9 Nov 2021 17:50:45 -0500 Received: from mail.kernel.org ([198.145.29.99]:39744 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238765AbhKIWt6 (ORCPT ); Tue, 9 Nov 2021 17:49:58 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 55C8861037; Tue, 9 Nov 2021 22:47:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1636498031; bh=dj/hPXX+AHLkoauaxECz0N9X/FMkI8WgcbGv80nhji8=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=Hs8sA/XzH5TZ/M3mgzYtarz6IoUW3ma0tnyhQu/0IiqUurY4kJ5tDtBEZD9Q+J8mO wZI9MyMUg/S8EwQS208g64wFyWqnvVZUzY8nPVZjeb7mpD01ZB0F1N9NMM+l1g+nG5 WLA9xgH/rUDQ6NPFtbWqp0K3PIHheaYFna/vt+aA3ESvUWjNGWTJTV03hBgeuBXPLQ gbnuiFdG1rFN9jQIGFWHtXwwnsLs+mVkT1j5iCO+65ok5UoOAbilWdzkthiQABtbJi Kno1jkAVddxPVIFVf9/r+PYxRJuIfv0e14zejULp9u7vohKdQdu1/1UVA2hVzft8AL YJYjE9qMYGX/w== Received: by mail-wr1-f43.google.com with SMTP id r8so572209wra.7; Tue, 09 Nov 2021 14:47:11 -0800 (PST) X-Gm-Message-State: AOAM530PcD3J6LyT8RiWv2pOxouGWvf+/G9oKb+JM0Jglcug7Cz276xL x4I3Ue15NrcU+1DfPRvlJO6QEI44ayVvL0xfJd4= X-Google-Smtp-Source: ABdhPJx0GUEf3uOG+qkjpPk74fgc8++Hq6oUSi1Roc6a6psjzTRzuwUhL0VdmvUAt8cnsK8rQJt77hQolV20uELO4a4= X-Received: by 2002:adf:d1c2:: with SMTP id b2mr13808947wrd.369.1636498029782; Tue, 09 Nov 2021 14:47:09 -0800 (PST) MIME-Version: 1.0 References: <20211109100207.2474024-1-arnd@kernel.org> <20211109100207.2474024-7-arnd@kernel.org> In-Reply-To: From: Arnd Bergmann Date: Tue, 9 Nov 2021 23:46:53 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 6/8] gpiolib: remove legacy gpio_export To: Linus Walleij Cc: Andy Shevchenko , "open list:GPIO SUBSYSTEM" , Arnd Bergmann , Bartosz Golaszewski , Geert Uytterhoeven , Linux ARM , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org On Tue, Nov 9, 2021 at 9:42 PM Linus Walleij wro= te: > On Tue, Nov 9, 2021 at 11:50 AM Arnd Bergmann wrote: > > > I think the TODO list is in Linus' head, > > Oh no, drivers/gpio/TODO > > > but it would include all the files > > that use one of the interfaces in linux/gpio.h. I found about 350 of th= em, > > so there is little point in listing them one at a time. IIRC Linus is g= oing > > through those one subsystem at a time. > > Yeah but if it's just me I doubt that I will manage to do it by the > time I retire in 2037 or so... So the TODO is there to inspire others > to step in and help out. I think at the current rate, it should only take about another ten years: ;= -) $ for i in v3.18 v4.1 v4.4 v4.9 v4.14 v4.19 v5.4 v5.10 v5.15 ; do echo -n $i\ ; git grep -wl '\<\(gpio_direction_input\|gpio_direction_output\|gpio_get_value_cansleep\|= gpio_set_value_cansleep\|gpio_get_value\|gpio_set_value\|gpio_to_irq\|gpio_= request\|gpio_request_one\|gpio_request_array\)\>\|\<\(ARCH_NR_GPIOS\|GPIOF= _DIR_\|GPIOF_INIT\|GPIOF_EXPORT\|GPIOF_OPEN\|GPIOF_IN\|GPIOF_OUT\|gpio_is_v= alid\\|gpio_free\|devm_gpio_\)' $i | wc -l ; done v3.18 676 v4.1 669 v4.4 646 v4.9 639 v4.14 614 v4.19 553 v5.4 465 v5.10 381 v5.15 354 I'm a fan of deconstruction interfaces one function call at a time, which is different from your one-subsystem at a time approach, but these can obviously be done at the same time. This 8-patch series is hopefully a good step in that direction, removing some of the more obscure interfaces and making the rest a little more obvious. I've also started a patch series to remove some of the less common of_gpio portions, which gets rid of of_get_gpio(), of_get_gpio_flags() and of_get_named_gpio_flags() but leaves of_get_named_gpio() in place for now. I'm much less confident about that work though, so I haven't posted that. I think killing off the of_gpio consumer-side interfaces entirely would likely make the biggest impact, as those appear to still be used a lot in relatively modern drivers, while the traditional gpio_request() interfaces are mainly used in drivers for legacy boards that don't have a long future ahead of them unless they get converted to DT. Arnd 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C5384C433EF for ; Wed, 10 Nov 2021 00:01:43 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 8ACA3610E9 for ; Wed, 10 Nov 2021 00:01:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 8ACA3610E9 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org 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:Cc:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=T583A1WuajhCIc084hc2gVrfVLmBtujnvvjZCcnmLDA=; b=ITiENIBAW2Yh0G L3hoKvy2c6REMWfJrnN4yDoMof1VuNokMrkFFN2oDXigpgJe5GCyDeFVP+fICaR2JKwOLOYrMJ05I MyjxnESmjZ8kd+sgawtAKcxORBW0ZcMgJbUOOQbMTi0iYFDpMlFb8QRQM++grBMtPobCYPEIb/N4e YmFNEbexJZMwYVdo76hFwWhnYr3PXYpViI77cGXQrueC/G/JFRjFDjEtYJyg0/mUm0o7+BB+8g7qV iTzOP8D8uVceVoanbmgADhkLzzXC20rkJmuybJYTmEnbCzQXmvOSJSI50+OFFhP8ik3S/MWvfd0FR YF7dhGupLKgl7vcxY3bQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mkb1s-004523-GO; Tue, 09 Nov 2021 23:59:53 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mkZta-003aDC-8I for linux-arm-kernel@lists.infradead.org; Tue, 09 Nov 2021 22:47:15 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id 6C74D6108E for ; Tue, 9 Nov 2021 22:47:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1636498031; bh=dj/hPXX+AHLkoauaxECz0N9X/FMkI8WgcbGv80nhji8=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=Hs8sA/XzH5TZ/M3mgzYtarz6IoUW3ma0tnyhQu/0IiqUurY4kJ5tDtBEZD9Q+J8mO wZI9MyMUg/S8EwQS208g64wFyWqnvVZUzY8nPVZjeb7mpD01ZB0F1N9NMM+l1g+nG5 WLA9xgH/rUDQ6NPFtbWqp0K3PIHheaYFna/vt+aA3ESvUWjNGWTJTV03hBgeuBXPLQ gbnuiFdG1rFN9jQIGFWHtXwwnsLs+mVkT1j5iCO+65ok5UoOAbilWdzkthiQABtbJi Kno1jkAVddxPVIFVf9/r+PYxRJuIfv0e14zejULp9u7vohKdQdu1/1UVA2hVzft8AL YJYjE9qMYGX/w== Received: by mail-wr1-f42.google.com with SMTP id w29so540518wra.12 for ; Tue, 09 Nov 2021 14:47:11 -0800 (PST) X-Gm-Message-State: AOAM531b45DOdE7mBrlgZG9MuCo3KZdMPxgVHbV9d+ljius+rH3BT7ug j3sjhG9NvuXDZyvtWuwiRirljQGfWiudc2Qwz8c= X-Google-Smtp-Source: ABdhPJx0GUEf3uOG+qkjpPk74fgc8++Hq6oUSi1Roc6a6psjzTRzuwUhL0VdmvUAt8cnsK8rQJt77hQolV20uELO4a4= X-Received: by 2002:adf:d1c2:: with SMTP id b2mr13808947wrd.369.1636498029782; Tue, 09 Nov 2021 14:47:09 -0800 (PST) MIME-Version: 1.0 References: <20211109100207.2474024-1-arnd@kernel.org> <20211109100207.2474024-7-arnd@kernel.org> In-Reply-To: From: Arnd Bergmann Date: Tue, 9 Nov 2021 23:46:53 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 6/8] gpiolib: remove legacy gpio_export To: Linus Walleij Cc: Andy Shevchenko , "open list:GPIO SUBSYSTEM" , Arnd Bergmann , Bartosz Golaszewski , Geert Uytterhoeven , Linux ARM , Linux Kernel Mailing List X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211109_144714_378396_9E74FF52 X-CRM114-Status: GOOD ( 24.74 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, Nov 9, 2021 at 9:42 PM Linus Walleij wrote: > On Tue, Nov 9, 2021 at 11:50 AM Arnd Bergmann wrote: > > > I think the TODO list is in Linus' head, > > Oh no, drivers/gpio/TODO > > > but it would include all the files > > that use one of the interfaces in linux/gpio.h. I found about 350 of them, > > so there is little point in listing them one at a time. IIRC Linus is going > > through those one subsystem at a time. > > Yeah but if it's just me I doubt that I will manage to do it by the > time I retire in 2037 or so... So the TODO is there to inspire others > to step in and help out. I think at the current rate, it should only take about another ten years: ;-) $ for i in v3.18 v4.1 v4.4 v4.9 v4.14 v4.19 v5.4 v5.10 v5.15 ; do echo -n $i\ ; git grep -wl '\<\(gpio_direction_input\|gpio_direction_output\|gpio_get_value_cansleep\|gpio_set_value_cansleep\|gpio_get_value\|gpio_set_value\|gpio_to_irq\|gpio_request\|gpio_request_one\|gpio_request_array\)\>\|\<\(ARCH_NR_GPIOS\|GPIOF_DIR_\|GPIOF_INIT\|GPIOF_EXPORT\|GPIOF_OPEN\|GPIOF_IN\|GPIOF_OUT\|gpio_is_valid\\|gpio_free\|devm_gpio_\)' $i | wc -l ; done v3.18 676 v4.1 669 v4.4 646 v4.9 639 v4.14 614 v4.19 553 v5.4 465 v5.10 381 v5.15 354 I'm a fan of deconstruction interfaces one function call at a time, which is different from your one-subsystem at a time approach, but these can obviously be done at the same time. This 8-patch series is hopefully a good step in that direction, removing some of the more obscure interfaces and making the rest a little more obvious. I've also started a patch series to remove some of the less common of_gpio portions, which gets rid of of_get_gpio(), of_get_gpio_flags() and of_get_named_gpio_flags() but leaves of_get_named_gpio() in place for now. I'm much less confident about that work though, so I haven't posted that. I think killing off the of_gpio consumer-side interfaces entirely would likely make the biggest impact, as those appear to still be used a lot in relatively modern drivers, while the traditional gpio_request() interfaces are mainly used in drivers for legacy boards that don't have a long future ahead of them unless they get converted to DT. Arnd _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel