Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp7277768rwl; Thu, 23 Mar 2023 01:52:19 -0700 (PDT) X-Google-Smtp-Source: AK7set8vv30d5MB1PIEuWGu/Mur2/68VKnn5QCM8gEuZOYJTvImqSOkEWZ32Mx5tSJAsE/gUo45B X-Received: by 2002:a17:907:c306:b0:8b1:fc1a:7d21 with SMTP id tl6-20020a170907c30600b008b1fc1a7d21mr12735847ejc.5.1679561539746; Thu, 23 Mar 2023 01:52:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679561539; cv=none; d=google.com; s=arc-20160816; b=PKpaRg8yUgnjWE2bIU6tQGi99touoTZFHRrML3XQMeUIqrEYhfIW3bzNpBuu0adlJb RQHgG3Hl5F3WsY0r4No5ChQcGhH3t4eqaQaVtltWZWEwsjD9inDCGRcovEKYHr58cXmf 4UEyebN7LkPN4Y5RNID8JwKwpubeunjHdpoQwRa4xCXgdddqf1d1aG02XDB4aL1lOr2K gN5JJzYxGOPuT9Qx0dOHcZL0eMd9ybsyM1DlzjGOWAoD0V5k1CAUbNF49Qz2/zJD2pkL Ix9oIaSFTUQEPcatTuGDTUSNXO2J4s1+6sHNE3Zd/QtneodptO8dN+zOK2p61BKL/IVR nONQ== 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=rUuy98YfrrGR9WlMIlTaa+4F/lCxj6Hdgjgj3ZONIGA=; b=WjaXwbC7sI8qVOGAH/xcZKA0DL1gZFG32DWmrwbrDdYJRbClLj76N8KbvxeUJNFH81 OauJLrzipjpPTPdlcCdW4g72kq9BxOw75AGRJrU1vUSwG9ap95qk+Ku7EJ59LT25urk5 ts7QPSTK7aT3fPBzuXd6c1kJObPNxxeQSJgNDMSUP/ug8EjNvmNGFx6wKTjGRregfc/h z4TT0q8wSxlRNUY9XLiFd+z3+lqtE9JjwUm7SJfTsMH+sc6DWOmCKGfHThw0Q5sqUX79 aYZXQW0HQ9RAukyzCvYvBgYsvcjUORRzpUKfV0hbJ5jLeZxDnBzwPwJMcPM+Tf7poak1 pWvA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Q7owO8Oc; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id mf12-20020a170906cb8c00b0091ee7139cb7si9797948ejb.411.2023.03.23.01.51.55; Thu, 23 Mar 2023 01:52:19 -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=@linaro.org header.s=google header.b=Q7owO8Oc; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229903AbjCWIiJ (ORCPT + 99 others); Thu, 23 Mar 2023 04:38:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42360 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231556AbjCWIhr (ORCPT ); Thu, 23 Mar 2023 04:37:47 -0400 Received: from mail-yb1-xb31.google.com (mail-yb1-xb31.google.com [IPv6:2607:f8b0:4864:20::b31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5D26735261 for ; Thu, 23 Mar 2023 01:36:31 -0700 (PDT) Received: by mail-yb1-xb31.google.com with SMTP id i6so23890063ybu.8 for ; Thu, 23 Mar 2023 01:36:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1679560587; 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=rUuy98YfrrGR9WlMIlTaa+4F/lCxj6Hdgjgj3ZONIGA=; b=Q7owO8OcLsAk4Smi2JWsWIKAzqfBJpGOHyVtF07hxl9piqNLJCWoW7ed4RVNmHjhGk ol3NRAXqNtaHo6lDY/g//4xjwt/zxo/2zoFknjy1zGZhizSaFw5hdgDuLK8RdU/zZVAH dCepbf77TgGhUbiTSUqhp684enkT1DtfqWYiu+D4zXHU39Q95c87S5jHYzWSUjmQidIr CR/bcZ9UWgx4ZwxmbVTnGPjgT3U1OF+r4Mp8yx8TwvEPJeXshXVD54tjYJO1ApHYyVfH z4fQSasarnufBSTBhpRbCiJTIbgj3WYu0exC/3/6OArXM7pWXh8QX0awOx12n+r31erH QTsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679560587; 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=rUuy98YfrrGR9WlMIlTaa+4F/lCxj6Hdgjgj3ZONIGA=; b=iJKufMp89lwj/9X5rEf2koTQ4YaH3WmC9R32Dahz+1PIiR05jzrJfnJYuPQD0+/GKq fmQkxNQYIIYb2vVj5ztyhOLOSIm8E8qm7yzsI6cxOZurJXbLDg6fc5B4BIFnLiTNH7qf hSwrgHQKCn+PAptor0FjqT6ArOIaksD2WI0fN6k5oQJ23hcSFAulrBtfdtMWmnbOp2/M qbesqu65V+XPaMW+qMp/bs8Lfgx0Db166xw1643xHaVbhZ88SbmOvL0HC0ySRxnSPN09 qBucpUgdkR95MKniQrb5+GZM4X6pgM/78l+mI/XiNcAjwcz8JlKdhF9ckXCfedEuHV7R NJKA== X-Gm-Message-State: AAQBX9cOlNCTjSua3Y5Xt6cGQhmCM8p1bXzNbR+fArRjIZYsECcwY6DV 7EQZG6mcgrFCbU1IobHYN4Gzab9TdLvqUJQHAqovsg== X-Received: by 2002:a05:6902:a93:b0:b23:4649:7ef3 with SMTP id cd19-20020a0569020a9300b00b2346497ef3mr1654862ybb.4.1679560587513; Thu, 23 Mar 2023 01:36:27 -0700 (PDT) MIME-Version: 1.0 References: <20230323012929.10815-1-dipenp@nvidia.com> <20230323012929.10815-5-dipenp@nvidia.com> In-Reply-To: <20230323012929.10815-5-dipenp@nvidia.com> From: Linus Walleij Date: Thu, 23 Mar 2023 09:36:16 +0100 Message-ID: Subject: Re: [PATCH V4 04/10] dt-bindings: timestamp: Add nvidia,gpio-controller To: Dipen Patel Cc: thierry.reding@gmail.com, jonathanh@nvidia.com, linux-kernel@vger.kernel.org, linux-tegra@vger.kernel.org, linux-gpio@vger.kernel.org, devicetree@vger.kernel.org, linux-doc@vger.kernel.org, robh+dt@kernel.org, timestamp@lists.linux.dev, krzysztof.kozlowski+dt@linaro.org, brgl@bgdev.pl, corbet@lwn.net, gregkh@linuxfoundation.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,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 lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 23, 2023 at 2:29=E2=80=AFAM Dipen Patel wro= te: > Introducing nvidia,gpio-controller property from Tegra234 SoCs onwards. > This is done to help below case. > > Without this property code would look like: > if (of_device_is_compatible(dev->of_node, "nvidia,tegra194-gte-aon")) > hte_dev->c =3D gpiochip_find("tegra194-gpio-aon", > tegra_get_gpiochip_from_name); > else if (of_device_is_compatible(dev->of_node, "nvidia,tegra234-gte-aon")= ) > hte_dev->c =3D gpiochip_find("tegra234-gpio-aon", > tegra_get_gpiochip_from_name); > else > return -ENODEV; > > This means for every future addition of the compatible string, if else > condition statements have to be expanded. > > With the property: > gpio_ctrl =3D of_parse_phandle(dev->of_node, "nvidia,gpio-controller", 0)= ; > .... > hte_dev->c =3D gpiochip_find(gpio_ctrl, tegra_get_gpiochip_from_of_node); > > This simplifies the code significantly. The introdunction of this > property/binding does not break existing Tegra194 provider driver. > > Signed-off-by: Dipen Patel It is fair to assume that other operating systems will need this too so I interpret the commit message as an example of the issues faced by anyone making a driver for this HW. Reviewed-by: Linus Walleij Yours, Linus Walleij