summaryrefslogtreecommitdiffstats
path: root/target/linux/etrax/patches-2.6.30/620-create-the-i2c-devices.patch
blob: 9c2e37ae982e6598f6ec97288b672a9096b15c2f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
--- a/arch/cris/arch-v10/drivers/i2c.c
+++ b/arch/cris/arch-v10/drivers/i2c.c
@@ -21,6 +21,7 @@
 #include <linux/fs.h>
 #include <linux/string.h>
 #include <linux/init.h>
+#include <linux/device.h>
 
 #include <asm/etraxi2c.h>
 
@@ -678,6 +679,8 @@ i2c_init(void)
 	return res;
 }
 
+static struct class *i2c_class;
+
 static int __init
 i2c_register(void)
 {
@@ -693,7 +696,11 @@ i2c_register(void)
 	}
 
 	printk(KERN_INFO "I2C driver v2.2, (c) 1999-2004 Axis Communications AB\n");
-	
+
+	i2c_class = class_create(THIS_MODULE, "i2c_etrax");
+	device_create(i2c_class, NULL,
+		MKDEV(I2C_MAJOR, 0), NULL, "i2c");
+
 	return 0;
 }