Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 33470 Details for
Bug 47947
slmodem-2.9.9 (was slmodem-2.9.6 half-ebuild)
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
sysfs patch for 2.9.8
sysfs-for-slmodem-2.9.8.patch (text/plain), 6.23 KB, created by
Simon Cooper
on 2004-06-18 02:56:15 UTC
(
hide
)
Description:
sysfs patch for 2.9.8
Filename:
MIME Type:
Creator:
Simon Cooper
Created:
2004-06-18 02:56:15 UTC
Size:
6.23 KB
patch
obsolete
>diff -urNp slmodem-2.9.8.old/drivers/amrmo_init.c slmodem-2.9.8/drivers/amrmo_init.c >--- slmodem-2.9.8.old/drivers/amrmo_init.c 2004-06-18 10:11:29.944170992 +0100 >+++ slmodem-2.9.8/drivers/amrmo_init.c 2004-06-18 10:20:40.045542872 +0100 >@@ -54,6 +54,7 @@ > #include <linux/fs.h> > #include <asm/uaccess.h> > #include <linux/devfs_fs_kernel.h> >+#include <linux/device.h> > > #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) > #define OLD_KERNEL 1 >@@ -270,6 +271,7 @@ MODULE_DEVICE_TABLE (pci, amrmo_pci_tbl) > > > static struct amrmo_struct *amrmo_table[MAXNUM] = {}; >+static struct class_simple *amrmo_class; > > > /* >@@ -613,6 +615,8 @@ static int __init amrmo_pci_probe(struct > } > #endif > #else >+ printk(KERN_INFO "clamr: creating sysfs device with major %d minor %d/n", AMRMO_MAJOR, i); >+ class_simple_device_add(amrmo_class, MKDEV(AMRMO_MAJOR, i), NULL, "slamr%d", i); > devfs_mk_cdev(MKDEV(AMRMO_MAJOR,i), S_IFCHR|S_IRUSR|S_IWUSR, "slamr%d", i); > #endif > return 0; >@@ -644,6 +648,8 @@ static void __exit amrmo_pci_remove(stru > } > #endif > #else >+ printk(KERN_INFO "slamr: removing sysfs node with major %d and minor %d\n", AMRMO_MAJOR, amrmo->num); >+ class_simple_device_remove(MKDEV(AMRMO_MAJOR, amrmo->num)); > devfs_remove("slamr%d", amrmo->num); > #endif > amrmo_table[amrmo->num] = NULL; >@@ -722,6 +728,17 @@ static int __init amrmo_init(void) > } > } > >+ /* must create class_simple before the bus gets probed */ >+#ifndef OLD_KERNEL >+ printk(KERN_INFO "slamr: creating simple class\n"); >+ amrmo_class = class_simple_create(THIS_MODULE, "slamr"); >+ if (IS_ERR(amrmo_class)) { >+ int err = PTR_ERR(amrmo_class); >+ printk(KERN_INFO "slamr: failure creating simple class, error %d\n", err); >+ return err; >+ } >+#endif >+ > if (!pci_register_driver(&amrmo_pci_driver)) { > pci_unregister_driver(&amrmo_pci_driver); > return -ENODEV; >@@ -737,6 +754,10 @@ static int __init amrmo_init(void) > static void __exit amrmo_exit(void) > { > AMRMO_DBG("slamr: exit...\n"); >+#ifndef OLD_KERNEL >+ printk(KERN_INFO "slamr: destroying simple class\n"); >+ class_simple_destroy(amrmo_class); >+#endif > unregister_chrdev(AMRMO_MAJOR,"slamr"); > pci_unregister_driver(&amrmo_pci_driver); > } >diff -urNp slmodem-2.9.8.old/drivers/old_st7554.c slmodem-2.9.8/drivers/old_st7554.c >--- slmodem-2.9.8.old/drivers/old_st7554.c 2004-06-18 10:11:29.944170992 +0100 >+++ slmodem-2.9.8/drivers/old_st7554.c 2004-06-18 10:29:19.037644080 +0100 >@@ -55,6 +55,7 @@ > #include <linux/poll.h> > #include <linux/usb.h> > #include <linux/devfs_fs_kernel.h> >+#include <linux/device.h> > > #include <modem_defs.h> > >@@ -73,6 +74,10 @@ > > #define MY_MAJOR 213 > >+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) >+#define OLD_KERNEL 1 >+#endif >+ > static int debug = 0; > MODULE_PARM(debug,"i"); > MODULE_PARM_DESC(debug,"Debug level: 0-3 (default=0)"); >@@ -201,6 +206,7 @@ struct st7554_state { > > > static struct st7554_state *st7554_table[MAX_MODEMS]; >+static struct class_simple *st7554_class; > > static DECLARE_MUTEX(open_sem); > >@@ -1299,6 +1305,11 @@ static void *st7554_probe(struct usb_dev > mo_free(s); mi_free(s); > goto error1; > } >+ >+#ifndef OLD_KERNEL >+ class_simple_device_add(st7554_class, MKDEV(MY_MAJOR, s->minor), NULL, "slusb%d", i); >+#endif >+ > #ifdef CONFIG_DEVFS_FS > { > char buf[8]; >@@ -1333,6 +1344,11 @@ static void st7554_disconnect(struct usb > s->file->private_data = NULL; > s->file = NULL; > } >+ >+#ifndef OLD_KERNEL >+ class_simple_device_remove(MKDEV(MY_MAJOR, s->minor)); >+#endif >+ > #ifdef CONFIG_DEVFS_FS > { > char buf[8]; >@@ -1371,6 +1387,17 @@ static int __init st7554_modem_init(void > usb_deregister(&st7554_usb_driver); > return -ENOMEM; > } >+ >+#ifndef OLD_KERNEL >+ st7554_class = class_simple_create(THIS_MODULE, "slusb"); >+ if (IS_ERR(st7554_class)) { >+ USB_ERR("failed to create sysfs class\n"); >+ usb_deregister(&st7554_usb_driver); >+ unregister_chrdev(MY_MAJOR, "slusb"); >+ return PTR_ERR(st7554_class); >+ } >+#endif >+ > return 0; > } > >@@ -1378,6 +1405,9 @@ static int __init st7554_modem_init(void > static void __exit st7554_modem_exit(void) > { > USB_DBG ("st7554: exit...\n"); >+#ifndef OLD_KERNEL >+ class_simple_destroy(st7554_class); >+#endif > unregister_chrdev(MY_MAJOR,"slusb"); > usb_deregister(&st7554_usb_driver); > } >diff -urNp slmodem-2.9.8.old/drivers/st7554.c slmodem-2.9.8/drivers/st7554.c >--- slmodem-2.9.8.old/drivers/st7554.c 2004-06-18 10:11:29.943171144 +0100 >+++ slmodem-2.9.8/drivers/st7554.c 2004-06-18 10:46:47.712221312 +0100 >@@ -55,6 +55,7 @@ > #include <linux/poll.h> > #include <linux/usb.h> > #include <linux/devfs_fs_kernel.h> >+#include <linux/device.h> > > #include <modem_defs.h> > >@@ -67,6 +68,10 @@ > #define DEBUG_URB_PRINT 0 > #define USB_DBG_URB(fmt...) // USB_DBG(fmt) > >+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) >+#define OLD_KERNEL 1 >+#endif >+ > static int debug = 0; > MODULE_PARM(debug,"i"); > MODULE_PARM_DESC(debug,"Debug level: 0-3 (default=0)"); >@@ -205,6 +210,7 @@ struct st7554_state { > > > static struct st7554_state *st7554_table[MAX_MODEMS] = {}; >+static struct class_simple *st7554_class; > > static DECLARE_MUTEX(open_sem); > >@@ -1275,6 +1281,9 @@ static int st7554_probe(struct usb_inter > } > > usb_set_intfdata(interface, s ); >+#ifndef OLD_KERNEL >+ class_simple_device_add(st7554_class, MKDEV(213, i), NULL, "slusb%d", i); >+#endif > devfs_mk_cdev(MKDEV(213,i),S_IFCHR|S_IRUSR|S_IWUSR,"slusb%d",i); > > USB_INFO(KERN_INFO "slusb: slusb%d is found.\n", s->minor); >@@ -1303,6 +1312,9 @@ static void st7554_disconnect(struct usb > return; > } > >+#ifndef OLD_KERNEL >+ class_simple_device_remove(MKDEV(213, s->minor)); >+#endif > devfs_remove("slusb%d",s->minor); > > st7554_stop(s); >@@ -1344,6 +1356,16 @@ static int __init st7554_modem_init(void > usb_deregister(&st7554_usb_driver); > return -ENOMEM; > } >+#ifndef OLD_KERNEL >+ st7554_class = class_simple_create(THIS_MODULE, "slusb"); >+ if (IS_ERR(st7554_class)) { >+ USB_ERR("failed to create sysfs class\n"); >+ usb_deregister(&st7554_usb_driver); >+ unregister_chrdev(213, "slusb"); >+ return PTR_ERR(st7554_class); >+ } >+#endif >+ > return 0; > } > >@@ -1351,6 +1373,9 @@ static int __init st7554_modem_init(void > static void __exit st7554_modem_exit(void) > { > USB_DBG ("st7554: exit...\n"); >+#ifndef OLD_KERNEL >+ class_simple_destroy(st7554_class); >+#endif > unregister_chrdev(213,"slusb"); > usb_deregister(&st7554_usb_driver); > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 47947
:
29356
|
29623
|
29625
|
29738
|
29739
|
29740
|
29741
|
29742
|
29743
|
32292
|
32293
|
32775
|
32916
|
32917
|
33400
|
33431
|
33432
|
33468
|
33470
|
33516