From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760110AbcAUSrm (ORCPT ); Thu, 21 Jan 2016 13:47:42 -0500 Received: from mail-wm0-f48.google.com ([74.125.82.48]:35250 "EHLO mail-wm0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760028AbcAUSrk (ORCPT ); Thu, 21 Jan 2016 13:47:40 -0500 Message-ID: <56A127C6.9000409@linaro.org> Date: Thu, 21 Jan 2016 18:47:34 +0000 From: Srinivas Kandagatla User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Mark Brown CC: Andy Gross , linux-spi@vger.kernel.org, David Brown , linux-arm-msm@vger.kernel.org, linux-soc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] spi: qup: provide proper bus numbers References: <1453401227-27135-1-git-send-email-srinivas.kandagatla@linaro.org> <20160121183810.GN6588@sirena.org.uk> In-Reply-To: <20160121183810.GN6588@sirena.org.uk> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 21/01/16 18:38, Mark Brown wrote: > On Thu, Jan 21, 2016 at 06:33:47PM +0000, Srinivas Kandagatla wrote: > >> This driver reuses pdev->id for spi bus numbers resulting in random >> or very large bus numbering when used with device trees. pdev->id >> is not the correct choice when using device trees. So add code to > > What makes you say this, why is pdev->id not "correct"? It is worrying > if anything cares what number we pick. Issue is that using pdev->id for bus number, as pdev->id does not get populated in device tree cases. The end users who are reading the schematics would not be able to map the actual bus numbers on the schematics with the bus numbers allocated using pdev->id. It add more confusion. Without this patch the bus number allocated to this driver is 32766. This does not really reflect the actual bus numbers on the boards schematics. > >> get bus numbers via device tree aliases and if it fails then generate >> a unique bus number. > > The other question is even if this is a good idea why is it something > that should be open coded in individual drivers, if we want to change > the policy we should be consistent between drivers. Device tree aliases seems used very much in many drivers. The unique bus number scheme was actually inspired by the driver/tty/serial/msm_serial.c --srini >