[PATCH] powerpc timer sysdev: use mktime

Johannes Berg johannes at sipsolutions.net
Thu May 24 01:28:01 EST 2007


On Wed, 2007-05-02 at 16:25 +0200, Johannes Berg wrote:
> This patch makes the timer sysdev use mktime instead of rtc_tm_to_time
> by simply copying the function to avoid using rtc-lib.

I think you asked for this, any reason you then didn't take it? Just
missed? Or is something wrong with it?

> Signed-off-by: Johannes Berg <johannes at sipsolutions.net>
> 
> --- wireless-dev.orig/arch/powerpc/sysdev/timer.c	2007-05-02 16:16:52.639177080 +0200
> +++ wireless-dev/arch/powerpc/sysdev/timer.c	2007-05-02 16:21:56.429177080 +0200
> @@ -24,7 +24,12 @@ static int timer_resume(struct sys_devic
>  
>  	/* get current RTC time and convert to seconds */
>  	get_rtc_time(&cur_rtc_tm);
> -	rtc_tm_to_time(&cur_rtc_tm, &cur_rtc_time);
> +	cur_rtc_time = mktime(cur_rtc_tm.tm_year + 1900,
> +			      cur_rtc_tm.tm_mon + 1,
> +			      cur_rtc_tm.tm_mday,
> +			      cur_rtc_tm.tm_hour,
> +			      cur_rtc_tm.tm_min,
> +			      cur_rtc_tm.tm_sec);
>  
>  	diff = cur_rtc_time - suspend_rtc_time;
>  
> @@ -44,7 +49,12 @@ static int timer_suspend(struct sys_devi
>  	WARN_ON(!ppc_md.get_rtc_time);
>  
>  	get_rtc_time(&suspend_rtc_tm);
> -	rtc_tm_to_time(&suspend_rtc_tm, &suspend_rtc_time);
> +	suspend_rtc_time = mktime(suspend_rtc_tm.tm_year + 1900,
> +				  suspend_rtc_tm.tm_mon + 1,
> +				  suspend_rtc_tm.tm_mday,
> +				  suspend_rtc_tm.tm_hour,
> +				  suspend_rtc_tm.tm_min,
> +				  suspend_rtc_tm.tm_sec);
>  
>  	return 0;
>  }
> --- wireless-dev.orig/arch/powerpc/Kconfig	2007-05-02 16:22:07.619177080 +0200
> +++ wireless-dev/arch/powerpc/Kconfig	2007-05-02 16:22:12.759177080 +0200
> @@ -11,11 +11,6 @@ config PPC64
>  	  This option selects whether a 32-bit or a 64-bit kernel
>  	  will be built.
>  
> -config PPC_PM_NEEDS_RTC_LIB
> -	bool
> -	select RTC_LIB
> -	default y if PM
> -
>  config PPC32
>  	bool
>  	default y if !PPC64
> 
> 
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev at ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-dev
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part
URL: <http://lists.ozlabs.org/pipermail/linuxppc-dev/attachments/20070523/0dcb05a8/attachment.pgp>


More information about the Linuxppc-dev mailing list