drivers/gpio/gpio-max7301.c
static int max7301_spi_read(struct device *dev, unsigned int reg)
{
	int ret;
	u16 word;
	struct spi_device *spi = to_spi_device(dev);

	word = 0x8000 | (reg << 8);
	ret = spi_write(spi, (const u8 *)&word, sizeof(word));
	if (ret)
		return ret;
	/*
	 * This relies on the fact, that a transfer with NULL tx_buf shifts out
	 * zero bytes (=NOOP for MAX7301)
	 */
	ret = spi_read(spi, (u8 *)&word, sizeof(word));
	if (ret)
		return ret;
	return word & 0xff;
}
/* A read from the MAX7301 means two transfers; here, one message each */
A read from the MAX7301 means two transfers; here, one message each
A read from the MAX7301 means two transfers ; here one message each
static int max7301_spi_read(struct device *dev, unsigned int reg)
{
	int ret;
	u16 word;
	struct spi_device *spi = to_spi_device(dev);
	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;
}
static int max7301_spi_read ( struct device * dev , unsigned int reg ) { int ret ; u16 word ; struct spi_device * spi = to_spi_device ( dev ) ; 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 ; }
A read from the MAX7301 means two transfers; here, one message each
A read from the MAX7301 means two transfers ; here one message each
/*
	 * This relies on the fact, that a transfer with NULL tx_buf shifts out
	 * zero bytes (=NOOP for MAX7301)
	 */