예제 #1
0
static int uevent_filter(struct kset *kset, struct kobject *kobj)
{
	struct kobj_type *ktype = get_ktype(kobj);

	if (ktype == &module_ktype)
		return 1;
	return 0;
}
예제 #2
0
파일: core.c 프로젝트: kzlin129/tt-gpl
static int dev_hotplug_filter(struct kset *kset, struct kobject *kobj)
{
	struct kobj_type *ktype = get_ktype(kobj);

	if (ktype == &ktype_device) {
		struct device *dev = to_dev(kobj);
		if (dev->bus)
			return 1;
	}
	return 0;
}
예제 #3
0
static int block_hotplug(struct kset *kset, struct kobject *kobj, char **envp,
			 int num_envp, char *buffer, int buffer_size)
{
	struct device *dev = NULL;
	struct kobj_type *ktype = get_ktype(kobj);
	int length = 0;
	int i = 0;

	/* get physical device backing disk or partition */
	if (ktype == &ktype_block) {
		struct gendisk *disk = container_of(kobj, struct gendisk, kobj);
		dev = disk->driverfs_dev;
	} else if (ktype == &ktype_part) {
예제 #4
0
static int block_hotplug(struct kset *kset, struct kobject *kobj, char **envp,
			 int num_envp, char *buffer, int buffer_size)
{
	struct kobj_type *ktype = get_ktype(kobj);
	struct device *physdev;
	struct gendisk *disk;
	struct hd_struct *part;
	int length = 0;
	int i = 0;

	if (ktype == &ktype_block) {
		disk = container_of(kobj, struct gendisk, kobj);
		add_hotplug_env_var(envp, num_envp, &i, buffer, buffer_size,
				    &length, "MINOR=%u", disk->first_minor);
	} else if (ktype == &ktype_part) {
예제 #5
0
static int block_hotplug_filter(struct kset *kset, struct kobject *kobj)
{
	struct kobj_type *ktype = get_ktype(kobj);

	return ((ktype == &ktype_block) || (ktype == &ktype_part));
}
예제 #6
0
static int recovery_button_hotplug_filter(struct kset* kset, struct kobject* kobj) {
	return get_ktype(kobj) == &ktype_recovery_button;
}
예제 #7
0
파일: power_button.c 프로젝트: aircross/ray
static int power_button_hotplug_filter(struct kset* kset, struct kobject* kobj) {
	return get_ktype(kobj) == &ktype_power_button;
}