On Fri, 2012-04-06 at 15:35 +0200, John Crispin wrote:
> thx for all the patches
> 
> On 06/04/12 14:37, Conor O'Gorman wrote:
> > +--- a/arch/mips/lantiq/xway/dev-dwc_otg.c
> > ++++ b/arch/mips/lantiq/xway/dev-dwc_otg.c
> > +@@ -43,7 +43,6 @@ static struct resource resources[] =
> > +   },
> > +   [1] = {
> > +           .name    = "dwc_otg_irq",
> > +-          .start   = LTQ_USB_INT,
> > +           .flags   = IORESOURCE_IRQ,
> > +   },
> > + };
> > +@@ -63,6 +62,7 @@ int __init
> > + xway_register_dwc(int pin)
> > + {
> > +   struct irq_data d;
> > ++  resources[1].start = LTQ_USB_INT;
> > +   d.irq = resources[1].start;
> > +   ltq_enable_irq(&d);
> > +   platform_dev.dev.platform_data = (void*) pin;
> 
> is there a technical reason for this bit that i fail to understand or is
> it more a style preference fixup ?

I copied the style of the other drivers in the first instance, but a
compile error happens, as we are trying to initialise a struct with a
variable that only resolves at runtime (ltq_is_ase())

#define LTQ_USB_INT             ((ltq_is_ase()) ? (INT_NUM_IM0_IRL0 + 31) :\
                                                  (INT_NUM_IM1_IRL0 + 22))

I think it's reasonable to have runtime behaviour, as the same code
could run on either platform. An option would be to have the irq number
passed as a platform-data-type thing.

Conor


_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to