Subject: Re: Dealing nicely with PM failure

From: Dave Wiltshire <[email-masked]>
Date: Sat, 15 Dec 2012 22:14:56 +0800

On Fri, Dec 14, 2012 at 03:56:26PM +0100, Oliver Neukum wrote:
> @@ -793,15 +794,15 @@ int usbnet_open (struct net_device *net)
>  	// delay posting reads until we're fully open
>  	tasklet_schedule (&dev->bh);
>  	if (info->manage_power) {
> -		retval = info->manage_power(dev, 1);
> -		if (retval < 0)
> -			goto done_manage_power_error;
> -		usb_autopm_put_interface(dev->intf);
> +		int r;
> +
> +		r = info->manage_power(dev, 1);
> +		if (r < 0)
> +			set_bit(EVENT_NO_RUNTIME_PM, &dev->flags);
> +		else
> +			usb_autopm_put_interface(dev->intf);
>  	}
>  	return retval;

Did you mean to change the return value in the successful case? This
used to return 0 on a successful call to info->manage_power(dev, 1).
This patch changes that - perhaps it's still the same (if retval is set
above).

Dave