On Sun Oct 11, 2026 at 11:23 AM CEST, Théo Lebrun wrote:
quoted
-static int macb_mdio_write_c22(struct mii_bus *bus, int mii_id, int regnum,
- u16 value)
+static u64 macb_mdio_sts_delay(struct macb *bp)
+{
+ static const u16 gem_divisors[] = {
+ [GEM_CLK_DIV8] = 8,
+ [GEM_CLK_DIV16] = 16,
+ [GEM_CLK_DIV32] = 32,
+ [GEM_CLK_DIV48] = 48,
+ [GEM_CLK_DIV64] = 64,
+ [GEM_CLK_DIV96] = 96,
+ [GEM_CLK_DIV128] = 128,
+ [GEM_CLK_DIV224] = 224,
+ };
+ static const u16 macb_divisors[] = {
+ [MACB_CLK_DIV8] = 8,
+ [MACB_CLK_DIV16] = 16,
+ [MACB_CLK_DIV32] = 32,
+ [MACB_CLK_DIV64] = 64,
+ };
Do I sound crazy if I say we could use a single array for both?
Both GEM_CLK_DIV* and MACB_CLK_DIV* are enums and are ordered in the
same way. First four GEM_* are the same ones as MACB_* and it will
never change.
Ignore this comment because gem_divisors[3] != macb_divisors[3].
Thanks,
--
Théo Lebrun, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com