Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753542AbbD2Krp (ORCPT ); Wed, 29 Apr 2015 06:47:45 -0400 Received: from mezzanine.sirena.org.uk ([106.187.55.193]:42563 "EHLO mezzanine.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1422696AbbD2Krm (ORCPT ); Wed, 29 Apr 2015 06:47:42 -0400 Date: Wed, 29 Apr 2015 11:47:37 +0100 From: Mark Brown To: Michael Welling Cc: linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org Message-ID: <20150429104737.GC22845@sirena.org.uk> References: <1430106270-17142-1-git-send-email-mwelling@ieee.org> <20150427195550.GE22845@sirena.org.uk> <20150428012150.GA12713@deathray> <20150428143425.GS22845@sirena.org.uk> <20150428230643.GC19294@deathray> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="bLwrn1Kt3RWHCIGI" Content-Disposition: inline In-Reply-To: <20150428230643.GC19294@deathray> X-Cookie: Your present plans will be successful. User-Agent: Mutt/1.5.23 (2014-03-12) X-SA-Exim-Connect-IP: 94.175.94.161 X-SA-Exim-Mail-From: broonie@sirena.org.uk Subject: Re: [PATCH v2] spi: omap2-mcspi: Add support for GPIO chipselects X-SA-Exim-Version: 4.2.1 (built Mon, 26 Dec 2011 16:24:06 +0000) X-SA-Exim-Scanned: Yes (on mezzanine.sirena.org.uk) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2143 Lines: 57 --bLwrn1Kt3RWHCIGI Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tue, Apr 28, 2015 at 06:06:43PM -0500, Michael Welling wrote: > On Tue, Apr 28, 2015 at 03:34:25PM +0100, Mark Brown wrote: > > > if (gpio_is_valid(spi->cs_gpio)) { > > > if (cs_active) > > > gpio_set_value(spi->cs_gpio, spi->mode & SPI_CS_HIGH); > > > else > > > gpio_set_value(spi->cs_gpio, !(spi->mode & SPI_CS_HIGH)); > > > } > > That's good but please have braces around the inner if for clarity. > I try to follow the CodingStyle documentation and it says differently: > http://lxr.free-electrons.com/source/Documentation/CodingStyle#L156 That's for free standing if statements, the reason I'm asking for braces at both levels here is that you've got a nested if - it's similar to having braces on both branches of an if, being consistent within the same statement. > I have also been looking at ways of allowing more GPIO chipselects than > DMA channels. Currently this driver is limited to one chipselect per > DMA channel. > Do you have any ideas on how to accomplish this? Just use a single channel for the controller rather than allocating them per device? It's not like the controller is going to be able to interact with multiple devics simultaneously. --bLwrn1Kt3RWHCIGI Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJVQLbIAAoJECTWi3JdVIfQV9oH/jduCQg/fGoRjxpPJn3CNeCz rsspL1kN8N3u/0FDhyM5EKu/ZIkAGAXuY8YwO5XafJIM67syZIgv28xnEMvXrnRu 7tcRk5ijOVgzZ4/pkof24RxxLLzzoLvvgLQTHgr1QFc5cF/zL5DnnI6U512Bfc2V VgL2vRmXnETCDYXo1Lfx9T52RTvVw91SoBS1Ge3Jqama2151d8stXzBHX4UtLiOz /mw5oD3g2toQaytrZwjd7lwsoWa6Cs2ocNbnpNPwYTxVK842WnnaeiHw8RjjCF/U lrBsPsTtYVwo3yn9OA/zvJC3zB60may5hugGe4HDwQlX2hirktIbnV0Pudvx1Ro= =yyaL -----END PGP SIGNATURE----- --bLwrn1Kt3RWHCIGI-- -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/