Re: [PATCH v3] spi: spi-fsl-dspi: Enable TCF interrupt mode support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


[Index of Archives]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux