- printk(KERN_INFO "serio: C&T 82c710 mouse port at %#x irq %d\n",
- ct82c710_data, CT82C710_IRQ);
+static struct platform_driver ct82c710_driver = {
+ .driver = {
+ .name = "ct82c710",
+ .owner = THIS_MODULE,
+ },
+ .probe = ct82c710_probe,
+ .remove = __devexit_p(ct82c710_remove),
+};
+
+
+static int __init ct82c710_init(void)
+{
+ int error;
+
+ error = ct82c710_detect();
+ if (error)
+ return error;
+
+ error = platform_driver_register(&ct82c710_driver);
+ if (error)
+ return error;
+
+ ct82c710_device = platform_device_alloc("ct82c710", -1);
+ if (!ct82c710_device) {
+ error = -ENOMEM;
+ goto err_unregister_driver;
+ }
+
+ error = platform_device_add_resources(ct82c710_device, &ct82c710_iores, 1);
+ if (error)
+ goto err_free_device;
+
+ error = platform_device_add(ct82c710_device);
+ if (error)
+ goto err_free_device;
+
+ serio_register_port(ct82c710_port);
+
+ printk(KERN_INFO "serio: C&T 82c710 mouse port at %#lx irq %d\n",
+ CT82C710_DATA, CT82C710_IRQ);