Re: drivers/base/core.c: about device_find_child() function

2013-04-15 Thread Federico Vaga
Thank you very much Greg > > I did not study serial_core, I was looking only for device_find_child(). > > Probably I'm missing something. Anyway, here what does not convice me: > > > > (line number on next-20130412) > > serial_core.c:2003 > > > > tty_dev = device_find_child(uport->dev, &mat

Re: drivers/base/core.c: about device_find_child() function

2013-04-15 Thread Federico Vaga
Hi Lars, > Considering that there seems to be a common pattern here where the caller > only wants to know if the device exists, but is not really interested in the > device itself, how about adding a helper function for this? It was my first thought when I opened this thread. But now I'm convinc

Re: drivers/base/core.c: about device_find_child() function

2013-04-13 Thread Lars-Peter Clausen
On 04/12/2013 02:09 PM, Federico Vaga wrote: > [...] > > [**] (argumentation based, obviously, on my limited understanding) > > These drivers work like this: > > child = device_find_child(parent, data, match_function); > if (child) { > put_device(child); >

Re: drivers/base/core.c: about device_find_child() function

2013-04-12 Thread Greg Kroah-Hartman
On Fri, Apr 12, 2013 at 02:09:20PM +0200, Federico Vaga wrote: > On Thursday 11 April 2013 06:48:44 Greg Kroah-Hartman wrote: > > On Thu, Apr 11, 2013 at 01:52:36PM +0200, Federico Vaga wrote: > > > Hello, > > > > > > I'm using the function device_find_child() [drivers/base/core.c] to > > > retrie

Re: drivers/base/core.c: about device_find_child() function

2013-04-12 Thread Federico Vaga
On Thursday 11 April 2013 06:48:44 Greg Kroah-Hartman wrote: > On Thu, Apr 11, 2013 at 01:52:36PM +0200, Federico Vaga wrote: > > Hello, > > > > I'm using the function device_find_child() [drivers/base/core.c] to > > retrieve a specific child of a device. I see that this function invokes > > get_d

Re: drivers/base/core.c: about device_find_child() function

2013-04-11 Thread Greg Kroah-Hartman
On Thu, Apr 11, 2013 at 01:52:36PM +0200, Federico Vaga wrote: > Hello, > > I'm using the function device_find_child() [drivers/base/core.c] to retrieve > a specific child of a device. I see that this function invokes > get_device(child) when a child matches. I think that this function must > r

drivers/base/core.c: about device_find_child() function

2013-04-11 Thread Federico Vaga
Hello, I'm using the function device_find_child() [drivers/base/core.c] to retrieve a specific child of a device. I see that this function invokes get_device(child) when a child matches. I think that this function must return the reference to the child device without getting it. The function's