Thread (17 messages) 17 messages, 3 authors, 2017-06-09

Re: [PATCH net-next 5/5] net: dsa: Stop accessing ds->dst->cpu_dp in drivers

flat view

From: Vivien Didelot <hidden>
Date: 2017-06-06 18:11:30

Florian Fainelli [off-list ref] writes:
-	phy_mode = of_get_phy_mode(ds->dst->cpu_dp->dn);
+	phy_mode = of_get_phy_mode(ds->ports[QCA8K_CPU_PORT].dn);
Is it necessary to use QCA8K_CPU_PORT?
quoted hunk ↗ jump to hunk
+static inline struct dsa_port *dsa_ds_get_cpu_dp(struct dsa_switch *ds)
+{
+	return &ds->ports[fls(ds->cpu_port_mask) - 1];
+}
Wouldn't it be better to return the CPU port for a given port?
Something like return ds->ports[port].cpu_dp, so that we ease the
introduction of multiple CPU port a bit more?

Thanks,

        Vivien
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help