Re: [RFC PATCH v2] irqchip: Add support for Tango interrupt controller

From: Måns Rullgård
Date: Mon Jan 18 2016 - 08:04:21 EST


Marc Gonzalez <marc_gonzalez@xxxxxxxxxxxxxxxx> 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