From nobody Sat Feb 7 08:23:38 2026 Received: from smtpout-04.galae.net (smtpout-04.galae.net [185.171.202.116]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 96176389E0C; Wed, 14 Jan 2026 09:40:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.171.202.116 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768383652; cv=none; b=kzXj7WmDBjoiL6nu2M+kQGTIFYhrvzhWiI3V6M4ccFkZuAxt4dpjsrrSK1b1tOurBu2lSZSx2UYcnBizeH8YpoRmOeWitnEu1ucv1YDb+UDpQuqpUgcPYCprX1FglLp4o4r4JcLH+f63rqqTpbOWpw6Rd9ux/287ZxD6z46f+/g= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768383652; c=relaxed/simple; bh=3fifJH6jPhjpUsOkz3ncUoHMaDbVCkbvrHplYvH2Uyg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=syRyjpE3IJHnpG3+M71MipNN6+iGIA4gJexZQWkHWMzFp9udh0+PTvjsuUTncnIsxOQXbavbijimTeunF3I8LJl8M07JJKnBVOzUqaOr4z6e86gqd1OizaYnd4glZHGGuT4UfOqkbSKxJko5bug3s5+zAxe1Y9/9iYSbnouAG6g= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=jgxA5TGo; arc=none smtp.client-ip=185.171.202.116 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="jgxA5TGo" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-04.galae.net (Postfix) with ESMTPS id 674D6C1F1D3; Wed, 14 Jan 2026 09:40:22 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 0BEC26074A; Wed, 14 Jan 2026 09:40:49 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 338CC103C89EC; Wed, 14 Jan 2026 10:40:46 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1768383648; h=from:subject:date:message-id:to:cc:mime-version: content-transfer-encoding:in-reply-to:references; bh=fQCpmqi0I/63GrT0ubc5oAKlmvHMRk4TMDR9BqlL+NY=; b=jgxA5TGoVwWjBqutwlc+I6gW+2cmXyjgEuiXXlZFLGEtVzOd7IUM5baXiUR32XFNi+NqRP ZVGT5dMuUFPmawCHThbBKk4p06v5BZjgkSJVPulIkLJ9XTORH433U+yT8Ht0WO6q2g4EmD 4Nsjjf2VBqH2KPyaKkkKhhvZ1Rs4SCpJecHzCpYbzRWDq3hLk38uR9VBubLj4K07siw2j0 JpUNV0NcRhyFGavaIotUcif61VqQ9G55RNkNAfwc+ttV7NZdy3Ze/yp67bK+Ei5MD3L/W7 fcX2/2GP/VetPTk2H5n7r8C1kwbLVJSBkvyOgsfElkwT/BnexrbvBMOud36inQ== From: "Herve Codina (Schneider Electric)" To: Thomas Gleixner , Wolfram Sang , Linus Walleij , Bartosz Golaszewski , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Geert Uytterhoeven , Magnus Damm , Saravana Kannan , Herve Codina Cc: linux-gpio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Pascal Eberhard , Miquel Raynal , Thomas Petazzoni Subject: [PATCH v8 4/8] irqchip/renesas-rza1: Use for_each_of_imap_item iterator Date: Wed, 14 Jan 2026 10:39:33 +0100 Message-ID: <20260114093938.1089936-5-herve.codina@bootlin.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260114093938.1089936-1-herve.codina@bootlin.com> References: <20260114093938.1089936-1-herve.codina@bootlin.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Last-TLS-Session-Version: TLSv1.3 Content-Type: text/plain; charset="utf-8" The renesas-rza1 driver parses the interrupt-map property. It does it using open code. Recently for_each_of_imap_item iterator has been introduce to help drivers in this parsing. Convert the renesas-rza1 driver to use the for_each_of_imap_item iterator instead of open code. Signed-off-by: Herve Codina (Schneider Electric) Tested-by: Wolfram Sang Reviewed-by: Linus Walleij Reviewed-by: Thomas Gleixner --- drivers/irqchip/irq-renesas-rza1.c | 43 +++++++++++------------------- 1 file changed, 16 insertions(+), 27 deletions(-) diff --git a/drivers/irqchip/irq-renesas-rza1.c b/drivers/irqchip/irq-renes= as-rza1.c index 6047a524ac77..370d968b2398 100644 --- a/drivers/irqchip/irq-renesas-rza1.c +++ b/drivers/irqchip/irq-renesas-rza1.c @@ -142,47 +142,36 @@ static const struct irq_domain_ops rza1_irqc_domain_o= ps =3D { static int rza1_irqc_parse_map(struct rza1_irqc_priv *priv, struct device_node *gic_node) { + struct of_imap_parser imap_parser; struct device *dev =3D priv->dev; - unsigned int imaplen, i, j; + struct of_imap_item imap_item; struct device_node *ipar; - const __be32 *imap; - u32 intsize; + unsigned int j; + u32 i =3D 0; int ret; =20 - imap =3D of_get_property(dev->of_node, "interrupt-map", &imaplen); - if (!imap) - return -EINVAL; - - for (i =3D 0; i < IRQC_NUM_IRQ; i++) { - if (imaplen < 3) - return -EINVAL; + ret =3D of_imap_parser_init(&imap_parser, dev->of_node, &imap_item); + if (ret) + return ret; =20 + for_each_of_imap_item(&imap_parser, &imap_item) { /* Check interrupt number, ignore sense */ - if (be32_to_cpup(imap) !=3D i) + if (imap_item.child_imap[0] !=3D i) { + of_node_put(imap_item.parent_args.np); return -EINVAL; + } =20 - ipar =3D of_find_node_by_phandle(be32_to_cpup(imap + 2)); + ipar =3D imap_item.parent_args.np; if (ipar !=3D gic_node) { of_node_put(ipar); return -EINVAL; } =20 - imap +=3D 3; - imaplen -=3D 3; - - ret =3D of_property_read_u32(ipar, "#interrupt-cells", &intsize); - of_node_put(ipar); - if (ret) - return ret; - - if (imaplen < intsize) - return -EINVAL; - - priv->map[i].args_count =3D intsize; - for (j =3D 0; j < intsize; j++) - priv->map[i].args[j] =3D be32_to_cpup(imap++); + priv->map[i].args_count =3D imap_item.parent_args.args_count; + for (j =3D 0; j < priv->map[i].args_count; j++) + priv->map[i].args[j] =3D imap_item.parent_args.args[j]; =20 - imaplen -=3D intsize; + i++; } =20 return 0; --=20 2.52.0