Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2436603rwd; Fri, 26 May 2023 06:38:40 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7L9QFHgK23u/BoyAzScn+7N0aPq4KfRO08H7dN0UIDlihABOhL4Ub6kCPWi7nt2V5CG/ww X-Received: by 2002:a05:6a00:1913:b0:64d:722d:a8d9 with SMTP id y19-20020a056a00191300b0064d722da8d9mr3359718pfi.28.1685108320368; Fri, 26 May 2023 06:38:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685108320; cv=none; d=google.com; s=arc-20160816; b=u880Z4Vogvo+PVECraJPnhFDeczlHuoQFQVE2p6Ho6R6o8nBo8RJSY4gD3HI92yt3B HLW/iGf06Dygx0GShy/paEm58irZcJgZ/1P/OY9q7pCI7p8tE0yGq+t6hXs4/TKIV6Kt T6VZoFjeT+g6HpPb93NQiYBWEuuL0UhvFcasN9SpoVJJEpsk3eqTBaiK92htT86yPyBF Low3sHKbaWDrjb/UhkAHFJwzG81fiAyREKt7umwiCW3DRuy+kaDYIRczGHD/GgAS4E+s Z4NeymCbkZKcMfSUUets8gMaC5LQ0BIrFVSAokrTBdmX4svA234bGj6aC/w2M8EX+EpO Nfbw== 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=ksL0wfKrSI+58DAMm3woqLByXvazoTPFTjGEkGyXGLM=; b=BP78M2++kjmKJtCyffgj9jeQKEcHsngRDgFAL6RtkbIamyVG6eLD3wxadXmmeE0fes iX2/WcCDElGvsfA9Df9qAbCN5u9dJZ+jxtFt74SvQuv3+UMoLUfrnYyNuOdBIR4dRgD2 +uugTAc36BqTQH0+O8Nj3gQyh/IGrKU3vMbq/J/lDav36mz05N8kUnkSyq1yVnUgRfBk DH1ozDbyFYxtx/1h7jbkClg3GwCs67zmXABRQb4ECHPEaWep54bPNQNDN6jAxIweSMKF fxksSnKzSjvqn9d78US3XhIANEjElMVjL2ALsFyM4n0sYmhVjWeZX3k5V/crDxuRhUBD 9Yjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20221208.gappssmtp.com header.s=20221208 header.b=RC8p2GNj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e28-20020aa7981c000000b0063d24857c5bsi4059209pfl.43.2023.05.26.06.38.28; Fri, 26 May 2023 06:38:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@bgdev-pl.20221208.gappssmtp.com header.s=20221208 header.b=RC8p2GNj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236740AbjEZNbo (ORCPT + 99 others); Fri, 26 May 2023 09:31:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35026 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237093AbjEZNbm (ORCPT ); Fri, 26 May 2023 09:31:42 -0400 Received: from mail-vs1-xe33.google.com (mail-vs1-xe33.google.com [IPv6:2607:f8b0:4864:20::e33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A752D12F for ; Fri, 26 May 2023 06:31:39 -0700 (PDT) Received: by mail-vs1-xe33.google.com with SMTP id ada2fe7eead31-4397b040c8fso420483137.0 for ; Fri, 26 May 2023 06:31:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20221208.gappssmtp.com; s=20221208; t=1685107898; x=1687699898; 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=ksL0wfKrSI+58DAMm3woqLByXvazoTPFTjGEkGyXGLM=; b=RC8p2GNj4Amb+TIOYSRzmtzfF1Hi452s0NmrMr0ir6Z/1xoz7S6lcKJyA3tw0unC4b vUlnYS0ypMkOvn8tw5dldyJaD4HrK0T7j103FD0IZjEYUZhSJvJivua4mOWsIF1dAxwQ rt+sbWXcoJ7AWowdlbkhBhENAcx30ywi2IQjlZltDJUfPRagyknt/1FmYacHZi+xK1m3 4J6uaD9sCTGHD43NeYXIK/KcBTqtoSgVYflrAkUvG1DUJMqD9r8WyOJi801qgIPc09H/ 90tcj5TOnXZ56EoAMs5ZfhSypSxUgfJLbbepZXtCtGwPwbjX8XDANPPEDnKz6dwml7aN HfBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685107898; x=1687699898; 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=ksL0wfKrSI+58DAMm3woqLByXvazoTPFTjGEkGyXGLM=; b=aHo1S32/35Zw8HPW1GZJR+ro3NPGgCLpzWLBOIXSE/XE98/c8uSpWEFHrKHbHE+IQh ibgHi8NfjjbnzAMSknZ7Q1DRXCKCHIjh23ZsH9vG88derieR2d03HTdk4Pd7fu9X5WMt rNehz5kRYiDZl+nUklowiac91FRpLxKl/Sl1gxRGhjs8YRcjLICKtE+aswy6RHGS29g6 WnkQ65fIRhdI9Lk0F3N6GRyP5AF0nexJQkSRnDg7fYO2nSf9J1F5Lnr1tvzK3A6VTPDy /B9LjpxV0FH0sPvl3JmbRwzGBiUtjrZd4RBm394PjHLpf57eI195Virjy0c3tnaQEyby Xgzw== X-Gm-Message-State: AC+VfDxRHtj52glG8nwg69Uv6ZJSgLVrmqCJtgu2STvcgl1KHfxyXMM+ c87kdxwVBaMVifvQHwGuklxtaVlToiowaL+SyB0f+A== X-Received: by 2002:a67:f5c3:0:b0:439:5a25:2e39 with SMTP id t3-20020a67f5c3000000b004395a252e39mr502884vso.34.1685107898701; Fri, 26 May 2023 06:31:38 -0700 (PDT) MIME-Version: 1.0 References: <20230511-tps65219-add-gpio-support-v2-0-60feb64d649a@baylibre.com> <20230511-tps65219-add-gpio-support-v2-1-60feb64d649a@baylibre.com> <9fa1a6e8-368a-3e22-aa84-8cad09f72a32@baylibre.com> <0cf870f1-8cdb-df74-79d6-a4004cdfcc2f@baylibre.com> In-Reply-To: <0cf870f1-8cdb-df74-79d6-a4004cdfcc2f@baylibre.com> From: Bartosz Golaszewski Date: Fri, 26 May 2023 15:31:27 +0200 Message-ID: Subject: Re: [PATCH v2 1/2] gpio: tps65219: add GPIO support for TPS65219 PMIC To: jerome Neanne Cc: Andy Shevchenko , Linus Walleij , Tony Lindgren , Lee Jones , linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, linux-omap@vger.kernel.org, Jonathan Cormier Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 23, 2023 at 11:09=E2=80=AFAM jerome Neanne wrote: > > > > On 22/05/2023 13:18, Andy Shevchenko wrote: > > On Mon, May 22, 2023 at 10:47=E2=80=AFAM jerome Neanne wrote: > >> On 20/05/2023 11:44, andy.shevchenko@gmail.com wrote: > >>> Mon, May 15, 2023 at 05:36:46PM +0200, Bartosz Golaszewski kirjoitti: > >>>> On Thu, May 11, 2023 at 4:09=E2=80=AFPM Jerome Neanne wrote: > > > > ... > > > >>>>> + gpio->gpio_chip =3D tps65219_gpio_chip; > >>>> > >>>> Aren't you getting any warnings here about dropping the 'const' from > >>>> the global structure? > >>> > >>> But this is a copy of the contents and not the simple pointer. > > > > I commented on Bart's question. > > > >> In many other places where this is done, the struct is declared like: > >> > >> static const struct gpio_chip template_chip =3D { > >> > >> After internal review, I changed this to: > >> > >> static const struct gpio_chip tps65219_gpio_chip =3D { > >> > >> This is because I didn't want to have this "template" that sounds to m= e > >> like "dummy". Maybe I misunderstood and this "template" was used on > >> purpose because this const struct is just copied once to initialize > >> tps65219_gpio->gpio_chip during probe. > >> > >> Introducing tps65219_gpio_chip name is maybe confusing with > >> tps65219_gpio struct. > >> > >> I think the const should not be a problem here but the naming I used > >> might be misleading. If you have a suggestion of what is a good practi= ce > >> to make this piece of code clearer. I'll follow your suggestion (use > >> template? more_explicit name like ???). > > > > It's up to Bart. > > > Bart, should I keep the code like this or do you suggest a name change > so that's it's more appealing? Yes, I prefer it to be named something something template for clarity. tps65219_template_chip would be great. Bart