[2/2] SH: cpuidle: use init/exit common routine

Message ID 1366728077-18988-2-git-send-email-daniel.lezcano@linaro.org
State New
Headers show

Commit Message

Daniel Lezcano April 23, 2013, 2:41 p.m.
Remove the duplicated code and use the cpuidle common code for initialization.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 arch/sh/kernel/cpu/shmobile/cpuidle.c |    7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

Comments

Simon Horman April 24, 2013, 6:02 a.m. | #1
On Tue, Apr 23, 2013 at 04:41:17PM +0200, Daniel Lezcano wrote:
> Remove the duplicated code and use the cpuidle common code for initialization.
> 
> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>

Acked-by: Simon Horman <horms+renesas@verge.net.au>

> ---
>  arch/sh/kernel/cpu/shmobile/cpuidle.c |    7 +------
>  1 file changed, 1 insertion(+), 6 deletions(-)
> 
> diff --git a/arch/sh/kernel/cpu/shmobile/cpuidle.c b/arch/sh/kernel/cpu/shmobile/cpuidle.c
> index fdfe57f4..d306225 100644
> --- a/arch/sh/kernel/cpu/shmobile/cpuidle.c
> +++ b/arch/sh/kernel/cpu/shmobile/cpuidle.c
> @@ -51,7 +51,6 @@ static int cpuidle_sleep_enter(struct cpuidle_device *dev,
>  	return k;
>  }
>  
> -static struct cpuidle_device cpuidle_dev;
>  static struct cpuidle_driver cpuidle_driver = {
>  	.name   = "sh_idle",
>  	.owner  = THIS_MODULE,
> @@ -100,9 +99,5 @@ int __init sh_mobile_setup_cpuidle(void)
>  	if (sh_mobile_sleep_supported & SUSP_SH_STANDBY)
>  		cpuidle_driver.states[2].disabled = false;
>  
> -	ret = cpuidle_register_driver(&cpuidle_driver);
> -	if (ret)
> -		return ret;
> -
> -	return cpuidle_register_device(&cpuidle_dev);
> +	return cpuidle_register(&cpuidle_driver);
>  }
> -- 
> 1.7.9.5
>
Rafael J. Wysocki April 24, 2013, 12:08 p.m. | #2
On Wednesday, April 24, 2013 03:02:15 PM Simon Horman wrote:
> On Tue, Apr 23, 2013 at 04:41:17PM +0200, Daniel Lezcano wrote:
> > Remove the duplicated code and use the cpuidle common code for initialization.
> > 
> > Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
> 
> Acked-by: Simon Horman <horms+renesas@verge.net.au>

Applied.

Thanks,
Rafael


> > ---
> >  arch/sh/kernel/cpu/shmobile/cpuidle.c |    7 +------
> >  1 file changed, 1 insertion(+), 6 deletions(-)
> > 
> > diff --git a/arch/sh/kernel/cpu/shmobile/cpuidle.c b/arch/sh/kernel/cpu/shmobile/cpuidle.c
> > index fdfe57f4..d306225 100644
> > --- a/arch/sh/kernel/cpu/shmobile/cpuidle.c
> > +++ b/arch/sh/kernel/cpu/shmobile/cpuidle.c
> > @@ -51,7 +51,6 @@ static int cpuidle_sleep_enter(struct cpuidle_device *dev,
> >  	return k;
> >  }
> >  
> > -static struct cpuidle_device cpuidle_dev;
> >  static struct cpuidle_driver cpuidle_driver = {
> >  	.name   = "sh_idle",
> >  	.owner  = THIS_MODULE,
> > @@ -100,9 +99,5 @@ int __init sh_mobile_setup_cpuidle(void)
> >  	if (sh_mobile_sleep_supported & SUSP_SH_STANDBY)
> >  		cpuidle_driver.states[2].disabled = false;
> >  
> > -	ret = cpuidle_register_driver(&cpuidle_driver);
> > -	if (ret)
> > -		return ret;
> > -
> > -	return cpuidle_register_device(&cpuidle_dev);
> > +	return cpuidle_register(&cpuidle_driver);
> >  }
> --
> To unsubscribe from this list: send the line "unsubscribe linux-pm" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/arch/sh/kernel/cpu/shmobile/cpuidle.c b/arch/sh/kernel/cpu/shmobile/cpuidle.c
index fdfe57f4..d306225 100644
--- a/arch/sh/kernel/cpu/shmobile/cpuidle.c
+++ b/arch/sh/kernel/cpu/shmobile/cpuidle.c
@@ -51,7 +51,6 @@  static int cpuidle_sleep_enter(struct cpuidle_device *dev,
 	return k;
 }
 
-static struct cpuidle_device cpuidle_dev;
 static struct cpuidle_driver cpuidle_driver = {
 	.name   = "sh_idle",
 	.owner  = THIS_MODULE,
@@ -100,9 +99,5 @@  int __init sh_mobile_setup_cpuidle(void)
 	if (sh_mobile_sleep_supported & SUSP_SH_STANDBY)
 		cpuidle_driver.states[2].disabled = false;
 
-	ret = cpuidle_register_driver(&cpuidle_driver);
-	if (ret)
-		return ret;
-
-	return cpuidle_register_device(&cpuidle_dev);
+	return cpuidle_register(&cpuidle_driver);
 }