Skip to contentSkip to conversation

Device support for basic device

PATCH Pavel Machek 1 participant 1 message Apr 18, 2002

lore
Share & tools
lore
#0 lore raw

Hi!

This adds support for devicefs for i8259.c and time.c. Please apply,

Pavel

arch/i386/kernel/i8259.c +13 -0
@@ -11,6 +11,7 @@
 #include <linux/smp_lock.h>
 #include <linux/init.h>
 #include <linux/kernel_stat.h>
+#include <linux/device.h>
 
 #include <asm/atomic.h>
 #include <asm/system.h>
@@ -236,6 +237,18 @@
 		goto handle_real_irq;
 	}
 }
+
+static struct device device_i8259A = {
+	name:	       	"i8259A",
+	bus_id:		"0020",
+};
+
+static void __init init_8259A_devicefs(void)
+{
+	register_sys_device(&device_i8259A);
+}
+
+__initcall(init_8259A_devicefs);
 
 void __init init_8259A(int auto_eoi)
 {
arch/i386/kernel/time.c +12 -0
@@ -42,6 +42,7 @@
 #include <linux/init.h>
 #include <linux/smp.h>
 #include <linux/module.h>
+#include <linux/device.h>
 
 #include <asm/io.h>
 #include <asm/smp.h>
@@ -635,6 +636,17 @@
 bad_ctc:
 	return 0;
 }
+
+static struct device device_i8253;
+
+static void time_init_driverfs(void)
+{
+	strcpy(device_i8253.name, "i8253");
+	strcpy(device_i8253.bus_id, "0040");
+	register_sys_device(&device_i8253);
+}
+
+__initcall(time_init_driverfs);
 
 void __init time_init(void)
 {
Signature · 2 lines
(about SSSCA) "I don't say this lightly.  However, I really think that the U.S.
no longer is classifiable as a democracy, but rather as a plutocracy." --hpa