On Mon, May 25, 2015 at 06:07:49PM +0800, Haikun Wang wrote: > + if (dspi->devtype_data->trans_mode == DSPI_EOQ_MODE) { > + regmap_write(dspi->regmap, SPI_RSER, SPI_RSER_EOQFE); > + message->actual_length += dspi_eoq_write(dspi); > + } else if (dspi->devtype_data->trans_mode == DSPI_TCFQ_MODE) { > + regmap_write(dspi->regmap, SPI_RSER, SPI_RSER_TCFQE); > + message->actual_length += dspi_tcfq_write(dspi); > + } Please use switch statements to select between variants (this is more idiomatic and makes it easier to add any new variants) both here and in the other place where you do this. It'd also be better to handle the default case - what happens if we forgot a mode here? I'd expect at least an error message. Otherwise this looks good.
Attachment:
signature.asc
Description: Digital signature