linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Srinivas Kandagatla <srinivas.kandagatla-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
To: Mark Brown <broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Cc: Andy Gross <andy.gross-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
	linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	David Brown <david.brown-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
	linux-arm-msm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-soc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH] spi: qup: provide proper bus numbers
Date: Thu, 21 Jan 2016 18:47:34 +0000	[thread overview]
Message-ID: <56A127C6.9000409@linaro.org> (raw)
In-Reply-To: <20160121183810.GN6588-GFdadSzt00ze9xe1eoZjHA@public.gmane.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

>
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2016-01-21 18:47 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-21 18:33 [PATCH] spi: qup: provide proper bus numbers Srinivas Kandagatla
2016-01-21 18:38 ` Mark Brown
     [not found]   ` <20160121183810.GN6588-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2016-01-21 18:47     ` Srinivas Kandagatla [this message]
2016-01-21 19:03       ` Mark Brown
2016-01-21 19:26         ` Srinivas Kandagatla
2016-01-21 20:14           ` Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56A127C6.9000409@linaro.org \
    --to=srinivas.kandagatla-qsej5fyqhm4dnm+yrofe0a@public.gmane.org \
    --cc=andy.gross-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=david.brown-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=linux-arm-msm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-soc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).