Re: [PATCH v2] spi: omap2-mcspi: Add support for GPIO chipselects

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

 



On Sun, Apr 26, 2015 at 10:44:30PM -0500, Michael Welling wrote:

> +	if (gpio_is_valid(spi->cs_gpio)) {
> +		gpio_set_value(spi->cs_gpio, (cs_active) ?
> +			!!(spi->mode & SPI_CS_HIGH) :
> +			!(spi->mode & SPI_CS_HIGH));
> +	}

Two problems here.  One is that the above logic statement is just not
readable (the repitition of hecks, the ternery operator, the
indentation...) and the other is that the core chipselect support
already handles GPIO chipselects so you should really be converting the
driver to use that.  At the very least the code needs to be legible
though.

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