From: Philipp Zabel <p.zabel@pengutronix.de>
To: Changhuang Liang <changhuang.liang@starfivetech.com>,
Thomas Gleixner <tglx@linutronix.de>,
Rob Herring <robh+dt@kernel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
Conor Dooley <conor+dt@kernel.org>
Cc: Ley Foon Tan <leyfoon.tan@starfivetech.com>,
Jack Zhu <jack.zhu@starfivetech.com>,
linux-kernel@vger.kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH v1 2/2] irqchip: Add StarFive external interrupt controller
Date: Wed, 24 Jan 2024 10:53:53 +0100 [thread overview]
Message-ID: <31bbe5787708b7de770cab96a9072fe6db39347b.camel@pengutronix.de> (raw)
In-Reply-To: <20240111023201.6187-3-changhuang.liang@starfivetech.com>
On Mi, 2024-01-10 at 18:32 -0800, Changhuang Liang wrote:
[...]
> diff --git a/drivers/irqchip/irq-starfive-jh8100-intc.c b/drivers/irqchip/irq-starfive-jh8100-intc.c
> new file mode 100644
> index 000000000000..be8224111cf2
> --- /dev/null
> +++ b/drivers/irqchip/irq-starfive-jh8100-intc.c
> @@ -0,0 +1,180 @@
[...]
> +struct starfive_irq_chip {
> + void __iomem *base;
> + struct irq_domain *root_domain;
> + struct clk *clk;
> + struct reset_control *rst;
Since rst is never used outside of starfive_intc_init, there is no need
to store it here.
[...]
> +static int __init starfive_intc_init(struct device_node *intc,
> + struct device_node *parent)
> +{
> + struct starfive_irq_chip *irqc;
> + int ret;
> + int parent_irq;
> +
> + irqc = kzalloc(sizeof(*irqc), GFP_KERNEL);
> + if (!irqc)
> + return -ENOMEM;
> +
> + irqc->base = of_iomap(intc, 0);
> + if (!irqc->base) {
> + pr_err("Unable to map IC registers\n");
> + ret = -ENXIO;
> + goto err_free;
> + }
> +
> + irqc->rst = of_reset_control_get_by_index(intc, 0);
Please use of_reset_control_get_exclusive(intc, NULL) instead.
> + if (IS_ERR(irqc->rst)) {
> + pr_err("Unable to get reset control\n");
> + ret = PTR_ERR(irqc->rst);
Consider printing the error code via %pe.
regards
Philipp
next prev parent reply other threads:[~2024-01-24 9:54 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-11 2:31 [PATCH v1 0/2] Add JH8100 external interrupt controller support Changhuang Liang
2024-01-11 2:32 ` [PATCH v1 1/2] dt-bindings: interrupt-controller: Add starfive,jh8100-intc Changhuang Liang
2024-01-11 8:07 ` Krzysztof Kozlowski
2024-01-11 2:32 ` [PATCH v1 2/2] irqchip: Add StarFive external interrupt controller Changhuang Liang
2024-01-24 9:53 ` Philipp Zabel [this message]
2024-01-25 3:16 ` 回复: " Changhuang Liang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=31bbe5787708b7de770cab96a9072fe6db39347b.camel@pengutronix.de \
--to=p.zabel@pengutronix.de \
--cc=changhuang.liang@starfivetech.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=jack.zhu@starfivetech.com \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=leyfoon.tan@starfivetech.com \
--cc=linux-kernel@vger.kernel.org \
--cc=robh+dt@kernel.org \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®