From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1034226AbeEXSPN (ORCPT ); Thu, 24 May 2018 14:15:13 -0400 Received: from heliosphere.sirena.org.uk ([172.104.155.198]:41650 "EHLO heliosphere.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030579AbeEXSPK (ORCPT ); Thu, 24 May 2018 14:15:10 -0400 Date: Thu, 24 May 2018 19:15:04 +0100 From: Mark Brown To: Radu Pirea Cc: Andy Shevchenko , devicetree , "open list:SERIAL DRIVERS" , Linux Kernel Mailing List , linux-arm Mailing List , linux-spi , Mark Rutland , Rob Herring , Lee Jones , Greg Kroah-Hartman , Jiri Slaby , Richard Genoud , alexandre.belloni@bootlin.com, Nicolas Ferre Subject: Re: [PATCH v3 5/6] spi: at91-usart: add driver for at91-usart as spi Message-ID: <20180524181504.GD4828@sirena.org.uk> References: <20180511103822.31698-1-radu.pirea@microchip.com> <20180511103822.31698-6-radu.pirea@microchip.com> <5a3930b867cf8c279953d08c5d5dd1d93113a43b.camel@microchip.com> <20180517045437.GE20254@sirena.org.uk> <0e6e71e2-f8ac-7889-0d81-8d8a4c15223d@microchip.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="nM4qzG6nHdnn/sXd" Content-Disposition: inline In-Reply-To: <0e6e71e2-f8ac-7889-0d81-8d8a4c15223d@microchip.com> X-Cookie: Excellent day to have a rotten day. User-Agent: Mutt/1.9.5 (2018-04-13) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --nM4qzG6nHdnn/sXd Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, May 24, 2018 at 07:04:11PM +0300, Radu Pirea wrote: > if (ctlr->cs_gpios){ > spi->cs_gpio =3D ctlr->cs_gpios[spi->chip_select]; > if(gpio_is_valid(spi->cs_gpio)) > gpio_direction_output(spi->cs_gpio, !(spi->mode & SPI_CS_HIGH= )); >=20 > } You're expected to request the GPIOs in your driver using one of the modern request functions like gpio_request_one() (or ideally the GPIO descriptor APIs now) which combine the direction setting and request into a single operation. --nM4qzG6nHdnn/sXd Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAlsHAScACgkQJNaLcl1U h9BqxAf/S0gGqu0IMSK130ze8IY89SOLEGlgGuLh/vwkkGxSCgPr0mICv9ACiGpT OHwxAY3B5/c4pNaBy+fxG9lbX9ICC9h0KXlI8rR77QoswXGhgpJRPRHOQXMJM+jC xhqikX6tCNqY63QiW4RcVD8VwXZcD3oXZxCFxGuIOGApc/Rr9wEHnYixQALYVVLJ pYMXKkH5QPAjT8AhNVT0WP5kWKTdy1RGrxQUeDDfx3+sG/qon5/wsi0sv94/k2Mg JR4o9b3106ixUzdQg1unGL+yIJ1FXRuaAScxr40oxvTyq2g9Y3lSCeOM3mQ9As86 oTBXd72yVK8/rlDeP+58c6MCOeXOyg== =BBrr -----END PGP SIGNATURE----- --nM4qzG6nHdnn/sXd-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: broonie@kernel.org (Mark Brown) Date: Thu, 24 May 2018 19:15:04 +0100 Subject: [PATCH v3 5/6] spi: at91-usart: add driver for at91-usart as spi In-Reply-To: <0e6e71e2-f8ac-7889-0d81-8d8a4c15223d@microchip.com> References: <20180511103822.31698-1-radu.pirea@microchip.com> <20180511103822.31698-6-radu.pirea@microchip.com> <5a3930b867cf8c279953d08c5d5dd1d93113a43b.camel@microchip.com> <20180517045437.GE20254@sirena.org.uk> <0e6e71e2-f8ac-7889-0d81-8d8a4c15223d@microchip.com> Message-ID: <20180524181504.GD4828@sirena.org.uk> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On Thu, May 24, 2018 at 07:04:11PM +0300, Radu Pirea wrote: > if (ctlr->cs_gpios){ > spi->cs_gpio = ctlr->cs_gpios[spi->chip_select]; > if(gpio_is_valid(spi->cs_gpio)) > gpio_direction_output(spi->cs_gpio, !(spi->mode & SPI_CS_HIGH)); > > } You're expected to request the GPIOs in your driver using one of the modern request functions like gpio_request_one() (or ideally the GPIO descriptor APIs now) which combine the direction setting and request into a single operation. -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 488 bytes Desc: not available URL: