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 X-Spam-Level: X-Spam-Status: No, score=-3.9 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 82B01C0650F for ; Wed, 14 Aug 2019 08:48:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5634A2084F for ; Wed, 14 Aug 2019 08:48:56 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="QFmd1l1Z" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726126AbfHNIsz (ORCPT ); Wed, 14 Aug 2019 04:48:55 -0400 Received: from mail-lj1-f194.google.com ([209.85.208.194]:45213 "EHLO mail-lj1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725996AbfHNIsz (ORCPT ); Wed, 14 Aug 2019 04:48:55 -0400 Received: by mail-lj1-f194.google.com with SMTP id t3so15522759ljj.12 for ; Wed, 14 Aug 2019 01:48:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=AaXXXJyoRix4ci7hEwut2qc9UXNgLOAwJXuK5aHAjno=; b=QFmd1l1ZbeAWnxu46lwnT+tGjxGDvgauGe76FXrPjgMTzAof5eg4lgP3Vx+eylh+tq MGldTRkYbDyDXk4rPfvSWWOk4caLcPHHLYomaksYEesHbO83AMK64X+hTW98NwDcBReh 76aqgPbArHQesF2KyFSX6EdAmA5JxRAZ05W2b0HeUknGbH10PEEpmX3NV4ZTCgh5hU9p WJcacsA8ffuH4gxKQqyegZ2O3DVI42SUe3GnfMfr0KEavpNFTwHn1q1Pks6uJoL8FD90 EFkUbMkTlTInDVoqoZozZjQfXkcbPXEgFvoJpu2YNVhMlnkzyla5BSneHw2IMiE72bvb 4aoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=AaXXXJyoRix4ci7hEwut2qc9UXNgLOAwJXuK5aHAjno=; b=X1ZmRJq8qOel11d605FmFCHtEQlQF2DvxFNziNIfuYN2364KU4BXpzgKRLkDNquROO kqoQp7rJ2xDoHIFdn78hlY/17ZPxNpir16yfbiNGM1OLsRLW/FvrCboeHga6W3HkBGXh CTBEoADA4ZL1BfLVbamEadqpcJ2ljVVr79oKjTdxNKmxsl+MOf6M1Wm6LYbXPAqRO0MW 6eO+GjC3NOJ4OSHBsFqlWkzwIMRKpMEKz9qdi76KWSpq5fOIodNCLMnT2Ij7Awphj8GN Cj1xeWxvYtM69RH7kfywU9ZcOtUdxzTcskChTUqxUjBIXdB8B0uhe4KF1lboIekC1sMu N7+A== X-Gm-Message-State: APjAAAUTp6w8IqW2JC4xyCZyWbPmrWgAboBmMeagK7OTfkAGBE763oY2 TIWTFjHLNum4LvHUY2Z4SOclsuX09vxAlu/h4c1lsA== X-Google-Smtp-Source: APXvYqxYtukqY2v01INeb/yow8UvGVlTOeiUie13T4PU1HPjHvFqbbFTMWwmN9WngAAJzyw4VsZgq3FLqy0pudhxhk4= X-Received: by 2002:a2e:9f0f:: with SMTP id u15mr14760601ljk.54.1565772533555; Wed, 14 Aug 2019 01:48:53 -0700 (PDT) MIME-Version: 1.0 References: <20190808132543.26274-1-sr@denx.de> In-Reply-To: From: Linus Walleij Date: Wed, 14 Aug 2019 10:48:42 +0200 Message-ID: Subject: Re: [PATCH 1/2] gpiolib: Add for_each_gpio_suffix() helper To: Geert Uytterhoeven Cc: Stefan Roese , "open list:SERIAL DRIVERS" , "open list:GPIO SUBSYSTEM" , Andy Shevchenko , Pavel Machek , Greg Kroah-Hartman Content-Type: text/plain; charset="UTF-8" Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org On Mon, Aug 12, 2019 at 1:18 PM Geert Uytterhoeven wrote: > On Sat, Aug 10, 2019 at 10:27 AM Linus Walleij wrote: > > On Thu, Aug 8, 2019 at 3:25 PM Stefan Roese wrote: > > > Add a helper macro to enable the interation over all supported GPIO > > > suffixes (currently "gpios" & "gpio"). This will be used by the serial > > > mctrl code to check, if a GPIO property exists before requesting it. > > > > > > Signed-off-by: Stefan Roese > > > Suggested-by: Andy Shevchenko > > > Cc: Andy Shevchenko > > > Cc: Geert Uytterhoeven > > > Cc: Pavel Machek > > > Cc: Linus Walleij > > > Cc: Greg Kroah-Hartman > > > > I really like this patch, it makes things so much more readable. > > Do we really need to spread this *-gpio" legacy support all over the kernel? Not really :/ Isn't it possible to use something like gpiod_count(dev, "foo") to check for any GPIOs instead? Yours, Linus Walleij