ChangeSet 1.1587.5.24, 2004/05/11 14:31:21-07:00, hannal@us.ibm.com [PATCH] Add class support to drivers/net/wan/cosa.c This patch adds sysfs class support to the Cosa driver. I have verified it compiles but do not have the hardware to test it. If someone could that would be helpful. drivers/net/wan/cosa.c | 41 ++++++++++++++++++++++++++++++++++------- 1 files changed, 34 insertions(+), 7 deletions(-) diff -Nru a/drivers/net/wan/cosa.c b/drivers/net/wan/cosa.c --- a/drivers/net/wan/cosa.c Fri May 14 15:56:57 2004 +++ b/drivers/net/wan/cosa.c Fri May 14 15:56:57 2004 @@ -93,6 +93,7 @@ #include #include #include +#include #undef COSA_SLOW_IO /* for testing purposes only */ #undef REALLY_SLOW_IO @@ -233,6 +234,9 @@ /* IRQ can be safely autoprobed */ static int irq[MAX_CARDS+1] = { -1, -1, -1, -1, -1, -1, 0, }; +/* for class stuff*/ +static struct class_simple *cosa_class; + #ifdef MODULE MODULE_PARM(io, "1-" __MODULE_STRING(MAX_CARDS) "i"); MODULE_PARM_DESC(io, "The I/O bases of the COSA or SRP cards"); @@ -359,7 +363,7 @@ static int __init cosa_init(void) { - int i; + int i, err = 0; printk(KERN_INFO "cosa v1.08 (c) 1997-2000 Jan Kasprzak \n"); #ifdef CONFIG_SMP @@ -369,12 +373,14 @@ if (register_chrdev(cosa_major, "cosa", &cosa_fops)) { printk(KERN_WARNING "cosa: unable to get major %d\n", cosa_major); - return -EIO; + err = -EIO; + goto out; } } else { if (!(cosa_major=register_chrdev(0, "cosa", &cosa_fops))) { printk(KERN_WARNING "cosa: unable to register chardev\n"); - return -EIO; + err = -EIO; + goto out; } } for (i=0; i