On 10/23/2012 10:13 PM, Peter Korsgaard wrote:
"Andreas" == Andreas Larsson <andr...@gaisler.com> writes:

  Andreas> There are no platform resources of type IORESOURCE_IRQ on
  Andreas> sparc, so the irq number is acquired in a different manner for
  Andreas> sparc. The general case uses platform_get_irq, that internally
  Andreas> still uses platform_get_resource.

I have no idea why sparc is being odd in this regard, but assuming this
is how it's done, I'm fine with this change.

A quick grep doesn't find any other drivers doing this though:

git grep -l archdata.irqs drivers | xargs grep platform_get_irq

Acked-by: Peter Korsgaard <jac...@sunsite.dk>

Other drivers that work both on sparc and on other platforms usually use irq_of_parse_and_map on a corresponding device_node. For non-sparc architectures irq_of_parse_and_map sets up mappings that needs to be teared down on module exit. Sparc however has its own version of irq_of_parse_and_map that just returns the irq number using archdata.irq[].

I am trying to get through a patch platform_get_irq to work for sparc as well. If that eventually goes through, the CONFIG_SPARC stuff can then be removed cleanly from this driver withouth having to mess with irq_of_parse_and_map and tearing mappings down.

Another solution is to use irq_of_parse_and_map for the of-case if no irq was found using platform_get_irq. But that would make for more rearrangements and add the need for irq_dispose_mapping to be added on module exit as well (even though the disposing would do nothing for sparc).

Cheers,
Andreas Larsson

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to