Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp1284730rdb; Mon, 2 Oct 2023 05:16:18 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFDgIhXMcdF6CUlkZuG8+COUQ4uMKv1JC6Q18hf5/gS9XE+6yrHiXa38JWKV6onhHhA/beX X-Received: by 2002:a05:6a20:7d84:b0:15c:b7ba:e8e0 with SMTP id v4-20020a056a207d8400b0015cb7bae8e0mr11830899pzj.51.1696248977846; Mon, 02 Oct 2023 05:16:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696248977; cv=none; d=google.com; s=arc-20160816; b=klS1hbgYMYiQU0/ZCZjCtpr8raXYaoDOkjGfy5VhPW96+2FttFpbr4T0ioRgSHxbEg O8uyDDsBcYccVi9st/XSvaGyUEc8UYuhTwpy0URdaF/5XF+DB/wEZ5e4NJimA4weRfSd jSFPrs6Ycf1rld3dkjMgP3yTsnigHzN27CixkVGNk5WaLRfZeVV5TzfZXPU8BtwFt30c JwyGN/UOtM+imx27q6yYfUIKHbox5XwlNpZFUl1YyNacMd0L+IMq/JQ+T2cOsKlFAvqn uaoiHIkty6fxCtIm/BvDakTGIB7gkQMMalMHb9Lc4HMVdKjwsdU0gfUvXUuEfp/cc/zX hF/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=/kzGcKH51BMhzvkfijbkvJZcq6BeliJjCgiKuHtTrZI=; fh=jOMdZ3vznH2pdd/7mcVfVfPOhP8/+/kGV+9sAGRPOEc=; b=blb4EmQbZ5JzOrsPDDCnLganQBJxZ76NkgcyGC6YcR/7QlSf4A7P0JpJx7mCuLJog/ 1a52XtWDJaWhUWbpTTp4Xl+2FAwONS4LSl2Bnx3Z4onRpGpDhXAA681MRWs4DRsHMOOC HXGaFi/+svZECkfPciNhtsiaBGo96Qlb0xIG9QbPAbAioLjoA+9fn4aNHpT//CRA1pbX s2eQVZMoXuY4J1f9oKaIS3AoWvXOJtAyMHp1tx+mVmhBtfiCx9Qmp7QGSeQqRXlq6vKg UOzTTnCTTcCALET74/VBEy/y2ao4St8dgVgVoDAEsxCsEGVLWzVe8s4LacwokyCxohyj 0BtA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20230601.gappssmtp.com header.s=20230601 header.b=XUBlhCQC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id bk13-20020a056a02028d00b00578b76eff9bsi26828763pgb.379.2023.10.02.05.16.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Oct 2023 05:16:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@bgdev-pl.20230601.gappssmtp.com header.s=20230601 header.b=XUBlhCQC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 0328A80A800D; Mon, 2 Oct 2023 00:36:49 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235630AbjJBHge (ORCPT + 99 others); Mon, 2 Oct 2023 03:36:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56338 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235771AbjJBHgb (ORCPT ); Mon, 2 Oct 2023 03:36:31 -0400 Received: from mail-ua1-x930.google.com (mail-ua1-x930.google.com [IPv6:2607:f8b0:4864:20::930]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2F7BDA7 for ; Mon, 2 Oct 2023 00:36:28 -0700 (PDT) Received: by mail-ua1-x930.google.com with SMTP id a1e0cc1a2514c-7ab9488f2f0so6259897241.3 for ; Mon, 02 Oct 2023 00:36:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1696232187; x=1696836987; 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=/kzGcKH51BMhzvkfijbkvJZcq6BeliJjCgiKuHtTrZI=; b=XUBlhCQCluEKPTIeKdQAyXsvycYs0HPKyzJwsKaAlprAGDhvJkWBqmXREA4B4AeVgt g/1+uIOwYGamevIHZEQVWRY6ClzqwSx53B93NdDsKCefWtfGJ37005JkrvVSeshgefaq fhaBnJXTQgMS4XXJVVP1Pa7G5wrj59r3EopY+dGf1+r9epR7KQII32teS/JiSG8QqSlx 2bk6UUpeuuBpLLRETmvP2lkfyAOt/zrmPsWgghVeTyTuSwJ2842z70SefXGyG6fpVQ+h dgoEbiySSPXuhZCQgIcYSQzI+AoNtkj0QsfB8x4ZFMfgmzPtsELWzDFWiC+e2PpX8KLo GS4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696232187; x=1696836987; 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=/kzGcKH51BMhzvkfijbkvJZcq6BeliJjCgiKuHtTrZI=; b=tn1inf7OXWUv/VXKd+gMyTIU7yxyvwLLqnLqY6mmi7pHUWEMHoyFtBURrBUDOR+g47 lg/tPGmb71E+7SNGAwoW+/k5DIRgUJ7JA+p8tJgT3ugPrU0fl91mG2IvSQocr5GVRgcu muYMYHY21W5RRNc8rWVLZEvXEkAAs6LXSfAdt7W4+xr5phGc4QJ4kD0DUeQHbZwClxfa Zp6aux6MXQwdaDBcLDWL5RSGRa3oQyAsevafxLsKebQKhwrTR2gs3EqRfxcIZDXbayiy 8pie5+QPgFEt0JqdNBJY88gSTkA904eSWGgs9BKBnGci/AkgkdsFlhSWFXkhbgmMLE/o ug2Q== X-Gm-Message-State: AOJu0Yy9/Ip8hPS7WSSiiWcK9/sqfRVheM7hia7F0+af+x4Y/qxk4AVP OP94MBLf4thyr36Lbey5vtHEvfRxVb+yKAp3UmMuKA== X-Received: by 2002:a67:fe0b:0:b0:452:560e:31a9 with SMTP id l11-20020a67fe0b000000b00452560e31a9mr8909087vsr.1.1696232186976; Mon, 02 Oct 2023 00:36:26 -0700 (PDT) MIME-Version: 1.0 References: <20231001-pxa-gpio-v4-0-0f3b975e6ed5@skole.hr> <20231001-pxa-gpio-v4-2-0f3b975e6ed5@skole.hr> In-Reply-To: From: Bartosz Golaszewski Date: Mon, 2 Oct 2023 09:36:16 +0200 Message-ID: Subject: Re: [PATCH RFC v4 2/6] ARM: pxa: Convert Spitz LEDs to GPIO descriptors To: Andy Shevchenko Cc: =?UTF-8?Q?Duje_Mihanovi=C4=87?= , Daniel Mack , Haojian Zhuang , Robert Jarzmik , Russell King , Alan Stern , Greg Kroah-Hartman , Linus Walleij , Andy Shevchenko , Dmitry Torokhov , Mark Brown , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, linux-gpio@vger.kernel.org, linux-input@vger.kernel.org, linux-spi@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Mon, 02 Oct 2023 00:36:50 -0700 (PDT) On Sun, Oct 1, 2023 at 4:35=E2=80=AFPM Andy Shevchenko wrote: > > On Sun, Oct 1, 2023 at 5:13=E2=80=AFPM Duje Mihanovi=C4=87 wrote: > > > > Sharp's Spitz board still uses the legacy GPIO interface for configurin= g > > its two onboard LEDs. > > > > Convert them to use the GPIO descriptor interface. > > ... > > > static void __init spitz_leds_init(void) > > { > > + gpiod_add_lookup_table(&spitz_led_gpio_table); > > platform_device_register(&spitz_led_device); > > + spitz_gpio_leds[0].gpiod =3D gpiod_get_index(&spitz_led_device.= dev, > > + NULL, 0, GPIOD_ASIS); > > + spitz_gpio_leds[1].gpiod =3D gpiod_get_index(&spitz_led_device.= dev, > > + NULL, 1, GPIOD_ASIS); > > } > > What's the point of keeping a lookup table after we got descriptors out o= f it? > Normally the descriptors would be retrieved in drivers and so lookup tables should stay in memory forever as static resources (just like device-tree). We have recently added some "temporary" lookup tables to address even worse hacks. The tables would be removed immediately after the descriptor is retrieved simply because we used that hack in drivers which may be unbound and re-bound resulting in adding repeating lookup entries. Here we're dealing with a board-file so a more classic approach of having static lookup tables added once and never removed is in order. So I'd leave it like this. Bart