On 03/03/2026 09:59, Bryan O'Donoghue wrote:
On 01/03/2026 00:51, David Heidelberg via B4 Relay wrote:
@bod
Proliferating special cases in switch statements on a per-SoC basis is
verboten.

Hmm, your ideas are intriguing to me, and I wish to subscribe to your
newsletter.

---
bod


@David.

I'm realising my Simpson's reference probably isn't actionable development feedback ;)

How about embeddding a pointer to either a DPHY or CPHY init sequence somewhere and checking that pointer ?

If it the CPHY init sequence/table in this case, is NULL return -EOPTNOTSUPP.

That way instead of constantly extending a switch for each new SoC we enumerate a pointer and check that pointer's validity.

Then we have nice clean code which just checks the value of a pointer, instead of an ever-growing list of SoCs in a switch.

---
bod

Reply via email to