[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20120511184532.C74D73E0791@localhost>
Date: Fri, 11 May 2012 12:45:32 -0600
From: Grant Likely <grant.likely@...retlab.ca>
To: Mark Brown <broonie@...nsource.wolfsonmicro.com>,
Rhyland Klein <rklein@...dia.com>
Cc: Samuel Ortiz <sameo@...ux.intel.com>,
Rob Herring <rob.herring@...xeda.com>,
Liam Girdwood <lrg@...com>, linux-kernel@...r.kernel.org,
devicetree-discuss@...ts.ozlabs.org
Subject: Re: [PATCH 5/6 v3] mfd: tps65910-irq: Add devicetree init support
On Tue, 8 May 2012 16:48:21 +0100, Mark Brown <broonie@...nsource.wolfsonmicro.com> wrote:
> On Tue, May 08, 2012 at 11:42:42AM -0700, Rhyland Klein wrote:
>
> > + if (pdata->irq_base <= 0)
> > + pdata->irq_base = irq_alloc_descs(-1, 0, tps65910->irq_num, -1);
> > +
> > + if (pdata->irq_base <= 0) {
> > + dev_err(tps65910->dev, "Failed to allocate irq descs: %d\n",
> > + pdata->irq_base);
> > + return pdata->irq_base;
> > + }
>
> I'd expect the driver to always call irq_alloc_descs() but to use the
> value specified in platform data if there is any. This is the normal
> way of doing things, anyway.
More importantly, the driver should be converted to use an irq_domain
and remove the custom irq_to_tps65910_irq function.
irq_find_mapping() handles the hwirq --> irq lookup and
irq_data->hwirq will always give you the controller's irq number.
When irq_base is -1, then use irq_domain_add_linear() which will also
manage irq_desc allocations for you. If the driver requires a
specific irq_base then the descs still need to be manually allocated
and use an irq_domain_add_legacy() to set it up. (this is sub-optimal
though; I hope to have a better solution for legacy that also manages
desc allocations just like the other mappings; maybe in the 3.6
timeframe).
g.
--
Grant Likely, B.Sc, P.Eng.
Secret Lab Technologies, Ltd.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists