Re: [PATCH V3 2/2] gpio: add STA2X11 GPIO block

From: Mark Brown
Date: Mon May 14 2012 - 05:47:36 EST


On Mon, May 14, 2012 at 09:25:34AM +0200, Alessandro Rubini wrote:

> >> + /* 384 was used in previous code: be compatible for other drivers */
> >> + err = irq_alloc_descs(-1, 384, GSTA_NR_GPIO, NUMA_NO_NODE);

> > Where does the number 384 come from? It looks like the driver only
> > needs to allocate a range of irqs and that it doesn't actually matter
> > what the real numbers are. Can 0 be used instead?

> The problem is that there are a number of drivers already working (but
> not ready to be upstreamed), and we'd better continue using them. So,
> the mmc driver is requesting a specific interrupt number. The code is
> GPL (published on sourceforge) and I'd better remain compatible.

> I'm not completely clear (yet) about how to get the right interrupt
> number in those other drivers, but I'm willing to remove the constraint
> as they are cleaned up and submitted.

Use platform data for both this driver and the other drivers (or device
tree if you're doing that). This will hard code the magic numbers in
the board files, not in the driver.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/