[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <49E5F457.5090602@csr.com>
Date: Wed, 15 Apr 2009 15:51:03 +0100
From: David Vrabel <david.vrabel@....com>
To: Greg KH <greg@...ah.com>
CC: Kernel development list <linux-kernel@...r.kernel.org>
Subject: Re: device_for_each_child() before device_add() doesn't work
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/
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists