static int __devexit vain_plat_remove(struct platform_device *pdev) { struct vain_plat_info *info = platform_get_drvdata(pdev); struct resource *res; res = platform_get_resource(pdev, IORESOURCE_MEM, 0); iounmap(info->base); release_mem_region(res->start, resource_size(res)); platform_set_drvdata(pdev, NULL); kfree (info); return 0; } static const struct of_device_id vain_match[] = { { .compatible = "example,vain", }, { /* end of table */ } }; static struct platform_driver vain_plat_driver = { .driver = { .name = "vain_plat", .owner = THIS_MODULE, .of_match_table = vain_match, }, .probe = vain_plat_probe, .remove = __devexit_p(vain_plat_remove), };