.. | .. |
---|
47 | 47 | static u32 mtd_erase_size; |
---|
48 | 48 | static const char *vendor_mtd_name = "vnvm"; |
---|
49 | 49 | static struct mtd_nand_info nand_info; |
---|
| 50 | +static struct platform_device *g_pdev; |
---|
50 | 51 | |
---|
51 | 52 | static int mtd_vendor_nand_write(void) |
---|
52 | 53 | { |
---|
.. | .. |
---|
419 | 420 | |
---|
420 | 421 | g_idb_buffer = NULL; |
---|
421 | 422 | ret = platform_driver_register(&vendor_storage_driver); |
---|
| 423 | + if (ret) |
---|
| 424 | + return ret; |
---|
422 | 425 | |
---|
423 | 426 | pdev = platform_device_register_simple("mtd_vendor_storage", |
---|
424 | 427 | -1, NULL, 0); |
---|
.. | .. |
---|
426 | 429 | platform_driver_unregister(&vendor_storage_driver); |
---|
427 | 430 | return PTR_ERR(pdev); |
---|
428 | 431 | } |
---|
| 432 | + g_pdev = pdev; |
---|
429 | 433 | |
---|
430 | 434 | return ret; |
---|
431 | 435 | } |
---|
432 | 436 | |
---|
| 437 | +static __exit void vendor_storage_deinit(void) |
---|
| 438 | +{ |
---|
| 439 | + platform_device_unregister(g_pdev); |
---|
| 440 | + platform_driver_unregister(&vendor_storage_driver); |
---|
| 441 | +} |
---|
| 442 | + |
---|
433 | 443 | device_initcall_sync(vendor_storage_init); |
---|
| 444 | +module_exit(vendor_storage_deinit); |
---|
| 445 | +MODULE_LICENSE("GPL"); |
---|