* [BK PATCH] Driver core changes for 2.5.69
@ 2003-05-09 23:51 Greg KH
2003-05-09 23:53 ` [PATCH] " Greg KH
0 siblings, 1 reply; 4+ messages in thread
From: Greg KH @ 2003-05-09 23:51 UTC (permalink / raw)
To: torvalds; +Cc: linux-kernel
Hi,
Here are three small changesets that fix up some stuff in the driver
class code. They do the following:
- restore back the driver link in the sysfs class representation
that I removed based on my previous class changes.
- fix the cpu frequency code to work properly again (I messed up
when porting it to the new class code.)
- remove an unneeded line in the class code.
Please pull from: bk://kernel.bkbits.net/gregkh/linux/class-2.5
thanks,
greg k-h
drivers/base/class.c | 18 +++++++++++++++++-
include/linux/cpu.h | 1 +
kernel/cpufreq.c | 2 ++
3 files changed, 20 insertions(+), 1 deletion(-)
-----
Greg Kroah-Hartman:
o driver core: remove unneeded line in class code
o driver core: Add driver symlink to class devices in sysfs
Jonathan Corbet:
o cpufreq class fix
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH] Driver core changes for 2.5.69
2003-05-09 23:51 [BK PATCH] Driver core changes for 2.5.69 Greg KH
@ 2003-05-09 23:53 ` Greg KH
2003-05-09 23:53 ` Greg KH
0 siblings, 1 reply; 4+ messages in thread
From: Greg KH @ 2003-05-09 23:53 UTC (permalink / raw)
To: linux-kernel
ChangeSet 1.1096, 2003/05/09 16:25:57-07:00, corbet@lwn.net
[PATCH] cpufreq class fix
include/linux/cpu.h | 1 +
kernel/cpufreq.c | 2 ++
2 files changed, 3 insertions(+)
diff -Nru a/include/linux/cpu.h b/include/linux/cpu.h
--- a/include/linux/cpu.h Fri May 9 16:40:39 2003
+++ b/include/linux/cpu.h Fri May 9 16:40:39 2003
@@ -29,6 +29,7 @@
};
extern int register_cpu(struct cpu *, int, struct node *);
+extern struct class cpu_class;
/* Stop CPUs going up and down. */
extern struct semaphore cpucontrol;
diff -Nru a/kernel/cpufreq.c b/kernel/cpufreq.c
--- a/kernel/cpufreq.c Fri May 9 16:40:39 2003
+++ b/kernel/cpufreq.c Fri May 9 16:40:39 2003
@@ -22,6 +22,7 @@
#include <linux/spinlock.h>
#include <linux/device.h>
#include <linux/slab.h>
+#include <linux/cpu.h>
/**
* The "cpufreq driver" - the arch- or hardware-dependend low
@@ -115,6 +116,7 @@
extern struct device_class cpu_devclass;
static struct class_interface cpufreq_interface = {
+ .class = &cpu_class,
.add = &cpufreq_add_dev,
.remove = &cpufreq_remove_dev,
};
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Driver core changes for 2.5.69
2003-05-09 23:53 ` [PATCH] " Greg KH
@ 2003-05-09 23:53 ` Greg KH
2003-05-09 23:54 ` Greg KH
0 siblings, 1 reply; 4+ messages in thread
From: Greg KH @ 2003-05-09 23:53 UTC (permalink / raw)
To: linux-kernel
ChangeSet 1.1097, 2003/05/09 16:26:28-07:00, greg@kroah.com
[PATCH] driver core: Add driver symlink to class devices in sysfs.
Thanks to Mike Anderson for the idea for this.
drivers/base/class.c | 17 +++++++++++++++++
1 files changed, 17 insertions(+)
diff -Nru a/drivers/base/class.c b/drivers/base/class.c
--- a/drivers/base/class.c Fri May 9 16:40:29 2003
+++ b/drivers/base/class.c Fri May 9 16:40:29 2003
@@ -133,6 +133,21 @@
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_attr(_attr) container_of(_attr,struct class_device_attribute,attr)
@@ -265,6 +280,7 @@
}
class_device_dev_link(class_dev);
+ class_device_driver_link(class_dev);
register_done:
if (error && parent)
@@ -298,6 +314,7 @@
if (class_dev->dev) {
class_device_dev_unlink(class_dev);
+ class_device_driver_unlink(class_dev);
put_device(class_dev->dev);
}
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Driver core changes for 2.5.69
2003-05-09 23:53 ` Greg KH
@ 2003-05-09 23:54 ` Greg KH
0 siblings, 0 replies; 4+ messages in thread
From: Greg KH @ 2003-05-09 23:54 UTC (permalink / raw)
To: linux-kernel
ChangeSet 1.1098, 2003/05/09 16:26:48-07:00, greg@kroah.com
[PATCH] driver core: remove unneeded line in class code.
Thanks to Jonathan Corbet for pointing this out.
drivers/base/class.c | 1 -
1 files changed, 1 deletion(-)
diff -Nru a/drivers/base/class.c b/drivers/base/class.c
--- a/drivers/base/class.c Fri May 9 16:40:17 2003
+++ b/drivers/base/class.c Fri May 9 16:40:17 2003
@@ -259,7 +259,6 @@
/* first, register with generic layer. */
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);
if (parent)
class_dev->kobj.parent = &parent->subsys.kset.kobj;
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2003-05-09 23:41 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-05-09 23:51 [BK PATCH] Driver core changes for 2.5.69 Greg KH
2003-05-09 23:53 ` [PATCH] " Greg KH
2003-05-09 23:53 ` Greg KH
2003-05-09 23:54 ` Greg KH
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox