/* Returns positive 8 bit value from device if successful or a negative value on error  */
static int max7301_read(struct spi_device *spi, unsigned int reg)
/* Returns positive 8 bit value from device if successful or a negative value on error  */
static int max7301_read(struct spi_device *spi, unsigned int reg)
{
	int ret;
	u16 word;
	word = 0x8000 | (reg << 8);
	ret = spi_write(spi, (const u8 *)&word, sizeof(word));
	if (ret)
		return ret;
	ret = spi_read(spi, (u8 *)&word, sizeof(word));
	if (ret)
		return ret;
	return word & 0xff;
}