From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tomasz Figa Subject: Re: [PATCH 1/2 v2] spi: s3c64xx: use "cs-gpios" from spi node instead of "cs-gpio" Date: Tue, 10 Jun 2014 21:59:59 +0200 Message-ID: <539763BF.1030209@gmail.com> References: <1402394881-31564-1-git-send-email-ch.naveen@samsung.com> <1402394881-31564-2-git-send-email-ch.naveen@samsung.com> <53976154.60308@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: Sender: linux-samsung-soc-owner@vger.kernel.org To: Doug Anderson Cc: Naveen Krishna Chatradhi , "linux-arm-kernel@lists.infradead.org" , spi-devel-general@lists.sourceforge.net, linux-samsung-soc , Naveen Krishna , "broonie@kernel.org" , Grant Likely , Jaswinder Singh , Kukjin Kim , "cpgs ." , "devicetree@vger.kernel.org" , Javier Martinez Canillas List-Id: devicetree@vger.kernel.org On 10.06.2014 21:58, Doug Anderson wrote: > Tomasz, > > On Tue, Jun 10, 2014 at 12:49 PM, Tomasz Figa wrote: >> This is wrong. The "cs-gpios" property is supposed to be an array, >> indexed by chip select number of SPI devices (indicated by their "reg" >> properties). >> >> Moreover, is there a need to parse this manually in this driver? I can >> see respective parsing code in of_spi_register_master(). > > I noticed this too (see my response), but I was confused about the > fact that nobody else uses the array created by > of_spi_register_master(). Any idea why? Hmm, I can see of_spi_register_master() assigning allocated pointer to master->cs_gpios, which is then used in spi_add_device() as follows: if (master->cs_gpios) spi->cs_gpio = master->cs_gpios[spi->chip_select]; Best regards, Tomasz