Hi Alex,

> I also thought on this for a moment.
> But:
> I found no examples which did this like it shoud be done here. But could be 
> that I've overseen such one.
> The leds have different colors so names so the struct gpio_led will be
> different (besides fewer leds in general..). To not get confused about the 
> names
> (which include color..) also the defines for them could or should be 
> additional
> ones.
> Having two structs for the leds, two dirxxx_setup's with the different
> ath79_register_leds_gpio calls, and to be exact without the usb led and switch
> leds (so a second different struct) didn't seem a small change for the .c 
> file.
> More like two of them done in one.
> After that, I thought its more straightforward to make an own one. Don't u
> think so too?>

Adding another structure with five LEDs is not a big deal. Alternatively the LED
names can be changed from the setup routine. For the switch LED configuration,
you don't need another structure. Simply set the led_cfg field to NULL.

> Else, how have the
> MIPS_MACHINE(ATH79_MACH_DIR_835_A1, "DIR-835-A1",
>            "D-Link DIR-835 rev. A1",
>            dir835a1_setup);
> part(s) to look like in the 825-c1.c to be able to decide which function to 
> call for each model? And this will be enough?

You can create a common setup function for the generic parts and then call that
from the model specific setup routine. See how it is done in the
'mach-tl-mr3x20.c' and in the 'mach-rb4xx.c' files for example.

-Gabor


_______________________________________________
openwrt-devel mailing list
[email protected]
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to