diff -u ./Makefile ../zaptelrtc.dea/Makefile --- ./Makefile 2003-05-02 11:00:05.000000000 -0700 +++ ../zaptelrtc.dea/Makefile 2004-01-16 18:25:59.000000000 -0700 @@ -1,4 +1,4 @@ -KINCLUDES = /usr/src/linux/include +KINCLUDES = /usr/src/linux-2.6/include ZAP=$(shell [ -f ../zaptel/zaptel.h ] && echo "-I../zaptel") ifeq (${ZAP},) @@ -20,6 +20,11 @@ OBJS=zaprtc.o rtctest rtcsetup +obj-m:= zaprtc.o + +linux26: zaprtc.o + make -C /usr/src/linux-2.6 SUBDIRS=$(PWD) modules + all: $(OBJS) sync diff -u ./zaprtc.c ../zaptelrtc.dea/zaprtc.c --- ./zaprtc.c 2003-05-11 05:27:26.000000000 -0700 +++ ../zaptelrtc.dea/zaprtc.c 2004-01-17 09:32:57.493766616 -0700 @@ -42,6 +42,7 @@ * 1.10c Cesar Barros: SMP locking fixes and cleanup * 1.10d Paul Gortmaker: delete paranoia check in rtc_exit * 1.10e Maciej W. Rozycki: Handle DECstation's year weirdness. + * 1.20 Dan Austin: updated to Kernel 2.6 irq and build conventions */ #define RTC_VERSION "1.10e" @@ -69,6 +70,8 @@ #include #include #include +#include +#include #include #include @@ -91,7 +94,7 @@ unsigned int ticks; } rtc_zt_rtc; -struct rtc_zt_rtc rtc_zt; +static struct rtc_zt_rtc rtc_zt; static int rtc_has_irq = 1; @@ -181,6 +184,19 @@ return 0; } +static int rtc_zt_exit(void) { + + if (zt_unregister(&rtc_zt.span)) { + printk(KERN_CRIT "unable to unregister zaptel device!\n"); + return -1; + } + else { + printk(KERN_CRIT "Unregistered zaptel device!\n"); + return 0; + } +} + + /* * A very tiny interrupt handler. It runs with SA_INTERRUPT set, * but there is possibility of conflicting with the set_rtc_mmss() @@ -191,7 +207,11 @@ * (See ./arch/XXXX/kernel/time.c for the set_rtc_mmss() function.) */ +#ifdef LINUX26 +static irqreturn_t rtc_interrupt(int irq, void *dev_id, struct pt_regs +*regs) #else static void rtc_interrupt(int irq, void *dev_id, struct pt_regs *regs) +#endif { /* * Can be an alarm interrupt, update complete interrupt, @@ -227,6 +247,10 @@ wake_up_interruptible(&rtc_wait); kill_fasync (&rtc_async_queue, SIGIO, POLL_IN); +#ifdef LINUX26 + return IRQ_HANDLED; +#endif + } #endif @@ -886,6 +910,7 @@ static void __exit rtc_exit (void) { + rtc_zt_exit(); cleanup_sysctl(); remove_proc_entry ("driver/rtc", NULL); misc_deregister(&rtc_dev); @@ -904,7 +929,6 @@ module_init(rtc_init); module_exit(rtc_exit); -EXPORT_NO_SYMBOLS; #if RTC_IRQ