Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp691860pxb; Fri, 3 Sep 2021 11:11:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyYNm0bexggnYEtDMb+xqGTEdNJQdAeS9/4nsock4DqFfyvVBj5uegg7iKPYo91GQtVrTPc X-Received: by 2002:a05:6402:49a:: with SMTP id k26mr256824edv.279.1630692671820; Fri, 03 Sep 2021 11:11:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630692671; cv=none; d=google.com; s=arc-20160816; b=Um/JrqDkWHSucaalgVuma0Nqk85G7yxk2SyozeOxDb8R1SSoU8YwxI89rBA9JeT/aS laFJsQyaXE6quxPJYOf+rl2pXtp0fhecNokfDfykeOTRcy3BS3xd+sGy6JpMtZCSX2gd jXuZsDpZzOSz9CH4dlG/kKbBgu0iKeBdAK5XJTdRjrllY2DZAOYWmKxSRDXEyhHGz4zf kdy2plPBwMCpRwf/ez6ubuKuLAxFJqxwrdpDQGAYJIyiYQ/1ShER+s5wBCqw7dujo4OW tCr2bHTLQLTxns21tCBLmp3MvUm6ZKdd5GOR1A4t/VNk4hixmT5Ei8GiVlVHWOhUm0xk WkPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:message-id:date:to:cc:from:subject :references:in-reply-to:content-transfer-encoding:mime-version :dkim-signature; bh=TOpx/5KMpyHBRp5y1lDTd/rL8yr3ta1i6R0y97Gp+3o=; b=0H8GHJbbSW+1aPTuFkb6V+MJU6R293TT3/mrKO1wYxWXEKzYX8sMrdGTl6gyx5Wt86 GzLVKOIvOLdDBcV+v7tceM6Ls8rJEtvfHkGc/brYQ72Ee+/sCv3eFZU2TBX5dJIrVzCz BgOT+OFEvgdEAgnGEcmiu9Ep8UAK843+da1L9kp3a5Qby+8/J35KpgrLPm+O5XZtBhLF 2YnlRSF20+Ep8B8yw5izrExeb5Ezl/BukhYN4EVCz8PtytFxh5DUvKxDihF6AVZpADXS lqXxNedEleqDPObUG6At0h/xpou9h0FcNQCtmzPq0a2MiHFmZQHpc0UhHWLBI40/hR59 tWUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=IVhNfjX4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a19si213920edt.168.2021.09.03.11.10.47; Fri, 03 Sep 2021 11:11:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=IVhNfjX4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350340AbhICSK0 (ORCPT + 99 others); Fri, 3 Sep 2021 14:10:26 -0400 Received: from mail.kernel.org ([198.145.29.99]:47706 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231747AbhICSK0 (ORCPT ); Fri, 3 Sep 2021 14:10:26 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id BB78561057; Fri, 3 Sep 2021 18:09:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1630692565; bh=hqxm1jKVv3zVPfT2u8luecvuXVLTMkxK4v3UVKCS+x8=; h=In-Reply-To:References:Subject:From:Cc:To:Date:From; b=IVhNfjX4RzY0j17wJdL/tVWgXg72aE2MTSMq7hMJKJW/cTfo2cBNPPfqXzWNMQDU/ fEMBlfkozH5Xy+OYy1rlPkn8P5HsSD1RdY/T1Ped5cgLocp2eqqzq8NwkelYNUYC6a LRK69QpFUHxcm5Y8Z2QJlns8sjzd6/bQ+9s+y4TssYlM9/YiGxOAVoFRcGHiL19RjG +OiklV3L8Lw1ThcjL1cWJA6ft1mimnX25G56CZMNKvh9X35BdUx8xDURXlV/3Xenx6 trFoTC9UOvIYIogAXDWwYBvfHGY+ZZqh/cWHJR6p+r93iobRAR1zFFSpJldbH7tPnz S0p4BRNE70Pmw== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable In-Reply-To: <1630574106-3394-2-git-send-email-skakit@codeaurora.org> References: <1630574106-3394-1-git-send-email-skakit@codeaurora.org> <1630574106-3394-2-git-send-email-skakit@codeaurora.org> Subject: Re: [PATCH V2 1/2] pinctrl: qcom: spmi-gpio: correct parent irqspec translation From: Stephen Boyd Cc: David Collins , kgunda@codeaurora.org, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-msm@vger.kernel.org, satya priya To: Andy Gross , Bjorn Andersson , Linus Walleij , Rob Herring , satya priya Date: Fri, 03 Sep 2021 11:09:24 -0700 Message-ID: <163069256450.405991.2176328404036039930@swboyd.mtv.corp.google.com> User-Agent: alot/0.9.1 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Quoting satya priya (2021-09-02 02:15:05) > diff --git a/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c b/drivers/pinctrl/q= com/pinctrl-spmi-gpio.c > index 98bf0e2..dbae168 100644 > --- a/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c > +++ b/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c > @@ -1,6 +1,6 @@ > // SPDX-License-Identifier: GPL-2.0-only > /* > - * Copyright (c) 2012-2014, The Linux Foundation. All rights reserved. > + * Copyright (c) 2012-2014, 2016-2021 The Linux Foundation. All rights r= eserved. > */ > =20 > #include > @@ -14,6 +14,7 @@ > #include > #include > #include > +#include > #include > =20 > #include > @@ -171,6 +172,8 @@ struct pmic_gpio_state { > struct pinctrl_dev *ctrl; > struct gpio_chip chip; > struct irq_chip irq; > + u8 usid; > + u8 pid_base; > }; > =20 > static const struct pinconf_generic_params pmic_gpio_bindings[] =3D { > @@ -949,12 +952,36 @@ static int pmic_gpio_child_to_parent_hwirq(struct g= pio_chip *chip, > unsigned int *parent_hwirq, > unsigned int *parent_type) > { > - *parent_hwirq =3D child_hwirq + 0xc0; > + struct pmic_gpio_state *state =3D gpiochip_get_data(chip); > + > + *parent_hwirq =3D child_hwirq + state->pid_base; > *parent_type =3D child_type; > =20 > return 0; > } > =20 > +static void *pmic_gpio_populate_parent_fwspec(struct gpio_chip *chip, > + unsigned int parent_hwirq, > + unsigned int parent_type) > +{ > + struct pmic_gpio_state *state =3D gpiochip_get_data(chip); > + struct irq_fwspec *fwspec; > + > + fwspec =3D kzalloc(sizeof(*fwspec), GFP_KERNEL); The implementation of gpiochip_populate_parent_fwspec_fourcell() uses kmalloc() here. Should we also do that? Presumably the fwspec will be set with the important parts so this will save a memset call. > + if (!fwspec) > + return NULL; > + > + fwspec->fwnode =3D chip->irq.parent_domain->fwnode; > + > + fwspec->param_count =3D 4; > + fwspec->param[0] =3D state->usid; > + fwspec->param[1] =3D parent_hwirq; > + fwspec->param[2] =3D 0; If the kzalloc stays, this can be dropped. > + fwspec->param[3] =3D parent_type; > + > + return fwspec; > +} > + > static int pmic_gpio_probe(struct platform_device *pdev) > { > struct irq_domain *parent_domain;