From: Marc Zyngier <maz@kernel.org>
To: John Stultz <john.stultz@linaro.org>
Cc: Maulik Shah <mkshah@codeaurora.org>,
Jason Cooper <jason@lakedaemon.net>,
Saravana Kannan <saravanak@google.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
lkml <linux-kernel@vger.kernel.org>,
Lina Iyer <ilina@codeaurora.org>,
Bjorn Andersson <bjorn.andersson@linaro.org>,
linux-gpio@vger.kernel.org, iommu@lists.linux-foundation.org,
Andy Gross <agross@kernel.org>,
linux-arm-msm <linux-arm-msm@vger.kernel.org>,
Thomas Gleixner <tglx@linutronix.de>,
Stephen Boyd <swboyd@chromium.org>,
Linus Walleij <linus.walleij@linaro.org>,
Todd Kjos <tkjos@google.com>
Subject: Re: [PATCH v2 3/5] irqchip: Allow QCOM_PDC to be loadable as a permanent module
Date: Sat, 27 Jun 2020 10:37:47 +0100 [thread overview]
Message-ID: <87wo3setn8.wl-maz@kernel.org> (raw)
In-Reply-To: <CALAqxLVNGar8g+FvHaVHN_e-MOZZ+=ZPmDt_GKKSC8AS-wLFGg@mail.gmail.com>
On Sat, 27 Jun 2020 02:34:25 +0100,
John Stultz <john.stultz@linaro.org> wrote:
>
> On Fri, Jun 26, 2020 at 12:42 AM Stephen Boyd <swboyd@chromium.org> wrote:
> >
> > Quoting John Stultz (2020-06-24 17:10:37)
> > > diff --git a/drivers/irqchip/qcom-pdc.c b/drivers/irqchip/qcom-pdc.c
> > > index 6ae9e1f0819d..3fee8b655da1 100644
> > > --- a/drivers/irqchip/qcom-pdc.c
> > > +++ b/drivers/irqchip/qcom-pdc.c
> > > @@ -430,4 +432,33 @@ static int qcom_pdc_init(struct device_node *node, struct device_node *parent)
> > > return ret;
> > > }
> > >
> > > +#ifdef MODULE
> > > +static int qcom_pdc_probe(struct platform_device *pdev)
> > > +{
> > > + struct device_node *np = pdev->dev.of_node;
> > > + struct device_node *parent = of_irq_find_parent(np);
> > > +
> > > + return qcom_pdc_init(np, parent);
> > > +}
> > > +
> > > +static const struct of_device_id qcom_pdc_match_table[] = {
> > > + { .compatible = "qcom,pdc" },
> > > + {}
> > > +};
> > > +MODULE_DEVICE_TABLE(of, qcom_pdc_match_table);
> > > +
> > > +static struct platform_driver qcom_pdc_driver = {
> > > + .probe = qcom_pdc_probe,
> > > + .driver = {
> > > + .name = "qcom-pdc",
> > > + .of_match_table = qcom_pdc_match_table,
> > > + .suppress_bind_attrs = true,
> > > + },
> > > +};
> > > +module_platform_driver(qcom_pdc_driver);
> > > +#else
> > > IRQCHIP_DECLARE(qcom_pdc, "qcom,pdc", qcom_pdc_init);
> >
> > Is there any reason to use IRQCHIP_DECLARE if this can work as a
> > platform device driver?
> >
>
> Hey! Thanks so much for the review!
>
> Mostly it was done this way to minimize the change in the non-module
> case. But if you'd rather avoid the #ifdefery I'll respin it without.
That would certainly be my own preference. In general, IRQCHIP_DECLARE
and platform drivers should be mutually exclusive in the same driver:
if you can delay the probing and have it as a proper platform device,
then this should be the one true way.
Thanks,
M.
--
Without deviation from the norm, progress is not possible.
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu
next prev parent reply other threads:[~2020-06-27 9:37 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-25 0:10 [PATCH v2 0/5] Allow for qcom-pdc, pinctrl-msm and qcom-scm drivers to be loadable as modules John Stultz
2020-06-25 0:10 ` [PATCH v2 1/5] irq: irqdomain: Export irq_domain_update_bus_token John Stultz
2020-06-25 0:10 ` [PATCH v2 2/5] irq: irqchip: Export irq_chip_retrigger_hierarchy and irq_chip_set_vcpu_affinity_parent John Stultz
2020-06-25 0:10 ` [PATCH v2 3/5] irqchip: Allow QCOM_PDC to be loadable as a permanent module John Stultz
2020-06-26 7:42 ` Stephen Boyd
2020-06-27 1:34 ` John Stultz
2020-06-27 9:37 ` Marc Zyngier [this message]
2020-07-10 6:02 ` Stephen Boyd
2020-07-10 22:44 ` John Stultz
2020-07-10 23:27 ` Stephen Boyd
2020-07-12 9:27 ` Marc Zyngier
2020-06-25 0:10 ` [PATCH v2 4/5] pinctrl: qcom: Allow pinctrl-msm code to be loadable as a module John Stultz
2020-06-25 0:10 ` [PATCH v2 5/5] firmware: QCOM_SCM: Allow qcom_scm driver to be loadable as a permenent module John Stultz
2020-07-02 12:47 ` Greg Kroah-Hartman
2020-07-02 14:18 ` Will Deacon
2020-07-10 3:28 ` John Stultz
2020-07-10 7:54 ` Will Deacon
2020-07-10 22:21 ` John Stultz
2020-07-13 20:41 ` Will Deacon
2020-07-13 20:48 ` John Stultz
2020-07-14 7:56 ` Will Deacon
2020-10-28 5:53 ` John Stultz
2020-10-28 13:51 ` Will Deacon
2020-10-28 14:51 ` Robin Murphy
2020-10-30 1:02 ` John Stultz
2020-10-30 14:12 ` Robin Murphy
2020-10-31 0:12 ` John Stultz
2020-10-30 6:09 ` John Stultz
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=87wo3setn8.wl-maz@kernel.org \
--to=maz@kernel.org \
--cc=agross@kernel.org \
--cc=bjorn.andersson@linaro.org \
--cc=gregkh@linuxfoundation.org \
--cc=ilina@codeaurora.org \
--cc=iommu@lists.linux-foundation.org \
--cc=jason@lakedaemon.net \
--cc=john.stultz@linaro.org \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mkshah@codeaurora.org \
--cc=saravanak@google.com \
--cc=swboyd@chromium.org \
--cc=tglx@linutronix.de \
--cc=tkjos@google.com \
/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;
as well as URLs for NNTP newsgroup(s).