All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: Linus Walleij <linus.walleij@stericsson.com>
Cc: linux-kernel@vger.kernel.org,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	Rabin Vincent <rabin.vincent@stericsson.com>,
	Linus Walleij <linus.walleij@linaro.org>
Subject: Re: [PATCH RESEND] driver core: always handle dpm_order
Date: Mon, 23 Apr 2012 13:47:38 +0200	[thread overview]
Message-ID: <201204231347.38232.rjw@sisk.pl> (raw)
In-Reply-To: <1335165396-23604-1-git-send-email-linus.walleij@stericsson.com>

On Monday, April 23, 2012, Linus Walleij wrote:
> From: Rabin Vincent <rabin.vincent@stericsson.com>
> 
> If !dev->class, device_move() does not respect the dpm_order.
> Fix it to do so.
> 
> Cc: Rafael J. Wysocki <rjw@sisk.pl>

Acked-by: Rafael J. Wysocki <rjw@sisk.pl>

> Signed-off-by: Rabin Vincent <rabin.vincent@stericsson.com>
> Reviewed-by: Srinidhi Kasagar <srinidhi.kasagar@stericsson.com>
> [Fixed a small dangling label compile warning]
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
> ---
>  drivers/base/core.c |   36 ++++++++++++++++++------------------
>  1 file changed, 18 insertions(+), 18 deletions(-)
> 
> diff --git a/drivers/base/core.c b/drivers/base/core.c
> index e28ce98..f428321 100644
> --- a/drivers/base/core.c
> +++ b/drivers/base/core.c
> @@ -1753,25 +1753,25 @@ int device_move(struct device *dev, struct device *new_parent,
>  		set_dev_node(dev, dev_to_node(new_parent));
>  	}
>  
> -	if (!dev->class)
> -		goto out_put;
> -	error = device_move_class_links(dev, old_parent, new_parent);
> -	if (error) {
> -		/* We ignore errors on cleanup since we're hosed anyway... */
> -		device_move_class_links(dev, new_parent, old_parent);
> -		if (!kobject_move(&dev->kobj, &old_parent->kobj)) {
> -			if (new_parent)
> -				klist_remove(&dev->p->knode_parent);
> -			dev->parent = old_parent;
> -			if (old_parent) {
> -				klist_add_tail(&dev->p->knode_parent,
> -					       &old_parent->p->klist_children);
> -				set_dev_node(dev, dev_to_node(old_parent));
> +	if (dev->class) {
> +		error = device_move_class_links(dev, old_parent, new_parent);
> +		if (error) {
> +			/* We ignore errors on cleanup since we're hosed anyway... */
> +			device_move_class_links(dev, new_parent, old_parent);
> +			if (!kobject_move(&dev->kobj, &old_parent->kobj)) {
> +				if (new_parent)
> +					klist_remove(&dev->p->knode_parent);
> +				dev->parent = old_parent;
> +				if (old_parent) {
> +					klist_add_tail(&dev->p->knode_parent,
> +						       &old_parent->p->klist_children);
> +					set_dev_node(dev, dev_to_node(old_parent));
> +				}
>  			}
> +			cleanup_glue_dir(dev, new_parent_kobj);
> +			put_device(new_parent);
> +			goto out;
>  		}
> -		cleanup_glue_dir(dev, new_parent_kobj);
> -		put_device(new_parent);
> -		goto out;
>  	}
>  	switch (dpm_order) {
>  	case DPM_ORDER_NONE:
> @@ -1786,7 +1786,7 @@ int device_move(struct device *dev, struct device *new_parent,
>  		device_pm_move_last(dev);
>  		break;
>  	}
> -out_put:
> +
>  	put_device(old_parent);
>  out:
>  	device_pm_unlock();
> 


  reply	other threads:[~2012-04-23 11:43 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-23  7:16 [PATCH RESEND] driver core: always handle dpm_order Linus Walleij
2012-04-23 11:47 ` Rafael J. Wysocki [this message]
2012-04-23 15:43 ` Greg Kroah-Hartman
2012-04-24 12:11   ` Linus Walleij
2012-04-24 14:36     ` Greg Kroah-Hartman
2012-05-28  6:38       ` Linus Walleij
2012-05-28  7:14         ` Greg Kroah-Hartman
2012-05-28  9:33           ` Linus Walleij
2012-06-11 16:30             ` Linus Walleij

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=201204231347.38232.rjw@sisk.pl \
    --to=rjw@sisk.pl \
    --cc=gregkh@linuxfoundation.org \
    --cc=linus.walleij@linaro.org \
    --cc=linus.walleij@stericsson.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rabin.vincent@stericsson.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.