Re: [RFC PATCH 3/5] usb: expose usb port's pm qos flags to user space

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

 



On Fri, 9 Nov 2012, Lan Tianyu wrote:

> This patch is to expose usb port's pm qos flags(pm_qos_no_power_off,
> pm_qos_remote_wakeup) to user space. The pm_qos_no_power_off will
> be used to control usb port auto power off mechanism from user space.

Something here doesn't look right...

> @@ -1289,8 +1290,16 @@ static int usb_hub_create_port_device(struct usb_hub *hub,
>  	retval = device_register(&port_dev->dev);
>  	if (retval)
>  		goto error_register;
> +
> +	retval = dev_pm_qos_expose_flags(&port_dev->dev,
> +			PM_QOS_FLAG_NO_POWER_OFF);
> +	if (retval)
> +		goto error_expose_pm_qos;
> +
>  	return 0;
>  
> +error_expose_pm_qos:
> +	device_unregister(&port_dev->dev);
>  error_register:
>  	put_device(&port_dev->dev);

device_unregister() calls put_device() for you.  You probably want
device_del() instead of device_unregister().

Alan Stern

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux