From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-yb1-f178.google.com (mail-yb1-f178.google.com [209.85.219.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 59A86136B for ; Thu, 7 Sep 2023 07:17:14 +0000 (UTC) Received: by mail-yb1-f178.google.com with SMTP id 3f1490d57ef6-d7e741729a2so618231276.2 for ; Thu, 07 Sep 2023 00:17:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1694071033; x=1694675833; darn=lists.linux.dev; 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=i/zIw1W2vvr3CyWIcWiJtIDnyQ6C2WMBQYo7aCWhr0ombxF6utLHfEoJAiFT3E0bwh qrXk9lp1kaG9VQ7PJjtZnOA5Zzk5HJ9G8vFiqZM0XTN0LL5x3j1Ha44eUIUoLjT3cl45 ZmMejgemVQz8gwx2lkQzI0c0R8SNcr/7cKWRzqcIuZ+YyVweZyU9eT8c7T9/bXxSr9An Mpsxf/TKDSBKuSlq1sQMR4/lH1hClHd4uyCYG+M76lHbFtdpcjbzK3TMPvUYyCK1F9OH YZJ1XvuRDObeT/Tee57zUePaPw/0yxO0NdUxgvwdVTAWrUJzmD1Tsz7Bi3xROyvqSYZm IFIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1694071033; x=1694675833; 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=UN0C2PQ/vI+NkJoh1BGjL3ofy1unsyUfhlNH+HiClh3UYfHKswmcv/SSEq/FrKfKrx yxjgUx91M8Bard1FVCR5LqnTqqP+7bHasjjyoC/v/DMAmyk+R1NkcMAb+jn7UPcQVIif /TLBMDZgnUpAKtTGKcs/YXkXSdtj8de5vVN1zVbn9RLjLMBMfxk3fG3d9MDnK2xs8TTw zk2JA2Ao75QgpAbcWdNczJ0sbcFYbUWyBuvckr4DkWpsuhsslMuh/3GzMhrlPhQyqc10 L706QTufWT2Zm8cGuuyVCLemjj+lNgrDrXFHIas/13FWOR2gGQkZb5uAUUc8CncE41sK ThmA== X-Gm-Message-State: AOJu0YxsCPB1H6T5IDKYepncd2E7DFdl1L9vbxt1AnAHp0j2PqJYQgFx fWUWQUWbs8xmlL6zpKh000Myz4HF2NZebCgjf4QVJA== 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) Precedence: bulk X-Mailing-List: timestamp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: 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 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