0001
0002
0003
0004
0005
0006
0007
0008
0009 #define KMSG_COMPONENT "hmcdrv"
0010 #define pr_fmt(fmt) KMSG_COMPONENT ": " fmt
0011
0012 #include <linux/kernel.h>
0013 #include <linux/module.h>
0014 #include <linux/moduleparam.h>
0015 #include <linux/stat.h>
0016
0017 #include "hmcdrv_ftp.h"
0018 #include "hmcdrv_dev.h"
0019 #include "hmcdrv_cache.h"
0020
0021 MODULE_LICENSE("GPL");
0022 MODULE_AUTHOR("Copyright 2013 IBM Corporation");
0023 MODULE_DESCRIPTION("HMC drive DVD access");
0024
0025
0026
0027
0028 static size_t hmcdrv_mod_cachesize = HMCDRV_CACHE_SIZE_DFLT;
0029 module_param_named(cachesize, hmcdrv_mod_cachesize, ulong, S_IRUGO);
0030
0031
0032
0033
0034 static int __init hmcdrv_mod_init(void)
0035 {
0036 int rc = hmcdrv_ftp_probe();
0037
0038 if (rc)
0039 return rc;
0040
0041 rc = hmcdrv_cache_startup(hmcdrv_mod_cachesize);
0042
0043 if (rc)
0044 return rc;
0045
0046 rc = hmcdrv_dev_init();
0047
0048 if (rc)
0049 hmcdrv_cache_shutdown();
0050
0051 return rc;
0052 }
0053
0054
0055
0056
0057 static void __exit hmcdrv_mod_exit(void)
0058 {
0059 hmcdrv_dev_exit();
0060 hmcdrv_cache_shutdown();
0061 }
0062
0063 module_init(hmcdrv_mod_init);
0064 module_exit(hmcdrv_mod_exit);