Commit 0774aa2d authored by Linus Torvalds's avatar Linus Torvalds

Merge master.kernel.org:/home/gregkh/BK/i2c-2.5

into home.transmeta.com:/home/torvalds/v2.5/linux
parents 04c8dca9 3e3122a7
...@@ -133,6 +133,21 @@ static void class_device_dev_unlink(struct class_device * class_dev) ...@@ -133,6 +133,21 @@ static void class_device_dev_unlink(struct class_device * class_dev)
sysfs_remove_link(&class_dev->kobj, "device"); sysfs_remove_link(&class_dev->kobj, "device");
} }
static int class_device_driver_link(struct class_device * class_dev)
{
if ((class_dev->dev) && (class_dev->dev->driver))
return sysfs_create_link(&class_dev->kobj,
&class_dev->dev->driver->kobj, "driver");
return 0;
}
static void class_device_driver_unlink(struct class_device * class_dev)
{
if ((class_dev->dev) && (class_dev->dev->driver))
sysfs_remove_link(&class_dev->kobj, "driver");
}
#define to_class_dev(obj) container_of(obj,struct class_device,kobj) #define to_class_dev(obj) container_of(obj,struct class_device,kobj)
#define to_class_dev_attr(_attr) container_of(_attr,struct class_device_attribute,attr) #define to_class_dev_attr(_attr) container_of(_attr,struct class_device_attribute,attr)
...@@ -244,7 +259,6 @@ int class_device_add(struct class_device *class_dev) ...@@ -244,7 +259,6 @@ int class_device_add(struct class_device *class_dev)
/* first, register with generic layer. */ /* first, register with generic layer. */
strncpy(class_dev->kobj.name, class_dev->class_id, KOBJ_NAME_LEN); strncpy(class_dev->kobj.name, class_dev->class_id, KOBJ_NAME_LEN);
kobj_set_kset_s(class_dev, class_subsys);
kobj_set_kset_s(class_dev, class_obj_subsys); kobj_set_kset_s(class_dev, class_obj_subsys);
if (parent) if (parent)
class_dev->kobj.parent = &parent->subsys.kset.kobj; class_dev->kobj.parent = &parent->subsys.kset.kobj;
...@@ -265,6 +279,7 @@ int class_device_add(struct class_device *class_dev) ...@@ -265,6 +279,7 @@ int class_device_add(struct class_device *class_dev)
} }
class_device_dev_link(class_dev); class_device_dev_link(class_dev);
class_device_driver_link(class_dev);
register_done: register_done:
if (error && parent) if (error && parent)
...@@ -298,6 +313,7 @@ void class_device_del(struct class_device *class_dev) ...@@ -298,6 +313,7 @@ void class_device_del(struct class_device *class_dev)
if (class_dev->dev) { if (class_dev->dev) {
class_device_dev_unlink(class_dev); class_device_dev_unlink(class_dev);
class_device_driver_unlink(class_dev);
put_device(class_dev->dev); put_device(class_dev->dev);
} }
......
...@@ -29,6 +29,7 @@ struct cpu { ...@@ -29,6 +29,7 @@ struct cpu {
}; };
extern int register_cpu(struct cpu *, int, struct node *); extern int register_cpu(struct cpu *, int, struct node *);
extern struct class cpu_class;
/* Stop CPUs going up and down. */ /* Stop CPUs going up and down. */
extern struct semaphore cpucontrol; extern struct semaphore cpucontrol;
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#include <linux/spinlock.h> #include <linux/spinlock.h>
#include <linux/device.h> #include <linux/device.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/cpu.h>
/** /**
* The "cpufreq driver" - the arch- or hardware-dependend low * The "cpufreq driver" - the arch- or hardware-dependend low
...@@ -115,6 +116,7 @@ static void cpufreq_remove_dev (struct class_device * dev); ...@@ -115,6 +116,7 @@ static void cpufreq_remove_dev (struct class_device * dev);
extern struct device_class cpu_devclass; extern struct device_class cpu_devclass;
static struct class_interface cpufreq_interface = { static struct class_interface cpufreq_interface = {
.class = &cpu_class,
.add = &cpufreq_add_dev, .add = &cpufreq_add_dev,
.remove = &cpufreq_remove_dev, .remove = &cpufreq_remove_dev,
}; };
......
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