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

From: Cornelia Huck
Date: Mon Jan 08 2007 - 08:21:13 EST


On Tue, 05 Dec 2006 16:26:11 +0100,
Marcel Holtmann <marcel@xxxxxxxxxxxx> 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: cornelia.huck@xxxxxxxxxx
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/