From: Dmitry Torokhov Date: Sun, 2 Apr 2006 05:08:05 +0000 (-0500) Subject: Manual merge with Linus. X-Git-Tag: v2.6.17-rc1~15^2~6 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=95d465fd750897ab32462a6702fbfe1b122cbbc0;p=linux-2.6 Manual merge with Linus. Conflicts: arch/powerpc/kernel/setup-common.c drivers/input/keyboard/hil_kbd.c drivers/input/mouse/hil_ptr.c --- 95d465fd750897ab32462a6702fbfe1b122cbbc0 diff --cc arch/powerpc/kernel/setup-common.c index fc89d009d1,c607f3b9ca..1d93e73a70 --- a/arch/powerpc/kernel/setup-common.c +++ b/arch/powerpc/kernel/setup-common.c @@@ -471,25 -462,33 +463,56 @@@ static int __init early_xmon(char *p early_param("xmon", early_xmon); #endif +static __init int add_pcspkr(void) +{ + struct device_node *np; + struct platform_device *pd; + int ret; + + np = of_find_compatible_node(NULL, NULL, "pnpPNP,100"); + of_node_put(np); + if (!np) + return -ENODEV; + + pd = platform_device_alloc("pcspkr", -1); + if (!pd) + return -ENOMEM; + + ret = platform_device_add(pd); + if (ret) + platform_device_put(pd); + + return ret; +} +device_initcall(add_pcspkr); ++ + void probe_machine(void) + { + extern struct machdep_calls __machine_desc_start; + extern struct machdep_calls __machine_desc_end; + + /* + * Iterate all ppc_md structures until we find the proper + * one for the current machine type + */ + DBG("Probing machine type ...\n"); + + for (machine_id = &__machine_desc_start; + machine_id < &__machine_desc_end; + machine_id++) { + DBG(" %s ...", machine_id->name); + memcpy(&ppc_md, machine_id, sizeof(struct machdep_calls)); + if (ppc_md.probe()) { + DBG(" match !\n"); + break; + } + DBG("\n"); + } + /* What can we do if we didn't find ? */ + if (machine_id >= &__machine_desc_end) { + DBG("No suitable machine found !\n"); + for (;;); + } + + printk(KERN_INFO "Using %s machine description\n", ppc_md.name); + } diff --cc drivers/input/keyboard/hil_kbd.c index ed3271b714,63f387e4b7..1dca3cf42a --- a/drivers/input/keyboard/hil_kbd.c +++ b/drivers/input/keyboard/hil_kbd.c @@@ -250,12 -250,16 +250,19 @@@ static int hil_kbd_connect(struct seri struct hil_kbd *kbd; uint8_t did, *idd; int i; -- ++ kbd = kzalloc(sizeof(*kbd), GFP_KERNEL); if (!kbd) return -ENOMEM; - if (serio_open(serio, drv)) goto bail0; + kbd->dev = input_allocate_device(); - if (!kbd->dev) goto bail1; ++ if (!kbd->dev) ++ goto bail0; ++ + kbd->dev->private = kbd; + - if (serio_open(serio, drv)) goto bail0; ++ if (serio_open(serio, drv)) ++ goto bail1; serio_set_drvdata(serio, kbd); kbd->serio = serio; diff --cc drivers/input/mouse/hil_ptr.c index 798f4a3ad7,bfb564fd8f..69f02178c5 --- a/drivers/input/mouse/hil_ptr.c +++ b/drivers/input/mouse/hil_ptr.c @@@ -248,12 -248,14 +248,17 @@@ static int hil_ptr_connect(struct seri if (!(ptr = kzalloc(sizeof(struct hil_ptr), GFP_KERNEL))) return -ENOMEM; - if (serio_open(serio, driver)) + ptr->dev = input_allocate_device(); - if (!ptr->dev) goto bail0; ++ if (!ptr->dev) + goto bail0; + + ptr->dev->private = ptr; + - if (serio_open(serio, driver)) goto bail1; ++ if (serio_open(serio, driver)) ++ goto bail1; + serio_set_drvdata(serio, ptr); ptr->serio = serio; - ptr->dev.private = ptr; init_MUTEX_LOCKED(&(ptr->sem));