From nobody Sun Jun 28 02:51:05 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 64A3CC433EF for ; Tue, 15 Feb 2022 12:20:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237597AbiBOMUL (ORCPT ); Tue, 15 Feb 2022 07:20:11 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:58112 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232094AbiBOMUJ (ORCPT ); Tue, 15 Feb 2022 07:20:09 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E82F51074E7 for ; Tue, 15 Feb 2022 04:19:59 -0800 (PST) Date: Tue, 15 Feb 2022 12:19:57 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1644927598; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=smDRKqrC9C3n679OqcRW68vfO63IJFXsaluYNs0VyhU=; b=pUUtBF80jx3ahjcXANctkgAQUHx+U+Nz5Dnsetk9eJpLsyNUUNngkVgrpQocr9Ipo0bE2z O2miY6VP3DU15OIAm0sHCeNyVRtZ3kB0vPTftXhReofcyuOkKzSHrt/xm3PIVEMCBcwtZS 5UD4HR/0IbOU03pid4PHCd3rN0YIPUuHCCVHQ4BVHLZGBjl680Rcpto/xnkpVDyPwKYesA +rY9kNrXJFOVWvvNEmgv4Dx3AVgmNbbxO9awGMdbpS6Rk+p0DaJ8zAa4w90hBFPusNOGSi crbPcYjiuHnNZsvWhrXTJt3eFTUQbBwUq0G9mqTLyz3NYpIV6tje8k7uHxKExg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1644927598; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=smDRKqrC9C3n679OqcRW68vfO63IJFXsaluYNs0VyhU=; b=OFysl6gEzqKIe7sHA4b2PZXu2uXmvP2MGbOOAhBvYOkmqxvOJ/8VvKHBFfaiq/0LDWJREh eTMAF6z2I5r3oeAA== From: "irqchip-bot for Marc Zyngier" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-kernel@vger.kernel.org Subject: [irqchip: irq/irqchip-next] irqchip/mvebu-pic: Switch to dynamic chip name output Cc: Marc Zyngier , Gregory CLEMENT , Linus Walleij , tglx@linutronix.de In-Reply-To: <20220209162607.1118325-6-maz@kernel.org> References: <20220209162607.1118325-6-maz@kernel.org> MIME-Version: 1.0 Message-ID: <164492759747.16921.12872550962294322927.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the irq/irqchip-next branch of ir= qchip: Commit-ID: 421f16238a9da88ce1f2e3a103866de095cc15f6 Gitweb: https://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-plat= forms/421f16238a9da88ce1f2e3a103866de095cc15f6 Author: Marc Zyngier AuthorDate: Wed, 09 Feb 2022 16:26:02=20 Committer: Marc Zyngier CommitterDate: Tue, 15 Feb 2022 11:25:46=20 irqchip/mvebu-pic: Switch to dynamic chip name output Instead of overriding the name field, track the corresponding device and use the relevant callback to output its name. This allows us to make the irq_chip structure const. Signed-off-by: Marc Zyngier Reviewed-by: Gregory CLEMENT Acked-by: Linus Walleij Link: https://lore.kernel.org/r/20220209162607.1118325-6-maz@kernel.org --- drivers/irqchip/irq-mvebu-pic.c | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/drivers/irqchip/irq-mvebu-pic.c b/drivers/irqchip/irq-mvebu-pi= c.c index 870f986..ef3d364 100644 --- a/drivers/irqchip/irq-mvebu-pic.c +++ b/drivers/irqchip/irq-mvebu-pic.c @@ -18,6 +18,7 @@ #include #include #include +#include =20 #define PIC_CAUSE 0x0 #define PIC_MASK 0x4 @@ -29,7 +30,7 @@ struct mvebu_pic { void __iomem *base; u32 parent_irq; struct irq_domain *domain; - struct irq_chip irq_chip; + struct platform_device *pdev; }; =20 static void mvebu_pic_reset(struct mvebu_pic *pic) @@ -66,6 +67,20 @@ static void mvebu_pic_unmask_irq(struct irq_data *d) writel(reg, pic->base + PIC_MASK); } =20 +static void mvebu_pic_print_chip(struct irq_data *d, struct seq_file *p) +{ + struct mvebu_pic *pic =3D irq_data_get_irq_chip_data(d); + + seq_printf(p, dev_name(&pic->pdev->dev)); +} + +static const struct irq_chip mvebu_pic_chip =3D { + .irq_mask =3D mvebu_pic_mask_irq, + .irq_unmask =3D mvebu_pic_unmask_irq, + .irq_eoi =3D mvebu_pic_eoi_irq, + .irq_print_chip =3D mvebu_pic_print_chip, +}; + static int mvebu_pic_irq_map(struct irq_domain *domain, unsigned int virq, irq_hw_number_t hwirq) { @@ -73,8 +88,7 @@ static int mvebu_pic_irq_map(struct irq_domain *domain, u= nsigned int virq, =20 irq_set_percpu_devid(virq); irq_set_chip_data(virq, pic); - irq_set_chip_and_handler(virq, &pic->irq_chip, - handle_percpu_devid_irq); + irq_set_chip_and_handler(virq, &mvebu_pic_chip, handle_percpu_devid_irq); irq_set_status_flags(virq, IRQ_LEVEL); irq_set_probe(virq); =20 @@ -120,22 +134,16 @@ static int mvebu_pic_probe(struct platform_device *pd= ev) { struct device_node *node =3D pdev->dev.of_node; struct mvebu_pic *pic; - struct irq_chip *irq_chip; =20 pic =3D devm_kzalloc(&pdev->dev, sizeof(struct mvebu_pic), GFP_KERNEL); if (!pic) return -ENOMEM; =20 + pic->pdev =3D pdev; pic->base =3D devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(pic->base)) return PTR_ERR(pic->base); =20 - irq_chip =3D &pic->irq_chip; - irq_chip->name =3D dev_name(&pdev->dev); - irq_chip->irq_mask =3D mvebu_pic_mask_irq; - irq_chip->irq_unmask =3D mvebu_pic_unmask_irq; - irq_chip->irq_eoi =3D mvebu_pic_eoi_irq; - pic->parent_irq =3D irq_of_parse_and_map(node, 0); if (pic->parent_irq <=3D 0) { dev_err(&pdev->dev, "Failed to parse parent interrupt\n");