Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp7823333ybc; Fri, 29 Nov 2019 01:35:25 -0800 (PST) X-Google-Smtp-Source: APXvYqxv3a9MbduZaYUIYBY6eQneF+/4n5kchsjUlj7pOEpP/sofkTFc43mRebFhHmNZAKnp7xnB X-Received: by 2002:a17:906:7812:: with SMTP id u18mr59032670ejm.6.1575020125475; Fri, 29 Nov 2019 01:35:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575020125; cv=none; d=google.com; s=arc-20160816; b=Knthj/PJ5q2oVSyXXp8HXAxEomUV2wGMRrV3TGd3IWLPzSHM7TlZ++6WSW6ZRc0QoT tzw0D+Y9/lrmoZ6Ytxx+DdI27yMxRMgBzPbudfIwuuMOCY8SqtdSTLmwnbz1OpO3j9h4 BC+VGM/d8WzS1aFzT7Z6On7yGU3bKRj4Wx09zIxy+0rIBnP4qCIIinUkDotIQFThzkYX fLvHaysFjiatadOg3B9UTK+kIFITfbwn5Wn+5irDmc8kNE30scNawoFEqrX7WNrfqExl aEyssdxAF9mG+AzGQRrr8vq7lIKwnO8O91bz7NF2hC+Wc/nHzmoH9ieh4Hg7VTw9uJzo Go9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=H/Od6kVrXI87O4KN/Z/H7nofcItikhLmOLU1xinq+0o=; b=BtbI2Juw2gpSdNnc2u4xkZHbGgAxmrRQ0FbGuaIPOFBp30IE5kAQmGauoVVgY07kno TeCNM3KzrIHoL7UDoJt5lAO2zxeOnXGS9giyegPlh5g21b7OrvU8hw1eCmGjx/z3fq00 0CBvbD6vC2C2uc9WUZZYTnsC9gbx1qd/o0/QBJ7igW7/GGyEGokQyPAhNVCS1wNK+Z+v au5hzXAAJEEPEpdF3M3abAEV8QcRcDnEnRgWkaAdhiPW9WoyZWZrud/duMlabCXFK1uR X4FDl6QuyDECKNCDuVEdiQ2l3qVMe1QUII0kNoiT0+hWR5gS/3eCCrypTTZIlsXEAO+W L+MQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WOk8dlVM; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c8si5107493ejm.429.2019.11.29.01.35.01; Fri, 29 Nov 2019 01:35:25 -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; dkim=pass header.i=@linaro.org header.s=google header.b=WOk8dlVM; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726843AbfK2JdG (ORCPT + 99 others); Fri, 29 Nov 2019 04:33:06 -0500 Received: from mail-lf1-f68.google.com ([209.85.167.68]:45641 "EHLO mail-lf1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726811AbfK2JdG (ORCPT ); Fri, 29 Nov 2019 04:33:06 -0500 Received: by mail-lf1-f68.google.com with SMTP id 203so22084656lfa.12 for ; Fri, 29 Nov 2019 01:33:03 -0800 (PST) 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=H/Od6kVrXI87O4KN/Z/H7nofcItikhLmOLU1xinq+0o=; b=WOk8dlVMR/QLVPtqElvHr+0adH/0ak6x3Ek5lWCQvsvbZdrw2XhrM1EuzzJgz51GHX vD5/azUjcuyK6flVMNJfglKVkr0cdABA1K9P8bCzgk4dsP+69qixQyMIttJ2FtL5r82k pY2/42xk4ditN95qjoRlqrufFZoIS26RWd/KGELpFvgf5ZTGMUhmzX86JmIflatOI2Vb mlXd8v4CpNaaPF6fu3lKHXrEOTopZEtlVuU0Ca73zkpcNh/2XJaF9HNRieLGKJfLu50t GeBTBxDVfDylh0i/orThzdQ3hREAzZTxWQZAVf6OV9me8/MHTTXzFDz78tV+tWZedXto Gf/g== 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=H/Od6kVrXI87O4KN/Z/H7nofcItikhLmOLU1xinq+0o=; b=kdLRN3/ArEbMFRLiDrj8FxOkcaK8fcdpsMccddNMFy/yrABawXKKJQKbqO65R8Xyy8 UDkyEMaEuf5nhGnh0Z37ipXAtsCkiMGYUFDmy/i2lZudC8/9NbsHW4DpvZ7hkOGODmQu a0gug8kzeSyv75hyiW9d+SIwx5RWZWEFT3bYzWprz463ymz7zLnjjLQXjSs8mca62VmM Id2Ki8L+k/kEECyLwSbNzv/Ca3r3E9m0OOz5LGMg53yMHr5/IoS7nKilhzI41mgELTyq FG6oRd6sOiQGKZuOjNJUY72wMufe0AIgprFWOanTgBfhdGeKDOPGKqIzevPywWI+NQg5 tsLQ== X-Gm-Message-State: APjAAAWX5uoP8NN5Jdh9MN0TXKA1oXO38s0OEj2kW7UchwL5GEKYyH94 z7+lWWtUKYiWuZgxI51FvJ0cQI/iOx5B743yq5HXjw== X-Received: by 2002:a19:f701:: with SMTP id z1mr29467397lfe.133.1575019983038; Fri, 29 Nov 2019 01:33:03 -0800 (PST) MIME-Version: 1.0 References: <20191127135932.7223-1-m.felsch@pengutronix.de> <20191127135932.7223-2-m.felsch@pengutronix.de> In-Reply-To: <20191127135932.7223-2-m.felsch@pengutronix.de> From: Linus Walleij Date: Fri, 29 Nov 2019 10:32:51 +0100 Message-ID: Subject: Re: [PATCH v2 1/5] gpio: add support to get local gpio number To: Marco Felsch 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 Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. What about renaming gpio_chip_hwgpio() everywhere to gpiod_to_offet(), remove it from drivers/gpio/gpiolib.h and export it in instead? 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.) Yours, Linus Walleij