Re: [PATCH] spi: setting up cs_gpio levels prior to registering spi devices

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

 



On Mon, Apr 06, 2015 at 05:16:32PM +0000, kernel@xxxxxxxxxxxxxxxx wrote:

> +	mutex_lock(&board_lock);
> +	list_for_each_entry(bi, &board_list, list) {
> +		sbi = &bi->board_info;
> +		if ((master->bus_num == sbi->bus_num) &&
> +		    (sbi->chip_select < master->num_chipselect) &&
> +		    gpio_is_valid(master->cs_gpios[sbi->chip_select]) &&
> +		    (sbi->mode & SPI_CS_HIGH))
> +			gpio_set_value(master->cs_gpios[sbi->chip_select], 0);

Please write a series of if statements with continues instead, the above
block is pretty much illegible with the lack of vertical space, mixture
of bracketing levels and small indent for the active statement at the
end.

As far as I can tell this code only works for GPIO chip selects?

> +static void acpi_spi_setup_gpiopins(struct spi_master *master)
> +{
> +	/* probably not needed, as there seems to be no cs_gpio
> +	 * information in the ACPI structures but left for completeness
> +	 * to get extended if needed
> +	 */
> +}

Please don't write placeholders like this.

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