You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
52 lines
1.3 KiB
52 lines
1.3 KiB
13 years ago
|
#include <linux/kernel.h>
|
||
|
#include <linux/module.h>
|
||
12 years ago
|
#include <linux/of.h>
|
||
13 years ago
|
|
||
|
#include "notifier-error-inject.h"
|
||
|
|
||
|
static int priority;
|
||
|
module_param(priority, int, 0);
|
||
12 years ago
|
MODULE_PARM_DESC(priority, "specify OF reconfig notifier priority");
|
||
13 years ago
|
|
||
|
static struct notifier_err_inject reconfig_err_inject = {
|
||
|
.actions = {
|
||
12 years ago
|
{ NOTIFIER_ERR_INJECT_ACTION(OF_RECONFIG_ATTACH_NODE) },
|
||
|
{ NOTIFIER_ERR_INJECT_ACTION(OF_RECONFIG_DETACH_NODE) },
|
||
|
{ NOTIFIER_ERR_INJECT_ACTION(OF_RECONFIG_ADD_PROPERTY) },
|
||
|
{ NOTIFIER_ERR_INJECT_ACTION(OF_RECONFIG_REMOVE_PROPERTY) },
|
||
|
{ NOTIFIER_ERR_INJECT_ACTION(OF_RECONFIG_UPDATE_PROPERTY) },
|
||
13 years ago
|
{}
|
||
|
}
|
||
|
};
|
||
|
|
||
|
static struct dentry *dir;
|
||
|
|
||
|
static int err_inject_init(void)
|
||
|
{
|
||
|
int err;
|
||
|
|
||
12 years ago
|
dir = notifier_err_inject_init("OF-reconfig",
|
||
13 years ago
|
notifier_err_inject_dir, &reconfig_err_inject, priority);
|
||
|
if (IS_ERR(dir))
|
||
|
return PTR_ERR(dir);
|
||
|
|
||
12 years ago
|
err = of_reconfig_notifier_register(&reconfig_err_inject.nb);
|
||
13 years ago
|
if (err)
|
||
|
debugfs_remove_recursive(dir);
|
||
|
|
||
|
return err;
|
||
|
}
|
||
|
|
||
|
static void err_inject_exit(void)
|
||
|
{
|
||
12 years ago
|
of_reconfig_notifier_unregister(&reconfig_err_inject.nb);
|
||
13 years ago
|
debugfs_remove_recursive(dir);
|
||
|
}
|
||
|
|
||
|
module_init(err_inject_init);
|
||
|
module_exit(err_inject_exit);
|
||
|
|
||
12 years ago
|
MODULE_DESCRIPTION("OF reconfig notifier error injection module");
|
||
13 years ago
|
MODULE_LICENSE("GPL");
|
||
|
MODULE_AUTHOR("Akinobu Mita <akinobu.mita@gmail.com>");
|