Commit 0d613f5c authored by Patrick Mochel's avatar Patrick Mochel

Merge osdl.org:/home/mochel/src/kernel/devel/linux-2.5-virgin

into osdl.org:/home/mochel/src/kernel/devel/linux-2.5-core
parents 1bc211f1 3072d52b
...@@ -281,19 +281,19 @@ unsigned long get_cmos_time(void) ...@@ -281,19 +281,19 @@ unsigned long get_cmos_time(void)
return retval; return retval;
} }
static struct sysdev_class rtc_sysclass = { static struct sysdev_class pit_sysclass = {
set_kset_name("rtc"), set_kset_name("pit"),
}; };
/* XXX this driverfs stuff should probably go elsewhere later -john */ /* XXX this driverfs stuff should probably go elsewhere later -john */
static struct sys_device device_i8253 = { static struct sys_device device_i8253 = {
.id = 0, .id = 0,
.cls = &rtc_sysclass, .cls = &pit_sysclass,
}; };
static int time_init_device(void) static int time_init_device(void)
{ {
int error = sysdev_class_register(&rtc_sysclass); int error = sysdev_class_register(&pit_sysclass);
if (!error) if (!error)
error = sys_device_register(&device_i8253); error = sys_device_register(&device_i8253);
return error; return error;
......
...@@ -218,9 +218,6 @@ void sys_device_unregister(struct sys_device * sysdev) ...@@ -218,9 +218,6 @@ void sys_device_unregister(struct sys_device * sysdev)
if (drv->remove) if (drv->remove)
drv->remove(sysdev); drv->remove(sysdev);
} }
list_del_init(&sysdev->entry);
up_write(&system_subsys.rwsem); up_write(&system_subsys.rwsem);
kobject_unregister(&sysdev->kobj); kobject_unregister(&sysdev->kobj);
......
...@@ -72,7 +72,6 @@ struct sys_device { ...@@ -72,7 +72,6 @@ struct sys_device {
u32 id; u32 id;
struct sysdev_class * cls; struct sysdev_class * cls;
struct kobject kobj; struct kobject kobj;
struct list_head entry;
}; };
extern int sys_device_register(struct sys_device *); extern int sys_device_register(struct sys_device *);
......
...@@ -100,6 +100,9 @@ static void fill_kobj_path(struct kset *kset, struct kobject *kobj, char *path, ...@@ -100,6 +100,9 @@ static void fill_kobj_path(struct kset *kset, struct kobject *kobj, char *path,
#define BUFFER_SIZE 1024 /* should be enough memory for the env */ #define BUFFER_SIZE 1024 /* should be enough memory for the env */
#define NUM_ENVP 32 /* number of env pointers */ #define NUM_ENVP 32 /* number of env pointers */
static unsigned long sequence_num;
static spinlock_t sequence_lock = SPIN_LOCK_UNLOCKED;
static void kset_hotplug(const char *action, struct kset *kset, static void kset_hotplug(const char *action, struct kset *kset,
struct kobject *kobj) struct kobject *kobj)
{ {
...@@ -112,6 +115,7 @@ static void kset_hotplug(const char *action, struct kset *kset, ...@@ -112,6 +115,7 @@ static void kset_hotplug(const char *action, struct kset *kset,
int kobj_path_length; int kobj_path_length;
char *kobj_path = NULL; char *kobj_path = NULL;
char *name = NULL; char *name = NULL;
unsigned long seq;
/* If the kset has a filter operation, call it. If it returns /* If the kset has a filter operation, call it. If it returns
failure, no hotplug event is required. */ failure, no hotplug event is required. */
...@@ -152,6 +156,13 @@ static void kset_hotplug(const char *action, struct kset *kset, ...@@ -152,6 +156,13 @@ static void kset_hotplug(const char *action, struct kset *kset,
envp [i++] = scratch; envp [i++] = scratch;
scratch += sprintf(scratch, "ACTION=%s", action) + 1; scratch += sprintf(scratch, "ACTION=%s", action) + 1;
spin_lock(&sequence_lock);
seq = sequence_num++;
spin_unlock(&sequence_lock);
envp [i++] = scratch;
scratch += sprintf(scratch, "SEQNUM=%ld", seq) + 1;
kobj_path_length = get_kobj_path_length (kset, kobj); kobj_path_length = get_kobj_path_length (kset, kobj);
kobj_path = kmalloc (kobj_path_length, GFP_KERNEL); kobj_path = kmalloc (kobj_path_length, GFP_KERNEL);
if (!kobj_path) if (!kobj_path)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment