linux-cvs-patches
[Top] [All Lists]

CVS Update@linux-mips.org: linux

To: linux-cvs-patches@linux-mips.org
Subject: CVS Update@linux-mips.org: linux
From: ralf@linux-mips.org
Date: Thu, 01 Sep 2005 21:42:53 +0100
Reply-to: linux-mips@linux-mips.org
Sender: linux-cvs-patches-bounce@linux-mips.org
CVSROOT:        /home/cvs
Module name:    linux
Changes by:     ralf@ftp.linux-mips.org 05/09/01 21:42:46

Modified files:
        arch/mips/kernel: Makefile 
        include/asm-mips: rtc.h 
Removed files:
        arch/mips/kernel: genrtc.c 

Log message:
        Move genrtc.c's functions into <asm/rtc.h>

diff -urN linux/arch/mips/kernel/Makefile linux/arch/mips/kernel/Makefile
--- linux/arch/mips/kernel/Makefile     2005/08/17 17:44:09     1.92
+++ linux/arch/mips/kernel/Makefile     2005/09/01 20:42:46     1.93
@@ -59,8 +59,6 @@
 
 obj-$(CONFIG_64BIT)            += cpu-bugs64.o
 
-obj-$(CONFIG_GEN_RTC)          += genrtc.o
-
 CFLAGS_cpu-bugs64.o    = $(shell if $(CC) $(CFLAGS) -Wa,-mdaddi -c -o 
/dev/null -xc /dev/null >/dev/null 2>&1; then echo "-DHAVE_AS_SET_DADDI"; fi)
 CFLAGS_ioctl32.o       += -Ifs/
 
diff -urN linux/arch/mips/kernel/genrtc.c linux/arch/mips/kernel/genrtc.c
--- linux/arch/mips/kernel/Attic/genrtc.c       2005-09-01 21:42:46.332293000 
+0100     1.3
+++ linux/arch/mips/kernel/Attic/genrtc.c       1970/01/01 00:00:00+0100
@@ -1,64 +0,0 @@
-/*
- * A glue layer that provides RTC read/write to drivers/char/genrtc.c driver
- * based on MIPS internal RTC routines.  It does take care locking
- * issues so that we are SMP/Preemption safe.
- *
- * Copyright (C) 2004 MontaVista Software Inc.
- * Author: Jun Sun, jsun@mvista.com or jsun@junsun.net
- *
- * Please read the COPYING file for all license details.
- */
-
-#include <linux/spinlock.h>
-
-#include <asm/rtc.h>
-#include <asm/time.h>
-
-static DEFINE_SPINLOCK(mips_rtc_lock);
-
-unsigned int get_rtc_time(struct rtc_time *time)
-{
-       unsigned long nowtime;
-
-       spin_lock(&mips_rtc_lock);
-       nowtime = rtc_get_time();
-       to_tm(nowtime, time);
-       time->tm_year -= 1900;
-       spin_unlock(&mips_rtc_lock);
-
-       return RTC_24H;
-}
-
-int set_rtc_time(struct rtc_time *time)
-{
-       unsigned long nowtime;
-       int ret;
-
-       spin_lock(&mips_rtc_lock);
-       nowtime = mktime(time->tm_year+1900, time->tm_mon+1,
-                       time->tm_mday, time->tm_hour, time->tm_min,
-                       time->tm_sec);
-       ret = rtc_set_time(nowtime);
-       spin_unlock(&mips_rtc_lock);
-
-       return ret;
-}
-
-unsigned int get_rtc_ss(void)
-{
-       struct rtc_time h;
-
-       get_rtc_time(&h);
-       return h.tm_sec;
-}
-
-int get_rtc_pll(struct rtc_pll_info *pll)
-{
-       return -EINVAL;
-}
-
-int set_rtc_pll(struct rtc_pll_info *pll)
-{
-       return -EINVAL;
-}
-
diff -urN linux/include/asm-mips/rtc.h linux/include/asm-mips/rtc.h
--- linux/include/asm-mips/rtc.h        2005/07/11 10:03:32     1.3
+++ linux/include/asm-mips/rtc.h        2005/09/01 20:42:46     1.4
@@ -14,7 +14,9 @@
 
 #ifdef __KERNEL__
 
+#include <linux/spinlock.h>
 #include <linux/rtc.h>
+#include <asm/time.h>
 
 #define RTC_PIE 0x40            /* periodic interrupt enable */
 #define RTC_AIE 0x20            /* alarm interrupt enable */
@@ -33,5 +35,52 @@
 int get_rtc_pll(struct rtc_pll_info *pll);
 int set_rtc_pll(struct rtc_pll_info *pll);
 
+static DEFINE_SPINLOCK(mips_rtc_lock);
+
+static inline unsigned int get_rtc_time(struct rtc_time *time)
+{
+       unsigned long nowtime;
+
+       spin_lock(&mips_rtc_lock);
+       nowtime = rtc_get_time();
+       to_tm(nowtime, time);
+       time->tm_year -= 1900;
+       spin_unlock(&mips_rtc_lock);
+
+       return RTC_24H;
+}
+
+static inline int set_rtc_time(struct rtc_time *time)
+{
+       unsigned long nowtime;
+       int ret;
+
+       spin_lock(&mips_rtc_lock);
+       nowtime = mktime(time->tm_year+1900, time->tm_mon+1,
+                       time->tm_mday, time->tm_hour, time->tm_min,
+                       time->tm_sec);
+       ret = rtc_set_time(nowtime);
+       spin_unlock(&mips_rtc_lock);
+
+       return ret;
+}
+
+static inline unsigned int get_rtc_ss(void)
+{
+       struct rtc_time h;
+
+       get_rtc_time(&h);
+       return h.tm_sec;
+}
+
+static inline int get_rtc_pll(struct rtc_pll_info *pll)
+{
+       return -EINVAL;
+}
+
+static inline int set_rtc_pll(struct rtc_pll_info *pll)
+{
+       return -EINVAL;
+}
 #endif
 #endif

<Prev in Thread] Current Thread [Next in Thread>