- unregister_chrdev(ifxmips_gpio_major, "ifxmips_gpio");
- remove_proc_entry("ifxmips_gpio", NULL);
+ unregister_chrdev(ifxmips_gpio_major, DRVNAME);
+ remove_proc_entry(DRVNAME, NULL);
+
+ return 0;
+}
+
+static struct
+platform_driver ifxmips_gpio_driver = {
+ .probe = ifxmips_gpio_probe,
+ .remove = ifxmips_gpio_remove,
+ .driver = {
+ .name = DRVNAME,
+ .owner = THIS_MODULE,
+ },
+};
+
+int __init
+ifxmips_gpio_init (void)
+{
+ int ret = platform_driver_register(&ifxmips_gpio_driver);
+ if (ret)
+ printk(KERN_INFO DRVNAME ": Error registering platfom driver!");
+ return ret;
+}
+
+void __exit
+ifxmips_gpio_exit (void)
+{
+ platform_driver_unregister(&ifxmips_gpio_driver);