/* Returns 0 if successful or a negative value on error  */
static int max7301_write(struct spi_device *spi, unsigned int reg, unsigned int val)
/* Returns 0 if successful or a negative value on error  */
static int max7301_write(struct spi_device *spi, unsigned int reg, unsigned int val)
{
	u16 word = ((reg & 0x7F) << 8) | (val & 0xFF);
	return spi_write(spi, (const u8 *)&word, sizeof(word));
}