diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-19 21:00:37 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-19 21:00:37 +0000 |
commit | 94ac2ab3fff96814d7460a27a0e9d004abbd4128 (patch) | |
tree | 9a4eb8cc234b540b0f4b93363109cdd37a20540b /drivers/isdn/capi/capi.c | |
parent | Adding debian version 6.8.12-1. (diff) | |
download | linux-94ac2ab3fff96814d7460a27a0e9d004abbd4128.tar.xz linux-94ac2ab3fff96814d7460a27a0e9d004abbd4128.zip |
Merging upstream version 6.9.2.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'drivers/isdn/capi/capi.c')
-rw-r--r-- | drivers/isdn/capi/capi.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/drivers/isdn/capi/capi.c b/drivers/isdn/capi/capi.c index 6e80d7bd3c..3ed2573345 100644 --- a/drivers/isdn/capi/capi.c +++ b/drivers/isdn/capi/capi.c @@ -49,7 +49,9 @@ MODULE_LICENSE("GPL"); /* -------- driver information -------------------------------------- */ static DEFINE_MUTEX(capi_mutex); -static struct class *capi_class; +static const struct class capi_class = { + .name = "capi", +}; static int capi_major = 68; /* allocated */ module_param_named(major, capi_major, uint, 0); @@ -1393,18 +1395,19 @@ static int __init capi_init(void) kcapi_exit(); return major_ret; } - capi_class = class_create("capi"); - if (IS_ERR(capi_class)) { + + ret = class_register(&capi_class); + if (ret) { unregister_chrdev(capi_major, "capi20"); kcapi_exit(); - return PTR_ERR(capi_class); + return ret; } - device_create(capi_class, NULL, MKDEV(capi_major, 0), NULL, "capi20"); + device_create(&capi_class, NULL, MKDEV(capi_major, 0), NULL, "capi20"); if (capinc_tty_init() < 0) { - device_destroy(capi_class, MKDEV(capi_major, 0)); - class_destroy(capi_class); + device_destroy(&capi_class, MKDEV(capi_major, 0)); + class_unregister(&capi_class); unregister_chrdev(capi_major, "capi20"); kcapi_exit(); return -ENOMEM; @@ -1427,8 +1430,8 @@ static void __exit capi_exit(void) { proc_exit(); - device_destroy(capi_class, MKDEV(capi_major, 0)); - class_destroy(capi_class); + device_destroy(&capi_class, MKDEV(capi_major, 0)); + class_unregister(&capi_class); unregister_chrdev(capi_major, "capi20"); capinc_tty_exit(); |