diff options
author | gregkh@suse.de <gregkh@suse.de> | 2005-03-23 13:01:41 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2005-06-20 18:15:09 -0400 |
commit | 56b2293595b2eb52cc2aa2baf92c6cfa8265f9d5 (patch) | |
tree | 5cbada5b35b1b87dfd75852c9397a2b14dfbb9d9 /drivers/net | |
parent | 8874b414ffe037c39e73bb262ddf69653a13c0a4 (diff) |
[PATCH] class: convert drivers/* to use the new class api instead of class_simple
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/ppp_generic.c | 14 | ||||
-rw-r--r-- | drivers/net/wan/cosa.c | 12 |
2 files changed, 13 insertions, 13 deletions
diff --git a/drivers/net/ppp_generic.c b/drivers/net/ppp_generic.c index ad4b58af6b76..ab726ab43798 100644 --- a/drivers/net/ppp_generic.c +++ b/drivers/net/ppp_generic.c | |||
@@ -273,7 +273,7 @@ static int ppp_connect_channel(struct channel *pch, int unit); | |||
273 | static int ppp_disconnect_channel(struct channel *pch); | 273 | static int ppp_disconnect_channel(struct channel *pch); |
274 | static void ppp_destroy_channel(struct channel *pch); | 274 | static void ppp_destroy_channel(struct channel *pch); |
275 | 275 | ||
276 | static struct class_simple *ppp_class; | 276 | static struct class *ppp_class; |
277 | 277 | ||
278 | /* Translates a PPP protocol number to a NP index (NP == network protocol) */ | 278 | /* Translates a PPP protocol number to a NP index (NP == network protocol) */ |
279 | static inline int proto_to_npindex(int proto) | 279 | static inline int proto_to_npindex(int proto) |
@@ -858,12 +858,12 @@ static int __init ppp_init(void) | |||
858 | printk(KERN_INFO "PPP generic driver version " PPP_VERSION "\n"); | 858 | printk(KERN_INFO "PPP generic driver version " PPP_VERSION "\n"); |
859 | err = register_chrdev(PPP_MAJOR, "ppp", &ppp_device_fops); | 859 | err = register_chrdev(PPP_MAJOR, "ppp", &ppp_device_fops); |
860 | if (!err) { | 860 | if (!err) { |
861 | ppp_class = class_simple_create(THIS_MODULE, "ppp"); | 861 | ppp_class = class_create(THIS_MODULE, "ppp"); |
862 | if (IS_ERR(ppp_class)) { | 862 | if (IS_ERR(ppp_class)) { |
863 | err = PTR_ERR(ppp_class); | 863 | err = PTR_ERR(ppp_class); |
864 | goto out_chrdev; | 864 | goto out_chrdev; |
865 | } | 865 | } |
866 | class_simple_device_add(ppp_class, MKDEV(PPP_MAJOR, 0), NULL, "ppp"); | 866 | class_device_create(ppp_class, MKDEV(PPP_MAJOR, 0), NULL, "ppp"); |
867 | err = devfs_mk_cdev(MKDEV(PPP_MAJOR, 0), | 867 | err = devfs_mk_cdev(MKDEV(PPP_MAJOR, 0), |
868 | S_IFCHR|S_IRUSR|S_IWUSR, "ppp"); | 868 | S_IFCHR|S_IRUSR|S_IWUSR, "ppp"); |
869 | if (err) | 869 | if (err) |
@@ -876,8 +876,8 @@ out: | |||
876 | return err; | 876 | return err; |
877 | 877 | ||
878 | out_class: | 878 | out_class: |
879 | class_simple_device_remove(MKDEV(PPP_MAJOR,0)); | 879 | class_device_destroy(ppp_class, MKDEV(PPP_MAJOR,0)); |
880 | class_simple_destroy(ppp_class); | 880 | class_destroy(ppp_class); |
881 | out_chrdev: | 881 | out_chrdev: |
882 | unregister_chrdev(PPP_MAJOR, "ppp"); | 882 | unregister_chrdev(PPP_MAJOR, "ppp"); |
883 | goto out; | 883 | goto out; |
@@ -2654,8 +2654,8 @@ static void __exit ppp_cleanup(void) | |||
2654 | if (unregister_chrdev(PPP_MAJOR, "ppp") != 0) | 2654 | if (unregister_chrdev(PPP_MAJOR, "ppp") != 0) |
2655 | printk(KERN_ERR "PPP: failed to unregister PPP device\n"); | 2655 | printk(KERN_ERR "PPP: failed to unregister PPP device\n"); |
2656 | devfs_remove("ppp"); | 2656 | devfs_remove("ppp"); |
2657 | class_simple_device_remove(MKDEV(PPP_MAJOR, 0)); | 2657 | class_device_destroy(ppp_class, MKDEV(PPP_MAJOR, 0)); |
2658 | class_simple_destroy(ppp_class); | 2658 | class_destroy(ppp_class); |
2659 | } | 2659 | } |
2660 | 2660 | ||
2661 | /* | 2661 | /* |
diff --git a/drivers/net/wan/cosa.c b/drivers/net/wan/cosa.c index 921a573372e9..7ff814fd65d0 100644 --- a/drivers/net/wan/cosa.c +++ b/drivers/net/wan/cosa.c | |||
@@ -235,7 +235,7 @@ static int dma[MAX_CARDS+1]; | |||
235 | static int irq[MAX_CARDS+1] = { -1, -1, -1, -1, -1, -1, 0, }; | 235 | static int irq[MAX_CARDS+1] = { -1, -1, -1, -1, -1, -1, 0, }; |
236 | 236 | ||
237 | /* for class stuff*/ | 237 | /* for class stuff*/ |
238 | static struct class_simple *cosa_class; | 238 | static struct class *cosa_class; |
239 | 239 | ||
240 | #ifdef MODULE | 240 | #ifdef MODULE |
241 | module_param_array(io, int, NULL, 0); | 241 | module_param_array(io, int, NULL, 0); |
@@ -394,19 +394,19 @@ static int __init cosa_init(void) | |||
394 | goto out; | 394 | goto out; |
395 | } | 395 | } |
396 | devfs_mk_dir("cosa"); | 396 | devfs_mk_dir("cosa"); |
397 | cosa_class = class_simple_create(THIS_MODULE, "cosa"); | 397 | cosa_class = class_create(THIS_MODULE, "cosa"); |
398 | if (IS_ERR(cosa_class)) { | 398 | if (IS_ERR(cosa_class)) { |
399 | err = PTR_ERR(cosa_class); | 399 | err = PTR_ERR(cosa_class); |
400 | goto out_chrdev; | 400 | goto out_chrdev; |
401 | } | 401 | } |
402 | for (i=0; i<nr_cards; i++) { | 402 | for (i=0; i<nr_cards; i++) { |
403 | class_simple_device_add(cosa_class, MKDEV(cosa_major, i), | 403 | class_device_create(cosa_class, MKDEV(cosa_major, i), |
404 | NULL, "cosa%d", i); | 404 | NULL, "cosa%d", i); |
405 | err = devfs_mk_cdev(MKDEV(cosa_major, i), | 405 | err = devfs_mk_cdev(MKDEV(cosa_major, i), |
406 | S_IFCHR|S_IRUSR|S_IWUSR, | 406 | S_IFCHR|S_IRUSR|S_IWUSR, |
407 | "cosa/%d", i); | 407 | "cosa/%d", i); |
408 | if (err) { | 408 | if (err) { |
409 | class_simple_device_remove(MKDEV(cosa_major, i)); | 409 | class_device_destroy(cosa_class, MKDEV(cosa_major, i)); |
410 | goto out_chrdev; | 410 | goto out_chrdev; |
411 | } | 411 | } |
412 | } | 412 | } |
@@ -427,10 +427,10 @@ static void __exit cosa_exit(void) | |||
427 | printk(KERN_INFO "Unloading the cosa module\n"); | 427 | printk(KERN_INFO "Unloading the cosa module\n"); |
428 | 428 | ||
429 | for (i=0; i<nr_cards; i++) { | 429 | for (i=0; i<nr_cards; i++) { |
430 | class_simple_device_remove(MKDEV(cosa_major, i)); | 430 | class_device_destroy(cosa_class, MKDEV(cosa_major, i)); |
431 | devfs_remove("cosa/%d", i); | 431 | devfs_remove("cosa/%d", i); |
432 | } | 432 | } |
433 | class_simple_destroy(cosa_class); | 433 | class_destroy(cosa_class); |
434 | devfs_remove("cosa"); | 434 | devfs_remove("cosa"); |
435 | for (cosa=cosa_cards; nr_cards--; cosa++) { | 435 | for (cosa=cosa_cards; nr_cards--; cosa++) { |
436 | /* Clean up the per-channel data */ | 436 | /* Clean up the per-channel data */ |