Re: [PATCH 32/36] driver core: Introduce device_move(): move a device to a new parent.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 05 Dec 2006 16:26:11 +0100,
Marcel Holtmann <[email protected]> wrote:

[sorry about the late reply, but I've been on vacation & offline]

> I was checking why device_move() fails and it seems that the check for
> is_registered is the problem here.
> 
>         if (!device_is_registered(dev)) {
>                 error = -EINVAL;
>                 goto out;
>         }
> 
> The ACL link has been attached to the Bluetooth bus, but for some reason
> it still thinks that it is unregistered. Is this check really needed. I
> think it should be possible to also move devices that are not part of a
> bus, yet. And removing that check makes it work for me.

Hm, device_is_registered() is always false for devices not belonging to
a bus. I'll remove that check.

> > > > > And shouldn't device_move(dev, NULL) re-attach it to the virtual device
> > > > > tree instead of failing?
> > > >
> > > > Yes, that would be good to have.
> > >
> > > Cornelia, please fix this, because otherwise we can't detach a device
> > > from its parent. Storing the current virtual parent looks racy to me.
> >
> > You can always restore the previous "virtual" parent from the
> > information given to you in the device itself.  That is what the code
> > does when it first registers the device.
> >
> > And yes, I too think it should be fixed.
> 
> My knowledge of the driver model is still limited. Can you fix that
> quickly. This is really needed.

I'm currently working on a patch. Sorry for the delay, I hope I can get
it out today.

-- 
Cornelia Huck
Linux for zSeries Developer
Tel.: +49-7031-16-4837, Mail: [email protected]
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux