Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp2805679rdb; Mon, 4 Dec 2023 08:02:52 -0800 (PST) X-Google-Smtp-Source: AGHT+IE9PW8rZUHciYNZxI1JTziaR5i1vb15m3iHnHl+CRxNTo0JHeTdP3OtT3DX2/T2yrvxIARk X-Received: by 2002:a05:6830:610d:b0:6d8:74e2:c093 with SMTP id ca13-20020a056830610d00b006d874e2c093mr4885462otb.69.1701705772247; Mon, 04 Dec 2023 08:02:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701705772; cv=none; d=google.com; s=arc-20160816; b=eJka1SO1WjVAvpctbvcJHsTTHo5x/ja88CXS7e5blp2q2LIFKh6VYkLLZgvfdBRtUg ZIbOauPIFl81SToy6t6tcM5pNXF3AGvfetvnDIZV09ZhT0bVtf4T3BgwB8f9CiDdcK3W XFhUsKkv1Bv7QPhVWNQ9UPUUtkxytypNvKt4e3hZMZNBKoMnccT646ss50T+akUTB46h rOBxHPNNFWv/E7+o3HBHbONUzyW0D1DRl/6lkYMVTjPTGC/4FjNqa1eBEsERMUWzzuuP TiqxjocwDeJhFVe/LftL/vkV5xDXPwMs3rikt2jTQZ8tZgjnBzGksVp/cDrPN9o6xbDY k/pQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=jhDb/HHOY9FsCnNlIgyCIkjJpR6gLHDbwVIHtDdGEQ0=; fh=bb00IWANzUrbEims5abAG2NrFRW6cV0KBtrUyXvAr8o=; b=KNrB91mYhFrM3Hu04/PvwjTx0cCjafWDY5zmiIO4uUXoU0uTcBbkFCAZyHLYpiEFYJ bnP8g3IgvYulkAr4NmmcbLSWEP0ymkHabJbTzZ3JljvDOxWK5+Olq4NkrwcTXmm3I/Cw zHaXTKetbeJWE+z1IilPyJJqDNnVGfyV2HUp7mGhRV/KMf8/uSv8uUzxlwRKk/ORFBPf zMQsjJvwUvs2s6bQ8R0sP7K+wKpRxVEknIWbKeDYCTbS48RA+jilcyGAJIPoPnOLgx6G 1138s0GKZ56GAe7DzWKzmBNUXdFLNIS975aTXVi1JWd4O6ELhNzBs7sNc5vVqwlKWHyU Sb7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="FX/2i/Ez"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id y28-20020a0568301d9c00b006d876935864si1551663oti.68.2023.12.04.08.02.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Dec 2023 08:02:52 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="FX/2i/Ez"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 96F7480BEDF3; Mon, 4 Dec 2023 08:02:48 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344478AbjLDQC2 (ORCPT + 99 others); Mon, 4 Dec 2023 11:02:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41212 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343972AbjLDQCW (ORCPT ); Mon, 4 Dec 2023 11:02:22 -0500 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.12]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0D028B0; Mon, 4 Dec 2023 08:02:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1701705748; x=1733241748; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=GcznTEzkYh7381dOAmLl/g2Ovk3HvI9vfBlGPtxsvN8=; b=FX/2i/Ez9IbgsV8Yf5CSEMiC7/34GX7vzuVhkCNJcdqPIK/in3QnCzh8 +JEjSsYh5Axz1NJovaBYo0IFzi9qEFZQiL+r+rS00fSBmH0sId1TFQ7xV 5vnLffRXvnt4Epki25rUGKOa6DN63xMYnyz4ShVZvLE/dmtlA+eZLjb75 gL0aJ0w+IPSPMreEKV/S968+YQQOb0QIbL+EUe55qiDHRRDRmiv8bBZxv KTqDFtEtB/oWgS4cZcn9Z18gQd1aNOrQTZ3W7pFlIj6m4OjKHnj7/m7Ol sn7ICVU2oCzVTrTY28kybGW6jt6PCAXs7/pJR5s9o0is3ZtT8ZDgU3WiQ Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10914"; a="807882" X-IronPort-AV: E=Sophos;i="6.04,250,1695711600"; d="scan'208";a="807882" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orvoesa104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Dec 2023 08:00:48 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10914"; a="774297204" X-IronPort-AV: E=Sophos;i="6.04,250,1695711600"; d="scan'208";a="774297204" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga007.fm.intel.com with ESMTP; 04 Dec 2023 08:00:44 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 1DF2FA02; Mon, 4 Dec 2023 18:00:43 +0200 (EET) From: Andy Shevchenko To: Linus Walleij , Andy Shevchenko , =?UTF-8?q?Jonathan=20Neusch=C3=A4fer?= , Geert Uytterhoeven , Claudiu Beznea , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, openbmc@lists.ozlabs.org, linux-renesas-soc@vger.kernel.org Cc: Lakshmi Sowjanya D Subject: [PATCH v1 3/5] pinctrl: equilibrium: Convert to use struct pingroup Date: Mon, 4 Dec 2023 17:56:34 +0200 Message-ID: <20231204160033.1872569-4-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1.gbec44491f096 In-Reply-To: <20231204160033.1872569-1-andriy.shevchenko@linux.intel.com> References: <20231204160033.1872569-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.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 (morse.vger.email [0.0.0.0]); Mon, 04 Dec 2023 08:02:48 -0800 (PST) The pin control header provides struct pingroup. Utilize it instead of open coded variants in the driver. Signed-off-by: Andy Shevchenko --- drivers/pinctrl/pinctrl-equilibrium.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/drivers/pinctrl/pinctrl-equilibrium.c b/drivers/pinctrl/pinctrl-equilibrium.c index fd59cfdeefac..4ebae516d1b1 100644 --- a/drivers/pinctrl/pinctrl-equilibrium.c +++ b/drivers/pinctrl/pinctrl-equilibrium.c @@ -705,7 +705,7 @@ static int eqbr_build_groups(struct eqbr_pinctrl_drv_data *drvdata) struct device *dev = drvdata->dev; struct device_node *node = dev->of_node; unsigned int *pins, *pinmux, pin_id, pinmux_id; - struct group_desc group; + struct pingroup group, *grp = &group; struct device_node *np; struct property *prop; int j, err; @@ -721,49 +721,49 @@ static int eqbr_build_groups(struct eqbr_pinctrl_drv_data *drvdata) of_node_put(np); return err; } - group.num_pins = err; - group.name = prop->value; - pins = devm_kcalloc(dev, group.num_pins, sizeof(*pins), GFP_KERNEL); + grp->npins = err; + grp->name = prop->value; + pins = devm_kcalloc(dev, grp->npins, sizeof(*pins), GFP_KERNEL); if (!pins) { of_node_put(np); return -ENOMEM; } - group.pins = pins; + grp->pins = pins; - pinmux = devm_kcalloc(dev, group.num_pins, sizeof(*pinmux), GFP_KERNEL); + pinmux = devm_kcalloc(dev, grp->npins, sizeof(*pinmux), GFP_KERNEL); if (!pinmux) { of_node_put(np); return -ENOMEM; } - for (j = 0; j < group.num_pins; j++) { + for (j = 0; j < grp->npins; j++) { if (of_property_read_u32_index(np, "pins", j, &pin_id)) { dev_err(dev, "Group %s: Read intel pins id failed\n", - group.name); + grp->name); of_node_put(np); return -EINVAL; } if (pin_id >= drvdata->pctl_desc.npins) { dev_err(dev, "Group %s: Invalid pin ID, idx: %d, pin %u\n", - group.name, j, pin_id); + grp->name, j, pin_id); of_node_put(np); return -EINVAL; } pins[j] = pin_id; if (of_property_read_u32_index(np, "pinmux", j, &pinmux_id)) { dev_err(dev, "Group %s: Read intel pinmux id failed\n", - group.name); + grp->name); of_node_put(np); return -EINVAL; } pinmux[j] = pinmux_id; } - err = pinctrl_generic_add_group(drvdata->pctl_dev, group.name, - group.pins, group.num_pins, + err = pinctrl_generic_add_group(drvdata->pctl_dev, + grp->name, grp->pins, grp->npins, pinmux); if (err < 0) { - dev_err(dev, "Failed to register group %s\n", group.name); + dev_err(dev, "Failed to register group %s\n", grp->name); of_node_put(np); return err; } -- 2.43.0.rc1.1.gbec44491f096