Re: [PATCH 2/5] ACPI processor: Avoid WARN message on processor driver removal

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

 



On 11/17/2011 05:36 PM, Thomas Renninger wrote:

> Only unregister acpi_idle driver if acpi_idle driver got
> registered.
> 
> Also add a static acpi_idle_active variable for easy and nicer
> checking whether acpi_idle_driver is active (as suggested by
> Bjorn).
> 
> Signed-off-by: Thomas Renninger <trenn@xxxxxxx>
> CC: Len Brown <lenb@xxxxxxxxxx>
> CC: linux-acpi@xxxxxxxxxxxxxxx
> CC: Bjorn Helgaas <bhelgaas@xxxxxxxxxx>
> ---
>  drivers/acpi/processor_driver.c |   11 +++++++----
>  1 files changed, 7 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/acpi/processor_driver.c b/drivers/acpi/processor_driver.c
> index 3a4fc0c..790623f 100644
> --- a/drivers/acpi/processor_driver.c
> +++ b/drivers/acpi/processor_driver.c
> @@ -110,6 +110,7 @@ static struct cpuidle_driver acpi_idle_driver = {
>  	.name =		"acpi_idle",
>  	.owner =	THIS_MODULE,
>  };
> +static int acpi_idle_active;
>  
>  #define INSTALL_NOTIFY_HANDLER		1
>  #define UNINSTALL_NOTIFY_HANDLER	2
> @@ -508,8 +509,7 @@ static int __cpuinit acpi_processor_add(struct acpi_device *device)
>  	acpi_processor_get_throttling_info(pr);
>  	acpi_processor_get_limit_info(pr);
>  
> -
> -	if (cpuidle_get_driver() == &acpi_idle_driver)
> +	if (acpi_idle_active)
>  		acpi_processor_power_init(pr, device);


I think the old cold reads better than the new code,
since I don't have to guess what "acpi_idle_active" means...

Perhaps you can use the existing mechanism where
it is missing to guard the unregister and re-fresh?

thanks,
-Len

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


[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux