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);
+ }
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;
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));