Thread (31 messages) flat view 31 messages, 2 authors, 2016-05-06

Re: [RFC PATCH net-next 04/20] net: dsa: mv88e6xxx: factorize temperature access

From: Andrew Lunn <andrew@lunn.ch>
Date: 2016-05-05 23:40:37
Also in: lkml

 int mv88e6xxx_get_temp(struct dsa_switch *ds, int *temp)
 {
 	struct mv88e6xxx_priv_state *ps = ds_to_priv(ds);
+	int err;
+
+	if (!mv88e6xxx_has(ps, MV88E6XXX_FLAG_TEMP))
+		return -EOPNOTSUPP;
+
+	mutex_lock(&ps->smi_mutex);
 
 	if (mv88e6xxx_6320_family(ps) || mv88e6xxx_6352_family(ps))
-		return mv88e63xx_get_temp(ds, temp);
+		err = _mv88e63xx_get_temp(ps, temp);
+	else
+		err = _mv88e61xx_get_temp(ps, temp);
It seems like this should be done with a flag, rather than the family.

However, don't spend too much time on this. I plan to rip it all out
and put it in the correct place, in the Marvell PHY driver. The
temperature sensor is in the PHY, and other Marvell PHYs also have
this temperature sensor.

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