Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1395495
| From | Andrew Lunn <andrew@lunn.ch> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [RFC PATCH net-next 04/20] net: dsa: mv88e6xxx: factorize temperature access |
| Date | 2016-05-06 01:50 +0200 |
| Message-ID | <rvBbQ-1tA-9@gated-at.bofh.it> (permalink) |
| References | <rvAfL-Dg-3@gated-at.bofh.it> <rvAfM-Dg-15@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
> 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
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
[RFC PATCH net-next 04/20] net: dsa: mv88e6xxx: factorize temperature access Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2016-05-06 00:50 +0200 Re: [RFC PATCH net-next 04/20] net: dsa: mv88e6xxx: factorize temperature access Andrew Lunn <andrew@lunn.ch> - 2016-05-06 01:50 +0200
csiph-web