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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B6AC5EC8743 for ; Thu, 7 Sep 2023 17:20:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243166AbjIGRUQ (ORCPT ); Thu, 7 Sep 2023 13:20:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55748 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243007AbjIGRT7 (ORCPT ); Thu, 7 Sep 2023 13:19:59 -0400 Received: from mail-qt1-x835.google.com (mail-qt1-x835.google.com [IPv6:2607:f8b0:4864:20::835]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9DCA31FD5 for ; Thu, 7 Sep 2023 10:19:39 -0700 (PDT) Received: by mail-qt1-x835.google.com with SMTP id d75a77b69052e-41479b9b4f1so8301831cf.3 for ; Thu, 07 Sep 2023 10:19:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1694107123; x=1694711923; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=wBdELFiF0kNq2P4ovxPr1G/v1B3B5Z0Pa4x1EdUn7xY=; b=sMLv2+XSkU01giKVuGoarP1iSfu/t/iBvqNAYzC3QH7JP1Cq4uBq93vPxAeiTe7sKF b9WBxw0QuJxLEc1ZIeHnSZUSm/lkB3VCpsLz7BZjVkb6wduv39UqNFTOLJlENQ06V34f 28E+8/Plnez5tcHwSdxb+pOEfV69FaLttfUZQqrSAiCuAJmUNj94pMuuDouF3jdlU5HC 6DAOuCaRLsHVNrWL2K+dPtwDUv52WQKlnWMgrpthRGlTQAa+XynyGmZQiaRaXE4GrDd6 fyShycomd1tyOlvTgeoBQMTu4Y9ndj6GEaVINUovObUQPGktkm357ZZLthaE1IlzeKY1 j3RQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1694107123; x=1694711923; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=wBdELFiF0kNq2P4ovxPr1G/v1B3B5Z0Pa4x1EdUn7xY=; b=A1c//CMkPtFVtiv8JlFNmQCegVCCkdPO4z211Y2x9WAQq1phMBkQupNKCubP6CicUe zHN6R/GEpv/Ak4LiPo4nFEY+xqCgl7iH0WmyjJOM1MCYhhCeRquLFjqvE/NnFUn3QBLK BckM57/Q/eMYMoNlAtVZ4ZoWqjEQ8S+y3MnAW/z7RKFQ8CzN5UFV3t5X4YKfeArBRrxb hnSbp2VjaGi08I9UL6CM4Qu/4HZiRrsZu0KkckVnrTOKAEjwIT1RdHSdg+AxVrmX33Vb 8GOlHZcWzec/USTSde6Cau2sSxbRO4PA+dNH0+z4J2qKshwfimZM/xRzRAl3CjvcoD1a EIKA== X-Gm-Message-State: AOJu0YzdBDzv0PtN1CrKMCmSnr0JPGCX30Va3NMVJVgOeHVuyrpHsxoN IrtUJBWkrp6+2dscY6+m2qW9zDc48w6PrSIs9ClbxXF+OiT6u6UhGnI= X-Google-Smtp-Source: AGHT+IGquAMmj4BV1IgcH+0hlmwrCPO8RvK5dDPIHBFPHMvw3mBi9yKQYdiyjPsOt1CRLSecOSiNHyNGSnbycipPFpA= X-Received: by 2002:a25:4057:0:b0:d7f:1ef3:66a9 with SMTP id n84-20020a254057000000b00d7f1ef366a9mr10826771yba.15.1694071032928; Thu, 07 Sep 2023 00:17:12 -0700 (PDT) MIME-Version: 1.0 References: <20230905185309.131295-1-brgl@bgdev.pl> <20230905185309.131295-8-brgl@bgdev.pl> In-Reply-To: <20230905185309.131295-8-brgl@bgdev.pl> From: Linus Walleij Date: Thu, 7 Sep 2023 09:17:01 +0200 Message-ID: Subject: Re: [PATCH 07/21] gpiolib: provide gpio_device_get_base() To: Bartosz Golaszewski Cc: Aaro Koskinen , Janusz Krzysztofik , Tony Lindgren , Russell King , Mika Westerberg , Andy Shevchenko , Dipen Patel , Thierry Reding , Jonathan Hunter , Hans de Goede , Mark Gross , linux-arm-kernel@lists.infradead.org, linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, linux-acpi@vger.kernel.org, timestamp@lists.linux.dev, linux-tegra@vger.kernel.org, platform-driver-x86@vger.kernel.org, Bartosz Golaszewski 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, Sep 5, 2023 at 8:53=E2=80=AFPM Bartosz Golaszewski = wrote: > From: Bartosz Golaszewski > > Let's start adding getters for the opaque struct gpio_device. Start with > a function allowing to retrieve the base GPIO number. > > Signed-off-by: Bartosz Golaszewski I guess you have a solid usecase for drivers needing to do this crazy thing, because I suppose you feel as much as me that this should rather be gpiolib-internal and confined to drivers/gpio/gpiolib.h? If you add a valid reason for making this globally visible outside of drivers/[gpio|pinctrl] to the commit message I guess I can live with it because we need to think of the bigger picture: Acked-by: Linus Walleij It brings to mind the now confusing "base" inside of struct gpio_chip. We all know it should go away, but since it is never used during the lifetime of the gpio_chip - or SHOULD never be used - it should rather be an argument to [devm_]gpiochip_add_data( .... int base);... Maybe something we should add to our TODO file. Yours, Linus Walleij