Download | Plain Text | No Line Numbers
- #include <linux/kernel.h>
- #include <linux/module.h>
- #include <linux/init.h>
- #include <linux/sysfs.h>
- #include <linux/pci.h>
-
- #define MEGASAS_RELDATE "Aug. 31, 2013"
-
- static ssize_t show_release_date(struct device_driver *dd, char *buf)
- {
- }
-
- static DRIVER_ATTR(release_date, S_IRUGO, show_release_date, NULL);
-
- static struct pci_driver *pdrv = NULL;
-
- static int __init dell_omsa_megasas_init(void)
- {
- int ret;
- struct pci_dev *pdev = NULL;
-
- request_module("megaraid_sas");
-
- for_each_pci_dev(pdev) {
- struct pci_driver *tmp = pci_dev_driver(pdev);
- pdrv = tmp;
- break;
- };
- }
-
- if (!pdrv) {
- printk(KERN_ERR "dell_omsa_megasas: module megaraid_sas not loaded\n");
- return -1;
- }
-
- ret = driver_create_file(&pdrv->driver, &driver_attr_release_date);
- if (ret)
- goto attr_failed;
- return 0;
-
- attr_failed:
- return ret;
- }
-
- static void __exit dell_omsa_megasas_exit(void)
- {
- if (pdrv)
- driver_remove_file(&pdrv->driver, &driver_attr_release_date);
- }
-
- module_init(dell_omsa_megasas_init);
- module_exit(dell_omsa_megasas_exit);
-
- MODULE_LICENSE("GPL");
- MODULE_AUTHOR("Manuel Mausz <manuel@mausz.at>");
-