arm: mach-orion5x: ts78xx: simplify support configuration with table
Subsystems (4)
PATCH 1/1 arm: mach-orion5x: ts78xx: simplify support configuration with table
Replace switch statement based configuration with a lookup table approach. The table is iterated through matching the correct configuration instead of setting the configuration on a case by case basis.
--- arch/arm/mach-orion5x/ts78xx-fpga.h | 7 ++++ arch/arm/mach-orion5x/ts78xx-setup.c | 60 +++++++++++++++------------- 2 files changed, 40 insertions(+), 27 deletions(-)
arch/arm/mach-orion5x/ts78xx-fpga.h +7 -0
@@ -40,3 +40,10 @@ struct ts78xx_fpga_data {struct fpga_devices supports; }; + +struct ts78xx_fpga_support_config { +u32 id; +bool rtc_present; +bool nand_present; +bool rng_present; +};
arch/arm/mach-orion5x/ts78xx-setup.c +33 -27
75 lines not on this page · raw message
Signature · 1 line
2.51.0
Andrew Lunn
maintainerQuoted 3 lines · Alex Tran
Replace switch statement based configuration with a lookup table approach. The table is iterated through matching the correct configuration instead of setting the configuration on a case by case basis.
Is there anything actually wrong with the current code?
How did you test this? Do you have a tx78xx?
The only changes made to this file in the last decade have been tree wide changes. So unless you have one of these machines and intend to add new features, i suggest you just leave this alone, it is just needles churn to an ancient platform.
Andrew