/* returns reg contents (0..255) or < 0 for error  */
int ipath_tempsense_read(struct ipath_devdata *dd, u8 regnum)
/* returns reg contents (0..255) or < 0 for error  */
int ipath_tempsense_read(struct ipath_devdata *dd, u8 regnum)
{
	int ret;
	if (regnum > 7)
		return -EINVAL;
	if (!((1 << regnum) & VALID_TS_RD_REG_MASK))
		return 0;
	ret = mutex_lock_interruptible(&dd->ipath_eep_lock);
	if (!ret) {
		ret = ipath_tempsense_internal_read(dd, regnum);
		mutex_unlock(&dd->ipath_eep_lock);
	}
	return ret;
}