Subject: Re: [Cbe-oss-dev] [PATCH] cell: cbe_cpufreq cleanup and crash fix

From: Akinobu Mita <[email-masked]>
Date: Fri, 27 Apr 2007 14:22:06 +0900

On Thu, Apr 26, 2007 at 06:07:54PM -0500, Olof Johansson wrote:
> @@ -303,6 +303,9 @@ static int __init cbe_cpufreq_init(void)
>  {
>  	struct device_node *np;
>  
> +	if (!machine_is(cell))
> +		return 0;
> +

Please return -ENODEV to prevent loading module.

Otherwise it will cause crash when unloading the module
because of cpufreq_unregister_driver() with unregistered driver.

> @@ -315,7 +318,7 @@ static int __init cbe_cpufreq_init(void)
>  
>  static void __exit cbe_cpufreq_exit(void)
>  {
> -	if(pmi_dev)
> +	if (pmi_dev)
>  		pmi_unregister_handler(pmi_dev, &cbe_pmi_handler);
>  
>  	cpufreq_unregister_driver(&cbe_cpufreq_driver);