On Sat, Aug 7, 2010 at 10:39 AM, Anatolij Gustschin <ag...@denx.de> wrote:
> Grant Likely <grant.lik...@secretlab.ca> wrote:
>> > @@ -226,6 +272,9 @@ static struct irq_chip mpc8xxx_irq_chip = {
>> >  static int mpc8xxx_gpio_irq_map(struct irq_host *h, unsigned int virq,
>> >                                irq_hw_number_t hw)
>> >  {
>> > +       if (of_device_is_compatible(h->of_node, "fsl,mpc5121-gpio"))
>> > +               mpc8xxx_irq_chip.set_type = mpc512x_irq_set_type;
>> > +
>>
>> You can put the set type hook into the of_match_table data which you
>> will need for of_find_matching_node() (see below).
>
> How can I get this match table data reference in mpc8xxx_gpio_irq_map() ?

of_match_node() will return the matching entry in the table.

> Is it okay to set data field of struct device_node to the set type
> hook? I could do it in mpc8xxx_add_gpiochips() but I'm not sure whether
> the data field will be used for other purposes somewhere else.

You are safe to use the .data field.

g.
_______________________________________________
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Reply via email to