[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87wo3setn8.wl-maz@kernel.org>
Date: Sat, 27 Jun 2020 10:37:47 +0100
From: Marc Zyngier <maz@...nel.org>
To: John Stultz <john.stultz@...aro.org>
Cc: Stephen Boyd <swboyd@...omium.org>,
lkml <linux-kernel@...r.kernel.org>,
Andy Gross <agross@...nel.org>,
Bjorn Andersson <bjorn.andersson@...aro.org>,
Joerg Roedel <joro@...tes.org>,
Thomas Gleixner <tglx@...utronix.de>,
Jason Cooper <jason@...edaemon.net>,
Linus Walleij <linus.walleij@...aro.org>,
Maulik Shah <mkshah@...eaurora.org>,
Lina Iyer <ilina@...eaurora.org>,
Saravana Kannan <saravanak@...gle.com>,
Todd Kjos <tkjos@...gle.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
linux-arm-msm <linux-arm-msm@...r.kernel.org>,
iommu@...ts.linux-foundation.org, linux-gpio@...r.kernel.org
Subject: Re: [PATCH v2 3/5] irqchip: Allow QCOM_PDC to be loadable as a permanent module
On Sat, 27 Jun 2020 02:34:25 +0100,
John Stultz <john.stultz@...aro.org> wrote:
>
> On Fri, Jun 26, 2020 at 12:42 AM Stephen Boyd <swboyd@...omium.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.
Powered by blists - more mailing lists