summaryrefslogtreecommitdiffstats
path: root/arch/mips/sibyte
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-08-07 13:11:40 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-08-07 13:11:40 +0000
commit8b0a8165cdad0f4133837d753649ef4682e42c3b (patch)
tree5c58f869f31ddb1f7bd6e8bdea269b680b36c5b6 /arch/mips/sibyte
parentReleasing progress-linux version 6.8.12-1~progress7.99u1. (diff)
downloadlinux-8b0a8165cdad0f4133837d753649ef4682e42c3b.tar.xz
linux-8b0a8165cdad0f4133837d753649ef4682e42c3b.zip
Merging upstream version 6.9.7.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'arch/mips/sibyte')
-rw-r--r--arch/mips/sibyte/common/sb_tbprof.c21
1 files changed, 9 insertions, 12 deletions
diff --git a/arch/mips/sibyte/common/sb_tbprof.c b/arch/mips/sibyte/common/sb_tbprof.c
index 408db45efd..af53339869 100644
--- a/arch/mips/sibyte/common/sb_tbprof.c
+++ b/arch/mips/sibyte/common/sb_tbprof.c
@@ -535,13 +535,14 @@ static const struct file_operations sbprof_tb_fops = {
.llseek = default_llseek,
};
-static struct class *tb_class;
+static const struct class tb_class = {
+ .name = "sb_tracebuffer",
+};
static struct device *tb_dev;
static int __init sbprof_tb_init(void)
{
struct device *dev;
- struct class *tbc;
int err;
if (register_chrdev(SBPROF_TB_MAJOR, DEVNAME, &sbprof_tb_fops)) {
@@ -550,15 +551,11 @@ static int __init sbprof_tb_init(void)
return -EIO;
}
- tbc = class_create("sb_tracebuffer");
- if (IS_ERR(tbc)) {
- err = PTR_ERR(tbc);
+ err = class_register(&tb_class);
+ if (err)
goto out_chrdev;
- }
-
- tb_class = tbc;
- dev = device_create(tbc, NULL, MKDEV(SBPROF_TB_MAJOR, 0), NULL, "tb");
+ dev = device_create(&tb_class, NULL, MKDEV(SBPROF_TB_MAJOR, 0), NULL, "tb");
if (IS_ERR(dev)) {
err = PTR_ERR(dev);
goto out_class;
@@ -573,7 +570,7 @@ static int __init sbprof_tb_init(void)
return 0;
out_class:
- class_destroy(tb_class);
+ class_unregister(&tb_class);
out_chrdev:
unregister_chrdev(SBPROF_TB_MAJOR, DEVNAME);
@@ -582,9 +579,9 @@ out_chrdev:
static void __exit sbprof_tb_cleanup(void)
{
- device_destroy(tb_class, MKDEV(SBPROF_TB_MAJOR, 0));
+ device_destroy(&tb_class, MKDEV(SBPROF_TB_MAJOR, 0));
unregister_chrdev(SBPROF_TB_MAJOR, DEVNAME);
- class_destroy(tb_class);
+ class_unregister(&tb_class);
}
module_init(sbprof_tb_init);