From: Lan Tianyu <tianyu.lan@intel.com>
To: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: Lan Tianyu <lantianyu1986@gmail.com>,
Sergei Shtylyov <sshtylyov@mvista.com>,
gregkh@linuxfoundation.org, sarah.a.sharp@linux.intel.com,
stern@rowland.harvard.edu, oneukum@suse.de,
linux-usb@vger.kernel.org,
Linux PM list <linux-pm@vger.kernel.org>
Subject: Re: [RFC PATCH v2 1/6] usb: Register usb port's acpi power resources
Date: Wed, 14 Nov 2012 10:46:29 +0800 [thread overview]
Message-ID: <50A30605.6050703@intel.com> (raw)
In-Reply-To: <46669688.k9rXBaWOjk@vostro.rjw.lan>
On 2012年11月14日 07:56, Rafael J. Wysocki wrote:
> On Tuesday, November 13, 2012 08:36:15 PM Lan Tianyu wrote:
>> 于 2012/11/13 19:07, Sergei Shtylyov 写道:
>>> Hello.
>>>
>>> On 13-11-2012 12:00, Lan Tianyu wrote:
>>>
>>>> This patch is to register usb port's acpi power resources. Create
>>>> link between usb port device and its acpi power resource.
>>>
>>>> Signed-off-by: Lan Tianyu <tianyu.lan@intel.com>
>>> [...]
>>>
>>>> diff --git a/drivers/usb/core/usb-acpi.c b/drivers/usb/core/usb-acpi.c
>>>> index cef4252..c58ebc0 100644
>>>> --- a/drivers/usb/core/usb-acpi.c
>>>> +++ b/drivers/usb/core/usb-acpi.c
>>>> @@ -216,6 +216,28 @@ static struct acpi_bus_type usb_acpi_bus = {
>>>> .find_device = usb_acpi_find_device,
>>>> };
>>>>
>>>> +int usb_acpi_register_power_resources(struct device *dev)
>>>> +{
>>>> + acpi_handle port_handle = DEVICE_ACPI_HANDLE(dev);
>>>> +
>>>> + if (!port_handle)
>>>> + return -ENODEV;
>>>> +
>>>> + if (acpi_power_resource_register_device(dev, port_handle) < 0)
>>>> + return -ENODEV;
>>>> + return 0;
>>>> +}
>>>> +
>>>> +void usb_acpi_unregister_power_resources(struct device *dev)
>>>> +{
>>>> + acpi_handle port_handle = DEVICE_ACPI_HANDLE(dev);
>>>> +
>>>> + if (!port_handle)
>>>> + return;
>>>> +
>>>> + acpi_power_resource_register_device(dev, port_handle);
>>>
>>> I thinbk you have been askied already, but shouldn't it be
>>> acpi_power_resource_unregister_device()?
>>>
>> Oh. Sorry. Too focus on the other modification. Thanks for your reminder.
>
> Besides, it would be a bit more natural to do
>
> if (port_handle)
> acpi_power_resource_unregister_device(dev, port_handle);
>
> instead of doing that return when port_handle is NULL.
>
Hi Rafael:
Great thanks for your review. :)
I get it and will update it at next version.
> Thanks,
> Rafael
>
>
--
Best regards
Tianyu Lan
next prev parent reply other threads:[~2012-11-14 2:50 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1352793605-4168-1-git-send-email-tianyu.lan@intel.com>
[not found] ` <50A229E9.4060404@mvista.com>
[not found] ` <50A23EBF.1070304@gmail.com>
2012-11-13 23:56 ` [RFC PATCH v2 1/6] usb: Register usb port's acpi power resources Rafael J. Wysocki
2012-11-14 2:46 ` Lan Tianyu [this message]
[not found] ` <1352793605-4168-3-git-send-email-tianyu.lan@intel.com>
2012-11-14 0:04 ` [RFC PATCH v2 2/6] usb: Add driver/usb/core/port.c file to fill usb port related code Rafael J. Wysocki
[not found] ` <2444119.E7TGPxnJj8-sKB8Sp2ER+y1GS7QM15AGw@public.gmane.org>
2012-11-14 3:17 ` Lan Tianyu
[not found] ` <1352793605-4168-4-git-send-email-tianyu.lan@intel.com>
2012-11-14 0:08 ` [RFC PATCH v2 3/6] usb: add runtime pm support for usb port device Rafael J. Wysocki
2012-11-14 6:34 ` Lan Tianyu
2012-11-14 9:49 ` Rafael J. Wysocki
[not found] ` <2700525.6XmcYg8quR-sKB8Sp2ER+y1GS7QM15AGw@public.gmane.org>
2012-11-14 12:45 ` Lan Tianyu
2012-11-14 14:14 ` Lan Tianyu
[not found] ` <50A39285.80305-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2012-11-14 15:13 ` Lan Tianyu
2012-11-14 17:07 ` Alan Stern
[not found] ` <1352793605-4168-5-git-send-email-tianyu.lan@intel.com>
2012-11-14 0:16 ` [RFC PATCH v2 4/6] usb: add usb port auto power off mechanism Rafael J. Wysocki
[not found] ` <1352793605-4168-6-git-send-email-tianyu.lan@intel.com>
2012-11-14 0:21 ` [RFC PATCH v2 5/6] usb: expose usb port's pm qos flags to user space Rafael J. Wysocki
[not found] ` <1352793605-4168-7-git-send-email-tianyu.lan@intel.com>
2012-11-14 0:23 ` [RFC PATCH v2 6/6] usb: add usb port's pm qos flags request to change NO_POWER_OFF flag Rafael J. Wysocki
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=50A30605.6050703@intel.com \
--to=tianyu.lan@intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=lantianyu1986@gmail.com \
--cc=linux-pm@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=oneukum@suse.de \
--cc=rjw@sisk.pl \
--cc=sarah.a.sharp@linux.intel.com \
--cc=sshtylyov@mvista.com \
--cc=stern@rowland.harvard.edu \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).