Path: blob/master/drivers/message/i2o/config-osm.c
15111 views
/*1* Configuration OSM2*3* Copyright (C) 2005 Markus Lidel <[email protected]>4*5* This program is free software; you can redistribute it and/or modify it6* under the terms of the GNU General Public License as published by the7* Free Software Foundation; either version 2 of the License, or (at your8* option) any later version.9*10* Fixes/additions:11* Markus Lidel <[email protected]>12* initial version.13*/1415#include <linux/module.h>16#include <linux/i2o.h>17#include <linux/dcache.h>18#include <linux/namei.h>19#include <linux/fs.h>2021#include <asm/uaccess.h>2223#define OSM_NAME "config-osm"24#define OSM_VERSION "1.323"25#define OSM_DESCRIPTION "I2O Configuration OSM"2627/* access mode user rw */28#define S_IWRSR (S_IRUSR | S_IWUSR)2930static struct i2o_driver i2o_config_driver;3132/* Config OSM driver struct */33static struct i2o_driver i2o_config_driver = {34.name = OSM_NAME,35};3637#ifdef CONFIG_I2O_CONFIG_OLD_IOCTL38#include "i2o_config.c"39#endif4041/**42* i2o_config_init - Configuration OSM initialization function43*44* Registers Configuration OSM in the I2O core and if old ioctl's are45* compiled in initialize them.46*47* Returns 0 on success or negative error code on failure.48*/49static int __init i2o_config_init(void)50{51printk(KERN_INFO OSM_DESCRIPTION " v" OSM_VERSION "\n");5253if (i2o_driver_register(&i2o_config_driver)) {54osm_err("handler register failed.\n");55return -EBUSY;56}57#ifdef CONFIG_I2O_CONFIG_OLD_IOCTL58if (i2o_config_old_init()) {59osm_err("old config handler initialization failed\n");60i2o_driver_unregister(&i2o_config_driver);61return -EBUSY;62}63#endif6465return 0;66}6768/**69* i2o_config_exit - Configuration OSM exit function70*71* If old ioctl's are compiled in exit remove them and unregisters72* Configuration OSM from I2O core.73*/74static void i2o_config_exit(void)75{76#ifdef CONFIG_I2O_CONFIG_OLD_IOCTL77i2o_config_old_exit();78#endif7980i2o_driver_unregister(&i2o_config_driver);81}8283MODULE_AUTHOR("Markus Lidel <[email protected]>");84MODULE_LICENSE("GPL");85MODULE_DESCRIPTION(OSM_DESCRIPTION);86MODULE_VERSION(OSM_VERSION);8788module_init(i2o_config_init);89module_exit(i2o_config_exit);909192