quoted hunk ↗ jump to hunk
@@ -199,6 +199,9 @@ static void mt7530_port_fast_age(struct dsa_switch *ds, int port)
u32 val;
int ret;
+ if (priv->is_passthrough)
+ return;
+
mutex_lock(&priv->reg_mutex);
/* Flush all non-static MAC address entries */
@@ -970,6 +973,9 @@ mt7530_set_ageing_time(struct dsa_switch *ds, unsigned int msecs)
unsigned int age_count;
unsigned int age_unit;
+ if (priv->is_passthrough)
+ return 0;
+
@@ -1386,11 +1446,14 @@ mt7530_port_change_mtu(struct dsa_switch *ds, int port, int new_mtu)
int length;
u32 val;
+ if (priv->is_passthrough)
+ return 0;
+
What is actually left?
Is there sufficient code reuse that this makes sense?
Would it be simpler to have a much simpler DSA driver just for pass
through? Or the mt7530 driver has a second dsa_switch_ops instance
with all these functions set to NULL?
Andrew