[RFC PATCH v2] irqchip: Add support for Tango interrupt controller
Måns Rullgård
mans at mansr.com
Mon Jan 18 05:04:08 PST 2016
Marc Gonzalez <marc_gonzalez at sigmadesigns.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
More information about the linux-arm-kernel
mailing list