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

From: [email-masked] (Olof Johansson)
Date: Fri, 27 Apr 2007 00:32:20 -0500

On Fri, Apr 27, 2007 at 02:22:06PM +0900, Akinobu Mita wrote:
> 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.

It won't crash due to the checks in cpufreq_unregister_driver(), but
it's still better to return failure.

Thanks,

-Olof