[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <yw1xwpr7rqd3.fsf@unicorn.mansr.com>
Date: Mon, 18 Jan 2016 13:04:08 +0000
From: Måns Rullgård <mans@...sr.com>
To: Marc Gonzalez <marc_gonzalez@...madesigns.com>
Cc: Thomas Gleixner <tglx@...utronix.de>,
Jason Cooper <jason@...edaemon.net>,
Marc Zyngier <marc.zyngier@....com>,
LKML <linux-kernel@...r.kernel.org>,
Linux ARM <linux-arm-kernel@...ts.infradead.org>,
Sebastian Frias <sf84@...oste.net>
Subject: Re: [RFC PATCH v2] irqchip: Add support for Tango interrupt controller
Marc Gonzalez <marc_gonzalez@...madesigns.com> writes:
> + if (of_property_read_u32(node, "reg", &ctl))
> + panic("%s: failed to get reg base", node->name);
> +
> + chip = kzalloc(sizeof(*chip), GFP_KERNEL);
> + chip->ctl = ctl;
> + chip->base = base;
I think it might be better to let the OF core convert the "reg" property
to a struct resource, then get the offset by subtracting from the base
(physical) address. Otherwise it will break badly if someone thinks
it's safe to drop "ranges" from the outer node and use absolute
addresses in the child nodes (that's how the "reg" property typically
behaves).
Anyway, thanks for revisiting this. I never got a straight answer (or
any answer for that matter) when I asked which approach would be
preferred, and then I had better things to do than keep trying patches
until people got happy.
--
Måns Rullgård
Powered by blists - more mailing lists