linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jun Chen <jun.d.chen-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
To: Mark Brown
	<broonie-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>
Cc: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Bi Chao <chao.bi-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Subject: Re: [PATCH] spi: Add the flag indicate to registe new device as children of master or not.
Date: Wed, 19 Dec 2012 04:44:03 -0500	[thread overview]
Message-ID: <1355910243.1435.39.camel@chenjun-workstation> (raw)
In-Reply-To: <20121218152623.GA26077-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>

On Tue, 2012-12-18 at 15:26 +0000, Mark Brown wrote:
> On Tue, Dec 18, 2012 at 11:29:34AM -0500, Jun Chen wrote:
> 
> >   * @master: Controller to which device is connected
> > + * device_was_children_of_master is flag which the device is registed
> > + * as the children of the bus
> 
> This isn't a kerneldoc style comment (it needs the @XXX: format).  The
> name is also extremely long, can't we think of something more concise?
> 
Thank for your suggestion, I will correct this comment and use concise
flag.

> > -	spi->dev.parent = &master->dev;
> > +	if (device_was_children_of_master == true)
> > +		spi->dev.parent = &master->dev;
> > +	else
> > +		spi->dev.parent = dev;
> 
> Can you provide an example of where this is useful?  Your changelog
> didn't make it clear and the code doesn't make it obvious either.

This spi_alloc_device function will be called in the spi_new_device
function to alloc new device as the master. But other way, it is called
by the of_register_spi_devices function to register new device as the
children of the master. I will update changlog to add it. 

@@ -434,7 +440,7 @@ struct spi_device *spi_new_device(struct spi_master
*master,
         * suggests syslogged diagnostics are best here (ugh).
         */
 
-       proxy = spi_alloc_device(master);
+       proxy = spi_alloc_device(master, false);
        if (!proxy)
                return NULL;
 
@@ -827,7 +833,7 @@ static void of_register_spi_devices(struct
spi_master *master)
 
        for_each_available_child_of_node(master->dev.of_node, nc) {
                /* Alloc an spi_device */
-               spi = spi_alloc_device(master);
+               spi = spi_alloc_device(master, true);


If I have mistake, pls correct me, thanks!




------------------------------------------------------------------------------
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d

  parent reply	other threads:[~2012-12-19  9:44 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-18 16:29 [PATCH] spi: Add the flag indicate to registe new device as children of master or not Jun Chen
2012-12-18 15:26 ` Mark Brown
     [not found]   ` <20121218152623.GA26077-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2012-12-19  9:44     ` Jun Chen [this message]
2012-12-19  9:04       ` Mark Brown
     [not found]         ` <20121219090416.GK4985-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>
2012-12-19 16:21           ` Grant Likely
2012-12-21 17:39             ` Jun Chen
2012-12-21 19:06               ` Grant Likely
2012-12-24 16:16                 ` Jun Chen
2013-01-11 14:57                   ` Grant Likely

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=1355910243.1435.39.camel@chenjun-workstation \
    --to=jun.d.chen-ral2jqcrhueavxtiumwx3w@public.gmane.org \
    --cc=broonie-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org \
    --cc=chao.bi-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@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).