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 D3CFEC433EF for ; Tue, 9 Nov 2021 10:50:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BF10961151 for ; Tue, 9 Nov 2021 10:50:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243292AbhKIKx3 (ORCPT ); Tue, 9 Nov 2021 05:53:29 -0500 Received: from mail.kernel.org ([198.145.29.99]:49076 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245455AbhKIKxU (ORCPT ); Tue, 9 Nov 2021 05:53:20 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 17F71611F0; Tue, 9 Nov 2021 10:50:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1636455035; bh=EQ2Y5pkSSbqTDlcZZ+vlV+jRlTkeuJkYjOzMF69zAo0=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=qS1n17lVGL0kEBUQiS9z+dUebAG5JndAxle9gkY6QJ6a4ZppPfdV96Q52ICuCXG2f 7Pbsd/Cnh2ppvQDjbBoK7O2t9QSd0/wJRpiNI476jbk5s4xIjPD4O6oEZHJIK7aGBn uNFY/OVX/D9sCtwLIncBdo+ce7jBOA+7oRxeVkH3zFxMbq5yGRWKFKU+s2r3Ftuhjb mVtNgMC3ko3lP3uMhM+IpajSS+rLw3Siy2SVGmB9qTx/iTU7PX9Q/h+DfZYzhAeJ7X 4KCSnnA1+r4sqWg9lFKs1jrj771S0/tDmxGx8ht+zYf1uhxOsLR6OD6XVygfvYwfcT pzhumg/d0UmQg== Received: by mail-wm1-f48.google.com with SMTP id b184-20020a1c1bc1000000b0033140bf8dd5so1916039wmb.5; Tue, 09 Nov 2021 02:50:35 -0800 (PST) X-Gm-Message-State: AOAM532V41LQelJnUQLE/Z+BluKlzW3mar7PIrsnnkQE02cOd+Ik/9PM c54kqCHYUBNGgL61qMLAEKlk4fJEYRxuLDOGmK4= X-Google-Smtp-Source: ABdhPJwQBO/Ss3ZA0/3Ekr+aXKUm/5vIOjwi4khqDaKsRbKgRpm/1VlgiHZXFtkNE8I27My8QQVBY/+teVR+2z0Y2Rg= X-Received: by 2002:a1c:770e:: with SMTP id t14mr5881966wmi.173.1636455033495; Tue, 09 Nov 2021 02:50:33 -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 11:50:17 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 6/8] gpiolib: remove legacy gpio_export To: Andy Shevchenko Cc: "open list:GPIO SUBSYSTEM" , Arnd Bergmann , Linus Walleij , Bartosz Golaszewski , Geert Uytterhoeven , Linux ARM , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org On Tue, Nov 9, 2021 at 11:30 AM Andy Shevchenko wrote: > > On Tue, Nov 09, 2021 at 11:02:05AM +0100, Arnd Bergmann wrote: > > From: Arnd Bergmann > > > > There are only a handful of users of gpio_export() and > > related functions. > > > > As these are just wrappers around the modern gpiod_export() > > helper, remove the wrappers and open-code the gpio_to_desc > > in all callers to shrink the legacy API. > > Reviewed-by: Andy Shevchenko > > What I wish to see meanwhile is a section in the TODO list somewhere to clean > up those modules that have gpio.h. Linus, do we have one in the kernel or is > it your personal TODO? > > In case we have one in the kernel, please add there modules you modified in > a way that they still need further attention. I think the TODO list is in Linus' head, 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. It might help to make it harder to get new users if we add some pattern matching to scripts/checkpatch.pl, and/or something for scripts/coccinelle/. I don't think it's possible to convert a gpio_request() user to gpio_get() in a scripted way because you usually have to change the platform side at the same time as the driver side. I also found that we have a ton of users of linux/of_gpio.h, which is somewhere inbetween the linux/gpio.h interface and the linux/gpio/consumer.h version. > > @@ -259,17 +259,19 @@ static int evm_sw_setup(struct i2c_client *client, int gpio, > > char label[10]; > > > > for (i = 0; i < 4; ++i) { > > + struct gpio_desc *desc = gpio_to_desc(gpio + i); > > + > > snprintf(label, 10, "user_sw%d", i); > > - status = gpio_request(gpio, label); > > + status = gpio_request(gpio + i, label); > > Shouldn't be gpiod_get() or so at the end? Yes, but that would be a more invasive change that I think should be done separately. 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 CA707C433F5 for ; Tue, 9 Nov 2021 10:51:57 +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 8FB4861054 for ; Tue, 9 Nov 2021 10:51:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 8FB4861054 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=Z/qM7+NuBlzVP49UHAyozqCXA3E9evEHeI28efzxG6Y=; b=TBt1Vd7Tknzqly qFOLjqZvk0JFlhBejzg0M0whQhjgoEH/EqBH5EoJzTPNr4skrnefclbDM1fDQc3yASXcAM7kcgqL/ KweQAU7O4TJZnnTaEWluLVLx/P8NuqkUBmollYC9qqsg6ya9+nvFwu8gJknXy89HHSq25+wTrwXgF M5XiQYFxrevs8HtbHQMtBUsLVzWBZQqp3I2JMFl7oqM+UMtyBLjC2ttoDF/6SpqOUqrpK7lwbPUM4 1aR4Orc3cYYj6E4HCjDJyNP9Shm5q1XyK6BcgUEG3D8dq1lseso7Q42U57Dg6s1Jjpljty1vuTZbO gOjOEsnwt1I6AXgQOYvA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mkOi7-001cOY-3j; Tue, 09 Nov 2021 10:50:39 +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 1mkOi3-001cOE-EC for linux-arm-kernel@lists.infradead.org; Tue, 09 Nov 2021 10:50:36 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id 0BAA9611C4 for ; Tue, 9 Nov 2021 10:50:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1636455035; bh=EQ2Y5pkSSbqTDlcZZ+vlV+jRlTkeuJkYjOzMF69zAo0=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=qS1n17lVGL0kEBUQiS9z+dUebAG5JndAxle9gkY6QJ6a4ZppPfdV96Q52ICuCXG2f 7Pbsd/Cnh2ppvQDjbBoK7O2t9QSd0/wJRpiNI476jbk5s4xIjPD4O6oEZHJIK7aGBn uNFY/OVX/D9sCtwLIncBdo+ce7jBOA+7oRxeVkH3zFxMbq5yGRWKFKU+s2r3Ftuhjb mVtNgMC3ko3lP3uMhM+IpajSS+rLw3Siy2SVGmB9qTx/iTU7PX9Q/h+DfZYzhAeJ7X 4KCSnnA1+r4sqWg9lFKs1jrj771S0/tDmxGx8ht+zYf1uhxOsLR6OD6XVygfvYwfcT pzhumg/d0UmQg== Received: by mail-wm1-f44.google.com with SMTP id o4-20020a1c7504000000b0032cab7473caso1445700wmc.1 for ; Tue, 09 Nov 2021 02:50:34 -0800 (PST) X-Gm-Message-State: AOAM533OAMzI+EnsNfiyP9ZAc3dAApxGygMkio4gYwXnlrcElC0Ba/bS 3f4iyKGlqz/OccIW8eABe12uGRTqDMKg73kPTRA= X-Google-Smtp-Source: ABdhPJwQBO/Ss3ZA0/3Ekr+aXKUm/5vIOjwi4khqDaKsRbKgRpm/1VlgiHZXFtkNE8I27My8QQVBY/+teVR+2z0Y2Rg= X-Received: by 2002:a1c:770e:: with SMTP id t14mr5881966wmi.173.1636455033495; Tue, 09 Nov 2021 02:50:33 -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 11:50:17 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 6/8] gpiolib: remove legacy gpio_export To: Andy Shevchenko Cc: "open list:GPIO SUBSYSTEM" , Arnd Bergmann , Linus Walleij , 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_025035_538253_FB8D32EB X-CRM114-Status: GOOD ( 29.58 ) 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 11:30 AM Andy Shevchenko wrote: > > On Tue, Nov 09, 2021 at 11:02:05AM +0100, Arnd Bergmann wrote: > > From: Arnd Bergmann > > > > There are only a handful of users of gpio_export() and > > related functions. > > > > As these are just wrappers around the modern gpiod_export() > > helper, remove the wrappers and open-code the gpio_to_desc > > in all callers to shrink the legacy API. > > Reviewed-by: Andy Shevchenko > > What I wish to see meanwhile is a section in the TODO list somewhere to clean > up those modules that have gpio.h. Linus, do we have one in the kernel or is > it your personal TODO? > > In case we have one in the kernel, please add there modules you modified in > a way that they still need further attention. I think the TODO list is in Linus' head, 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. It might help to make it harder to get new users if we add some pattern matching to scripts/checkpatch.pl, and/or something for scripts/coccinelle/. I don't think it's possible to convert a gpio_request() user to gpio_get() in a scripted way because you usually have to change the platform side at the same time as the driver side. I also found that we have a ton of users of linux/of_gpio.h, which is somewhere inbetween the linux/gpio.h interface and the linux/gpio/consumer.h version. > > @@ -259,17 +259,19 @@ static int evm_sw_setup(struct i2c_client *client, int gpio, > > char label[10]; > > > > for (i = 0; i < 4; ++i) { > > + struct gpio_desc *desc = gpio_to_desc(gpio + i); > > + > > snprintf(label, 10, "user_sw%d", i); > > - status = gpio_request(gpio, label); > > + status = gpio_request(gpio + i, label); > > Shouldn't be gpiod_get() or so at the end? Yes, but that would be a more invasive change that I think should be done separately. Arnd _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel