public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: David Vrabel <david.vrabel@csr.com>
To: Greg KH <greg@kroah.com>
Cc: Kernel development list <linux-kernel@vger.kernel.org>
Subject: Re: device_for_each_child() before device_add() doesn't work
Date: Wed, 15 Apr 2009 15:51:03 +0100	[thread overview]
Message-ID: <49E5F457.5090602@csr.com> (raw)
In-Reply-To: <20090415051548.GC3462@kroah.com>

Greg KH wrote:
> 
> So the problem is for the first device being added, right?  Can't you
> just have a flag for this?

It's trivial to fix in the UWB stack.

>> This address must be assigned during initialization and during normal 
>> operation and in the past we didn't need to special case the address 
>> assignment during initialization.
> 
> Does the patch below fix the problem for you?

Yes.

>  drivers/base/core.c |    3 +++
>  1 file changed, 3 insertions(+)
> 
> --- a/drivers/base/core.c
> +++ b/drivers/base/core.c
> @@ -1142,6 +1142,9 @@ int device_for_each_child(struct device 
>  	struct device *child;
>  	int error = 0;
>  
> +	if (!parent->p)
> +		return 0;
> +
>  	klist_iter_init(&parent->p->klist_children, &i);
>  	while ((child = next_device(&i)) && !error)
>  		error = fn(child, data);
> 
> 

David
-- 
David Vrabel, Senior Software Engineer, Drivers
CSR, Churchill House, Cambridge Business Park,  Tel: +44 (0)1223 692562
Cowley Road, Cambridge, CB4 0WZ                 http://www.csr.com/

  reply	other threads:[~2009-04-15 14:52 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-14 16:54 device_for_each_child() before device_add() doesn't work David Vrabel
2009-04-14 16:59 ` Greg KH
2009-04-14 18:16   ` David Vrabel
2009-04-15  5:15     ` Greg KH
2009-04-15 14:51       ` David Vrabel [this message]
2009-04-16  2:48         ` Greg KH

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=49E5F457.5090602@csr.com \
    --to=david.vrabel@csr.com \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.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