Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp7865635ybc; Fri, 29 Nov 2019 02:17:51 -0800 (PST) X-Google-Smtp-Source: APXvYqxbjyrNu2P/lcyM56s3xTmVtxAzsXZX5BXPXSYmI+YLPCo/LQ2XYCoypQxBMnFRSwAJBJs8 X-Received: by 2002:a50:b626:: with SMTP id b35mr44227580ede.183.1575022671117; Fri, 29 Nov 2019 02:17:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575022671; cv=none; d=google.com; s=arc-20160816; b=N0oZbRI6ltt52Y/iw6JxvwHBHra+1uNCfMbpD+zOHf467nXleMbcrHBkDOoOGvpL+z jpfJqm16iHHY9k+S2lC4AVNUcyYEVG1ytN/KGUeF1gf8AqwXooByHW0LwaV1w29iTiWE y4TsGRaMYnEJVkBkXDEQeHpbJebf0cmigdTBSqEugunt4ABgzaOz4aSRtlCWQ6lGp2gx Kuyo2vnxgRwweKkUjtOrdNfaUDu1eN1ToLqw8iID8eDVaIb6w/8UvTO6YfIIHdQA2Yad DD3Olx21PXa+X/QzMdNe79dxX0YNw3PZu3cBtbQsqMcbRWi1FMxxFAHlLoNE1+aewDL+ AINw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=tS7m7ThP5LZU80WUJ1hBT6TGP+ge+UWfXpGoXVsY49M=; b=tlIcrFh32eyIKI0J5/MQX+qyz5lX4sY9Tn5q4BmSJaynx8zwF5LYBewoN87GPr+yar 7oRS8aE02QCtpIsQOi4yRlCZXGPppg/U1h5NWNArXHtcePm5JK3ODOF/OFngyjFdJr1P tNAoFUVhzxRl/oZADys03fMr0iyJWvBWkYmWihOEE2ZdWPk7LIQjjCSogQ3ykgTx1Esv uUjHcXDTciuHgsIyo/K6YRDYMY1O2HgfHk6TCHca4+Teou1PjyVDF+pgdw2MT3CPKpJY 9RqvYZxQ3Z4SQzkufxHhsQjGKVYYGZSZsPbMu+0dTrumlevetom0SYExu+If10UTh6LR Dp2Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q14si13668359ejb.125.2019.11.29.02.17.26; Fri, 29 Nov 2019 02:17:51 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726763AbfK2KPu (ORCPT + 99 others); Fri, 29 Nov 2019 05:15:50 -0500 Received: from metis.ext.pengutronix.de ([85.220.165.71]:36867 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726608AbfK2KPu (ORCPT ); Fri, 29 Nov 2019 05:15:50 -0500 Received: from pty.hi.pengutronix.de ([2001:67c:670:100:1d::c5]) by metis.ext.pengutronix.de with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1iadJP-0002OG-QX; Fri, 29 Nov 2019 11:15:43 +0100 Received: from mfe by pty.hi.pengutronix.de with local (Exim 4.89) (envelope-from ) id 1iadJO-0007n4-JO; Fri, 29 Nov 2019 11:15:42 +0100 Date: Fri, 29 Nov 2019 11:15:42 +0100 From: Marco Felsch To: Linus Walleij Cc: Bartosz Golaszewski , Support Opensource , Lee Jones , Rob Herring , Liam Girdwood , Mark Brown , stwiss.opensource@diasemi.com, Adam Thomson , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , "linux-kernel@vger.kernel.org" , Sascha Hauer Subject: Re: [PATCH v2 1/5] gpio: add support to get local gpio number Message-ID: <20191129101542.drtcn44twcyzxqmm@pengutronix.de> References: <20191127135932.7223-1-m.felsch@pengutronix.de> <20191127135932.7223-2-m.felsch@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-IRC: #ptxdist @freenode X-Accept-Language: de,en X-Accept-Content-Type: text/plain X-Uptime: 11:02:21 up 14 days, 1:20, 29 users, load average: 0.32, 0.13, 0.04 User-Agent: NeoMutt/20170113 (1.7.2) X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c5 X-SA-Exim-Mail-From: mfe@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Linus, On 19-11-29 10:32, Linus Walleij wrote: > Hi Marco, > > thanks for your patch! > > On Wed, Nov 27, 2019 at 2:59 PM Marco Felsch wrote: > > > Sometimes consumers needs to know the gpio-chip local gpio number of a > > 'struct gpio_desc' for further configuration. This is often the case for > > mfd devices. > > > > Signed-off-by: Marco Felsch > (...) > > +int gpiod_to_offset(struct gpio_desc *desc) > > +{ > > + return gpio_chip_hwgpio(desc); > > +} > > +EXPORT_SYMBOL_GPL(gpiod_to_offset); > > That seems like an unnecessary wrapper. I went this way due to minimal changes.. > What about renaming gpio_chip_hwgpio() everywhere > to gpiod_to_offet(), remove it from drivers/gpio/gpiolib.h > and export it in instead? That's also possible but then we have to include the consumer.h header within the gpiolib.c and this seems to be wrong. But since I'm not the maintainer it is up to you and Bart. Both ways are possible, > I suppose this is what Bartosz is indicating, not sure though. > > Indeed it is a bit of a worrysome thing to export and we need > to be very specific about its usecase, so I'd also like some > nice to-the-point kerneldoc on the export site so that it is > clear what corner cases this function is for. (Like in this > specific driver.) Absolutly, I missed the kerneldoc.. but where should I put the kerneldoc if we go the 'wrapper'-way? Regards, Marco > Yours, > Linus Walleij > -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |