Date: Thu, 11 Jun 1998 18:19:28 -0700 (PDT)
From: Michael Schmitz <SCHMITZ@LCBVAX.CCHEM.BERKELEY.EDU>
To: linux-m68k@lists.linux-m68k.org
CC: linux-mac68k@wave.lm.com
Subject: L68K: 2.1.101+: patch for duplicate kbd_reset_setup
Sender: owner-linux-m68k@phil.uni-sb.de

Hi,

compiling 2.1.101 for Mac alone, or for Atari+Amiga+whatever fails with 
missing / duplicate symbol kbd_reset_setup (defined in drivers/char/amikeyb.c
and arch/m68k/atari/atakeyb.c only, so far). Kudos to Geert Stappers for
pointing that out to me.

I suggest to make kbd_reset_setup a function pointer (like many of the machine 
dependent functions already) as implemented in the diff below, or to remove 
that function from the machine dependent drivers and place it in
arch/m68k/kernel/setup.c - it's doing nothing right now, anyway. 

I hope the __initdata handling is correct; can someone please check this? 
Comments?
                                
Jes: the mackeyb.c diff contains a few unrelated source makeup changes, apply
those to your tree if possible. Just to shut up some warnings ...

	Michael


--- linux-2.1.101/arch/m68k/amiga/config.c.org	Wed Jun 10 23:48:33 1998
+++ linux-2.1.101/arch/m68k/amiga/config.c	Wed Jun 10 23:48:21 1998
@@ -51,6 +51,7 @@
 /* amiga specific keyboard functions */
 extern int amiga_keyb_init(void);
 extern int amiga_kbdrate (struct kbd_repeat *);
+extern void amiga_kbd_reset_setup(char*, int);
 /* amiga specific irq functions */
 extern void amiga_init_IRQ (void);
 extern void (*amiga_default_handler[]) (int, void *, struct pt_regs *);
@@ -342,6 +343,7 @@
   mach_sched_init      = amiga_sched_init;
   mach_keyb_init       = amiga_keyb_init;
   mach_kbdrate         = amiga_kbdrate;
+  kbd_reset_setup      = amiga_kbd_reset_setup;
   mach_init_IRQ        = amiga_init_IRQ;
   mach_default_handler = &amiga_default_handler;
   mach_request_irq     = amiga_request_irq;
--- linux-2.1.101/arch/m68k/atari/atakeyb.c.org	Wed Jun 10 23:14:35 1998
+++ linux-2.1.101/arch/m68k/atari/atakeyb.c	Wed Jun 10 23:15:06 1998
@@ -864,6 +864,6 @@
 }
 
 /* for "kbd-reset" cmdline param */
-__initfunc(void kbd_reset_setup(char *str, int *ints))
+__initfunc(void atari_kbd_reset_setup(char *str, int *ints))
 {
 }
--- linux-2.1.101/arch/m68k/atari/config.c.org	Wed Jun 10 23:38:10 1998
+++ linux-2.1.101/arch/m68k/atari/config.c	Wed Jun 10 23:37:49 1998
@@ -59,6 +59,7 @@
 extern int atari_keyb_init(void);
 extern int atari_kbdrate (struct kbd_repeat *);
 extern void atari_kbd_leds (unsigned int);
+extern void atari_kbd_reset_setup(char*, int);
 /* atari specific irq functions */
 extern void atari_init_IRQ (void);
 extern int atari_request_irq (unsigned int irq, void (*handler)(int, void *, struct pt_regs *),
@@ -249,6 +250,7 @@
     mach_keyb_init       = atari_keyb_init;
     mach_kbdrate         = atari_kbdrate;
     mach_kbd_leds        = atari_kbd_leds;
+    kbd_reset_setup      = atari_kbd_reset_setup;
     mach_init_IRQ        = atari_init_IRQ;
     mach_request_irq     = atari_request_irq;
     mach_free_irq        = atari_free_irq;
--- linux-2.1.101/arch/m68k/kernel/setup.c.org	Wed Jun 10 23:17:51 1998
+++ linux-2.1.101/arch/m68k/kernel/setup.c	Wed Jun 10 23:24:22 1998
@@ -61,6 +61,8 @@
 int (*mach_keyb_init) (void) __initdata;
 int (*mach_kbdrate) (struct kbd_repeat *) = NULL;
 void (*mach_kbd_leds) (unsigned int) = NULL;
+/* machine dependent "kbd-reset" setup function */
+void (*kbd_reset_setup) (char *, int) __initdata = NULL;
 /* machine dependent irq functions */
 void (*mach_init_IRQ) (void) __initdata;
 void (*(*mach_default_handler)[]) (int, void *, struct pt_regs *) = NULL;
--- linux-2.1.101/arch/m68k/mac/mackeyb.c.org	Wed Jun 10 23:15:47 1998
+++ linux-2.1.101/arch/m68k/mac/mackeyb.c	Wed Jun 10 23:17:33 1998
@@ -750,3 +750,8 @@
 
 	return 0;
 }
+
+/* for "kbd-reset" cmdline param */
+__initfunc(void mac_kbd_reset_setup(char *str, int *ints))
+{
+}
--- linux-2.1.101/arch/m68k/mac/config.c.org	Wed Jun 10 23:24:45 1998
+++ linux-2.1.101/arch/m68k/mac/config.c	Thu Jun 11 00:01:21 1998
@@ -61,23 +61,40 @@
 /* The phys. video addr. - might be bogus on some machines */
 unsigned long mac_orig_videoaddr;
 
+/* Mac specific keyboard functions */
 extern int mac_keyb_init(void);
 extern int mac_kbdrate(struct kbd_repeat *k);
 extern void mac_kbd_leds(unsigned int leds);
+extern void mac_kbd_reset_setup(char*, int);
+
+/* Mac specific irq functions */
+extern void mac_init_IRQ (void);
+extern void (*mac_handlers[]) (int, void *, struct pt_regs *);
+extern int mac_request_irq (unsigned int irq,
+			    void (*handler)(int, void *, struct pt_regs *),
+                            unsigned long flags, const char *devname,
+			    void *dev_id);
+extern void mac_free_irq (unsigned int irq, void *dev_id);
+extern void mac_enable_irq (unsigned int);
+extern void mac_disable_irq (unsigned int);
+static void mac_get_model(char *model);
+/*static int mac_get_hardware_list(char *buffer);*/
+extern int mac_get_irq_list (char *);
+
+/* Mac specific timer functions */
+extern void mac_gettod (int *, int *, int *, int *, int *, int *);
+extern void via_init_clock(void (*func)(int, void *, struct pt_regs *));
 
 extern void (*kd_mksound)(unsigned int, unsigned int);
 extern void mac_mksound(unsigned int, unsigned int);
 extern int mac_floppy_init(void);
 extern void mac_floppy_setup(char *,int *);
 
-extern void mac_gettod (int *, int *, int *, int *, int *, int *);
-
 extern void nubus_sweep_video(void);
-extern void via_init_clock(void (*func)(int, void *, struct pt_regs *));
-extern void mac_debugging_long(int, long);
 
 /* Mac specific debug functions (in debug.c) */
 extern void mac_debug_init(void);
+extern void mac_debugging_long(int, long);
 
 #ifdef CONFIG_MAGIC_SYSRQ
 
@@ -259,6 +276,7 @@
     mach_keyb_init       = mac_keyb_init;
     mach_kbdrate         = mac_kbdrate;
     mach_kbd_leds        = mac_kbd_leds;
+    kbd_reset_setup      = mac_kbd_reset_setup;
     mach_init_IRQ        = mac_init_IRQ;
     mach_request_irq     = mac_request_irq;
     mach_free_irq        = mac_free_irq;
@@ -496,7 +514,7 @@
 	 * Report booter data:
 	 */
 	printk (" Penguin bootinfo data:\n");
-	printk (" Video: addr 0x%lx row 0x%lx depth %lx dimensions %d x %d\n", 
+	printk (" Video: addr 0x%lx row 0x%lx depth %lx dimensions %ld x %ld\n", 
 		mac_bi_data.videoaddr, mac_bi_data.videorow, 
 		mac_bi_data.videodepth, mac_bi_data.dimensions & 0xFFFF, 
 		mac_bi_data.dimensions >> 16); 
--- linux-2.1.101/drivers/char/amikeyb.c.org	Wed Jun 10 23:12:25 1998
+++ linux-2.1.101/drivers/char/amikeyb.c	Wed Jun 10 23:12:44 1998
@@ -343,6 +343,6 @@
 }
 
 /* for "kbd-reset" cmdline param */
-__initfunc(void kbd_reset_setup(char *str, int *ints))
+__initfunc(void amiga_kbd_reset_setup(char *str, int *ints))
 {
 }
--- linux-2.1.101/include/asm-m68k/machdep.h.org	Wed Jun 10 23:34:59 1998
+++ linux-2.1.101/include/asm-m68k/machdep.h	Wed Jun 10 23:32:48 1998
@@ -13,6 +13,7 @@
 extern int (*mach_keyb_init) (void);
 extern int (*mach_kbdrate) (struct kbd_repeat *);
 extern void (*mach_kbd_leds) (unsigned int);
+extern void (*kbd_reset_setup) (char *, int);
 /* machine dependent irq functions */
 extern void (*mach_init_IRQ) (void);
 extern void (*(*mach_default_handler)[]) (int, void *, struct pt_regs *);
